When working on complex molecular systems in SAMSON, modelers often need to find and analyze long molecular paths—chains of atoms within molecules that represent important structural or dynamic components. Imagine having to locate all backbone paths in a protein that exceed 100 atoms, or to filter specific structural patterns in large-scale simulations. Doing this manually can be tedious and error-prone. Fortunately, SAMSON’s Node Specification Language (NSL) provides a clean and efficient way to streamline these tasks using the path.numberOfAtoms attribute.
Why Care About Path Length?
The number of atoms in a molecular path can represent the length of a backbone or a sidechain in biomolecular systems. Detecting chains above a certain threshold can help when:
- Identifying long structural features like alpha helices or beta strands.
- Filtering out short noise paths from longer relevant conformations.
- Preparing subsets for analysis, animation, or simulation.
Instead of manually browsing your structures, NSL lets you describe and find what you’re interested in with a single line of text.
How to Use path.numberOfAtoms in NSL
The attribute path.numberOfAtoms (or its short name p.nat) allows you to match molecular paths based on how many atoms they contain. It only applies to nodes that represent conformations. Here’s how to filter paths:
p.nat > 100→ Selects all paths that contain more than 100 atoms.p.nat 100:200→ Selects all paths with 100 to 200 atoms.
You can combine this attribute with other conditions for more powerful queries. For example, to select paths whose names start with “A” and contain over 150 atoms:
|
1 |
p.n "A*" and p.nat > 150 |
What Makes This Useful
Using path.numberOfAtoms saves time and improves precision in analysis. Whether you are selecting candidates for conformational sampling, filtering data before export, or generating visualizations for longer molecular chains, this NSL attribute gets straight to the point.
Working Smarter with NSL
SAMSON’s NSL is case-sensitive and powerful when used thoughtfully. Here are a few tips:
- Add an asterisk (
*) to allow wildcard matches in string-based criteria like names. - Use
andandorto combine multiple path criteria. - Use
notto invert a match; for example,not p.nat <= 100.

If you’re dealing with large molecular files and need to isolate meaningful structures quickly, try the path.numberOfAtoms attribute in your selection filter. It helps you avoid digging through hundreds of nodes and ensures your selection process stays consistent and reproducible.
To learn more and explore additional NSL capabilities, visit the original SAMSON NSL path attribute documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
