Too Many Conformations? Filter Paths by Atom Count

When a molecular project contains many conformations, finding the ones relevant to a task can become a small but persistent frustration. A long list is difficult to scan, and a name alone may not tell you whether a conformation is the right size for the comparison or analysis you have in mind.

SAMSON’s Node Specification Language (NSL) offers a direct way to narrow the search: filter path nodes by their number of atoms. This is useful when you want to focus on larger paths, or inspect a specific range, without relying only on labels.

First, what does “path” mean here?

The path attribute space matches only conformation nodes. Its short name is p, so you can write p instead of path in an expression. This distinction matters: a path query is intended to find conformations, not arbitrary nodes in the molecular structure.

Find paths above a size threshold

To match paths with more than 100 atoms, use:

p.nat > 100

Here, nat is the short name for numberOfAtoms. The longer form is path.numberOfAtoms > 100. Both express the same filter. The threshold can be adjusted to suit the question you are asking—for example, to separate relatively small conformations from larger ones.

This kind of filter is especially helpful when the exact path names are not meaningful enough to guide your search. Instead of opening entries one by one, you can start with a measurable property and reduce the set to paths whose atom count is above your chosen cutoff.

Search within a range

If you need a bounded interval rather than everything above a threshold, specify a range:

p.nat 100:200

This matches paths with a number of atoms between 100 and 200. A range is useful when you want to focus on a comparable group of conformations or avoid including paths that are far larger or smaller than the cases you are inspecting.

Both examples use integer values. The documentation describes numberOfAtoms as an integer-valued attribute and shows the greater-than operator and range notation as supported forms.

Use names and selection state when they help

Path nodes also inherit attributes from the general node attribute space. For example, p.n "A" matches a path named “A,” while p.n "L*" is an example of a name pattern. The name attribute can be useful when your paths already follow a naming convention; atom-count filters are an alternative when names are inconsistent or too broad.

You can also query whether a path is selected with p.selected, or match unselected paths with not p.selected. The selection flag has its own short name, sf; examples include p.sf and p.sf false. Note that selected does not have the short name s in the path attribute space.

A practical way to approach a crowded set

  1. Start with the question you need to answer: are you looking for paths above a minimum size, or within a particular size interval?

  2. Use p.nat > N for a threshold, or p.nat A:B for a range, replacing the letters with the integer values you need.

  3. If names or selection state are relevant, use the documented path attributes such as p.n, p.selected, or p.sf to inspect those properties as well.

The key benefit is a more deliberate search: atom count gives you a simple, objective first filter, while names and selection state provide other ways to describe the paths you care about. For the full attribute reference and additional examples, see the SAMSON path attributes documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.