Find the right molecular paths by atom count

When a molecular project contains many conformations, it can be difficult to narrow the list to paths of a useful size. A path’s atom count gives you a simple, concrete way to filter: for example, you can look for paths with more than 100 atoms or constrain a search to paths between 100 and 200 atoms.

In SAMSON’s Node Specification Language (NSL), path attributes belong to the path attribute space, abbreviated p. This space matches conformation nodes. The attribute for counting atoms is numberOfAtoms, abbreviated nat.

Start with a size threshold

To match paths containing more than 100 atoms, write:

p.nat > 100

The longer form is path.nat > 100. Both forms express the same condition: the path’s number of atoms must be greater than 100. This can be useful when a project includes paths with widely varying atom counts and you want to focus on larger ones.

Use a range when a cutoff is not enough

A single threshold may return paths that are too large for the task at hand. To match paths with an atom count between 100 and 200, use:

p.nat 100:200

The full attribute form is path.nat 100:200. A range makes the intended size window explicit, which can help make a query easier to read and adapt later. Change the two numbers to describe the interval you need.

Keep the meaning of the count clear

numberOfAtoms describes how many atoms a path has. It is an integer-valued attribute; it does not, by itself, describe a path’s length, its number of conformations, or a geometric measurement. If your selection criterion is atom count, this attribute is a direct match for that question.

Also keep in mind what the p prefix targets: the path attribute space matches conformation nodes. It is not a general-purpose filter for every kind of node in a molecular document. Being precise about the target helps avoid confusing a path query with a query for atoms or other nodes.

Combine the count with inherited path attributes

Path nodes also inherit attributes from the node attribute space. For instance, you can refer to a path’s name with p.n, using a quoted string such as p.n "A". The name attribute supports string values, and the documentation also shows a wildcard-style example: p.n "L*".

Selection-related attributes are inherited too. You can test whether a path is selected with p.selected, or use not p.selected for the opposite condition. The path form of selected does not have the short name s; write the full word. The inherited selectionFlag attribute has the short name sf, with examples including p.sf and p.sf false.

These attributes give you useful building blocks: atom-count criteria describe path size, while name and selection criteria describe other properties of the same path. Use the form that best communicates what you are trying to find, and keep each condition tied to the correct attribute.

For the complete attribute reference and syntax examples, see the SAMSON path attributes documentation.

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

Comments are closed.