Too Many Conformations? Filter Paths by Atom Count

When a molecular project contains many conformations, finding the paths relevant to a task can take longer than expected. A useful first step is to narrow the set by a property you can check directly: the number of atoms in each path. In SAMSON’s Node Specification Language (NSL), the path attribute space provides a dedicated filter for this.

A path attribute query matches conformation nodes. The attribute numberOfAtoms, abbreviated nat, lets you select paths using an integer count. For example, p.nat > 100 matches paths with more than 100 atoms. If you are looking for paths in a particular size range, use p.nat 100:200, which matches paths with a number of atoms between 100 and 200.

Start with a practical filter

Suppose you are reviewing a collection and want to focus on larger paths rather than inspect every conformation one by one. Entering p.nat > 100 gives you a direct, readable criterion. If that produces too broad a set, a range such as p.nat 100:200 offers a more focused alternative. The full attribute name works too: path.nat > 100 is the short form of path.numberOfAtoms > 100.

This is especially helpful when the goal is to organize or inspect a collection according to size. Instead of relying on a visual impression of a molecular structure, the query states the criterion explicitly. It is also easy to revisit: the number and comparison are visible in the expression, making the filter’s intent clear later.

Know which attribute space you are querying

The short prefix p refers to the path attribute space. That detail matters: these attributes match conformation nodes, not every kind of node in a document. If a query does not return the nodes you expect, first check whether you are targeting paths and whether the attribute is appropriate for them.

Path nodes also inherit several attributes from the general node attribute space. For example, a path can be matched by name with p.n "A"; the documentation also gives p.n "L*" as an example. The inherited selected attribute can be queried as p.selected or negated as not p.selected. Unlike some node attributes, selected has no short name in the path attribute space. The inherited selectionFlag attribute does have the short name sf, with examples including p.sf and p.sf false.

A small check before you run a query

  • Use p.nat when filtering paths by atom count.
  • Use an integer comparison, such as > 100, or an integer range, such as 100:200.
  • Remember that p means the path attribute space and that path attributes match conformation nodes.
  • For inherited attributes, check the full name and short name: selected has no path short name, while selectionFlag is abbreviated sf.

These few checks can prevent a common source of wasted time: building a query around the right idea but using the wrong attribute prefix or abbreviation. For the complete 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.