When working with molecular conformations, large biomolecular assemblies, or polymers, it’s common for modelers to find themselves drowning in a sea of structures. Let’s say you’re only interested in those conformations that contain more than 100 atoms, or just the ones selected in your current session. Filtering these efficiently while browsing or scripting can dramatically improve productivity—and that’s where SAMSON’s Node Specification Language (NSL) and its path attributes come in.
Understanding and using path attributes can simplify this process with concise, readable expressions that directly match the structural elements you care about.
What Are Path Attributes?
In the NSL, each node refers to an object in the molecular model. “Path” nodes refer to conformations, and the path
attribute space (short name: p
) supports specific filters related to these. Some of these attributes are inherited from general nodes (like selected
), while others are specific to paths—such as numberOfAtoms
(p.nat
).
Filtering by Atom Count
The p.nat
expression lets you directly access the number of atoms in a path. This is particularly useful when modelers want to focus on biologically relevant conformations, or avoid noise from tiny fragments:
p.nat > 100
: matches all conformations with more than 100 atoms.p.nat 100:200
: matches paths containing between 100 and 200 atoms (inclusive).
These can be used in combination with other path or node-level expressions for more precise selection. For example, to find selected paths with >100 atoms:
p.selected and p.nat > 100
When Is This Useful?
This is particularly helpful when you’re working with structures that include many conformations—such as trajectory frames, conformer ensembles, or alternate binding poses.
Imagine analyzing a docking result with hundreds of predicted poses. Instead of scrolling through everything, a quick NSL query like p.nat > 200
immediately narrows your focus to complex poses only. You can also combine it with name patterns, e.g.:
p.n "L*" and p.nat > 150
: matches all poses whose name starts with “L” and have more than 150 atoms.
Other Useful Attributes
- Selection: Use
p.selected
ornot p.selected
to filter based on selection state. - Selection flags:
p.sf
can be used for more advanced selection workflows. - Name-based queries: With
p.n
, you can match using strings or partial matches (e.g.,p.n "A*"
).
Conclusion
Using path attributes in NSL helps molecular modelers zero in on the data that really matters. Whether you’re browsing a large model interactively or scripting an automated process, these simple yet powerful filters can save time and reduce complexity.
To explore more attributes and examples, visit the full documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.