When a molecular model contains many conformations, finding the paths relevant to a particular task can become a small but persistent annoyance. A long list of paths is hard to scan, and names alone may not tell you which conformations are large enough to examine. In SAMSON, the Node Specification Language (NSL) provides a direct way to narrow the search by a path’s number of atoms.
The key attribute is path.numberOfAtoms, abbreviated p.nat. It applies to the path attribute space, which matches only conformation nodes. That scope matters: this filter is for paths, not a general way to count atoms in any kind of node.
Start with a threshold
If you want to identify paths containing more than 100 atoms, use:
p.nat > 100
This is useful when you have a rough size cutoff in mind—for example, when you want to set aside smaller conformations and focus attention on larger ones. The longer form is path.nat > 100; both forms refer to the same attribute. The short prefix p is simply a compact way to write the path attribute space.
Use a range when size is the criterion
Sometimes a minimum is not enough. To match paths with an atom count between 100 and 200, the documented expression is:
p.nat 100:200
A range can be more practical than repeatedly adjusting a threshold when you are interested in a particular size band. For example, it gives you a way to focus on paths in that interval without relying on their names to encode size. The documentation describes this as matching paths with the number of atoms between 100 and 200.
Keep path filters distinct from inherited attributes
The path attribute space also inherits several attributes from the general node space. That means you can refer to a path’s name with p.n, such as p.n "A", or check whether it is selected with p.selected. The selection flag has the short form p.sf, and the documented examples include p.sf false and p.sf.
These attributes answer different questions. p.nat describes atom count; p.n refers to the name; and p.selected and p.sf refer to selection-related attributes. In particular, the inherited selected attribute does not have the short name s in the path space, so use p.selected rather than assuming that shorthand applies here.
A simple way to choose an expression
- Know only that a path should be larger than a cutoff? Try
p.nat > 100. - Need to target a size interval? Try
p.nat 100:200. - Looking for a named path? Use the inherited name attribute, for example
p.n "A". - Checking selection state instead of size? Use
p.selectedor the selection-flag attributep.sf.
Keeping the question clear—size, name, or selection—makes it easier to choose the appropriate attribute and understand what a query is matching. For the complete path attribute reference and further examples, see the SAMSON path NSL documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
