Find the right conformations without checking every path by hand

When a molecular project contains many conformations, it can be tedious to inspect paths one by one just to find those with a particular name, selection state, or atom count. SAMSON’s Node Specification Language (NSL) lets you describe these criteria as expressions. For paths, the key idea is simple: use the path attribute space, abbreviated p, to match conformation nodes.

Start with the question you need to answer

Before writing a query, decide what distinguishes the paths you want. Is it their size? Their name? Whether they are selected? A precise criterion makes it easier to narrow a large set without confusing path-level filtering with a search for individual atoms.

Filter paths by atom count

The path-specific attribute numberOfAtoms, abbreviated nat, matches paths according to their number of atoms. For example:

  • p.nat > 100 matches paths with more than 100 atoms.
  • p.nat 100:200 matches paths with an atom count between 100 and 200.

These two expressions answer different practical questions. Use the first when you want to exclude smaller paths but do not need an upper limit. Use the range when you want to focus on a bounded size interval—for example, to keep attention on paths of comparable scale. The expression describes a property of each path; it is not a request to select individual atoms within a path.

The long form is path.nat, so the same criteria can be written as path.nat > 100 or path.nat 100:200. The short form is more compact, while the long form can make a query easier to read when you are learning NSL or revisiting it later.

Combine size with inherited node attributes

Paths also inherit several attributes from the general node attribute space. That means you can describe them by name or selection state as well as by atom count. For example, the documentation shows name expressions such as p.n "A" and p.n "L*". The name attribute accepts strings in quotes.

Selection state can be expressed with p.selected or not p.selected. The inherited selectionFlag attribute has the short name sf and accepts true or false; examples include p.sf and p.sf false. These are separate available attributes, so choose the one that corresponds to the condition you intend to express.

For instance, if your immediate goal is to find paths above a size threshold, begin with p.nat > 100. If names or selection state matter too, add those criteria using the relevant path attributes. Keeping the first query focused also makes it easier to spot a mistaken threshold or attribute before adding more conditions.

A quick check before you run a query

  • Are you matching paths? Use the path space (p), which matches conformation nodes.
  • Is the criterion an atom count? Use p.nat, not the name attribute.
  • Do you need a cutoff or a range? Write p.nat > 100 for a lower threshold, or p.nat 100:200 for a bounded interval.
  • Is the condition about a name or selection state? Use the inherited attributes, such as p.n or p.selected.

This small set of attributes can turn a tedious manual scan into a clear, repeatable description of the paths you are looking for. For the complete attribute reference and examples, see the SAMSON path attributes documentation.

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

Comments are closed.