Find the Conformations That Matter: Filtering Paths by Atom Count

When a molecular model contains many conformations, finding the paths relevant to a particular analysis can become a small but persistent source of friction. A long list of paths is difficult to scan by eye, especially when the useful distinction is simply their size. In SAMSON, the Node Specification Language (NSL) can narrow the search using attributes of conformation nodes—including the number of atoms in a path.

Start with the path attribute space

Path-specific queries use the path attribute space, abbreviated as p. This space matches only conformation nodes, so it is the appropriate place to express criteria about paths rather than about nodes in general.

The attribute that answers a size-related question is numberOfAtoms, with the short form nat. For example, this expression matches paths containing more than 100 atoms:

p.nat > 100

The full form is path.nat > 100. The short form is useful when you are writing or reusing expressions frequently; the full form can be easier to read when you are first learning NSL.

Use a range when a threshold is not enough

Sometimes the question is not “Which paths are large?” but “Which paths fall within a useful size band?” The range form lets you express that directly:

p.nat 100:200

This expression matches paths with a number of atoms between 100 and 200. It can be a more focused starting point than a single lower threshold when you want to inspect a bounded group of paths.

These examples are criteria, not a replacement for deciding what is scientifically relevant. The right threshold depends on the system and the task. The practical benefit is that once you have chosen a useful cutoff, the expression makes it explicit and repeatable instead of relying on a manual scan.

Combine size with inherited path attributes

Path nodes also inherit several attributes from the general node attribute space. In particular, you can refer to a path’s name with p.n, and to its selection state with p.selected. For example, the documentation shows name expressions such as p.n "A" and p.n "L*". These can help distinguish paths by name as well as by their atom count.

Selection-related attributes are available too: p.selected and p.sf (the short form of selectionFlag). The documentation also shows not p.selected for expressing the opposite selection state. These inherited attributes are useful to know when you want to reason about path criteria alongside name or selection information. Note that selected does not have the short name s in the path attribute space.

A simple workflow for building a query

  1. Choose the kind of node. Use the path space when your target is a conformation path: start with p.
  2. State the property you care about. Use nat for atom count, followed by a threshold or range.
  3. Add context when useful. Path names and inherited selection attributes are available in the same attribute space.
  4. Check the expression against the actual task. A cutoff such as p.nat > 100 is only meaningful when that threshold fits your model and analysis.

The key takeaway is simple: when path lists become hard to inspect, turn the property you care about into an explicit NSL criterion. Atom-count filters make it easier to locate paths by size, while inherited attributes provide additional ways to describe the paths you want to examine.

Learn more in the path attribute reference.

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

Comments are closed.