When working with large molecular systems, it’s often necessary to filter out simpler conformations and focus on more complex molecular substructures. For example, in DNA-protein complexes, signaling pathways, or molecular machines, paths containing a high number of atoms can represent structurally or functionally significant components. But manually finding such elements can be time-consuming and error-prone.
This is where the Node Specification Language (NSL) in SAMSON becomes a helpful ally. In particular, the numberOfAtoms attribute of the path attribute space allows modelers to precisely select paths based on their complexity — measured by the number of atoms they contain — with just a line of code.
What is numberOfAtoms in NSL?
The path.numberOfAtoms attribute (short name: p.nat) targets path nodes according to an integer value: the number of atoms that define a path. This is useful to identify complex or structurally large components, especially after importing, simulating, or editing biomolecular systems.
Practical Use Cases
Imagine you are analyzing a multi-chain protein complex and want to examine only the longest chain-like substructures. Instead of visually sifting through the structure:
- Use
p.nat > 100to select all paths composed of more than 100 atoms. This could correspond to larger molecular chains or backbones. - Alternatively, select moderate-sized molecule segments using ranges like
p.nat 100:200.
By applying these simple statements, you can instantly isolate the relevant molecular paths. This is especially time-saving during structural annotation, interaction mapping, or simulation setup.
Syntax Recap
The syntax is consistent with other NSL forms:
path.nat > 100or its short versionp.nat > 100: matches paths with more than 100 atoms.path.nat 100:200orp.nat 100:200: matches paths between 100 and 200 atoms.
No need to pre-label large substructures or count them manually — let NSL handle it for you.
Combining Attributes
These selection criteria become even more powerful when combined with other path or node attributes, such as:
p.selected and p.nat > 150: filters already selected paths that are also large.not p.sf and p.nat > 100: ignores paths with active selection flags while highlighting larger paths.
Such flexibility supports both interactive workflows and automation pipelines, especially when working inside SAMSON’s visual interface or scripting environments.
Why This Matters
As molecular models grow in complexity — with dynamics, hierarchical representations, and multiscale data — the ability to filter based on structural size becomes essential. Whether you’re studying folding patterns, exporting specific chains for further simulations, or simply focusing your view, p.nat lets you cut through the molecular noise.
Next time you’re handling a structure with dozens of paths and need to home in on the most complex ones, remember: a single line like p.nat > 100 might save you hours.
To learn more about the path attribute space and other selectors, visit the original NSL documentation: https://documentation.samson-connect.net/users/latest/nsl/path/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download the platform at https://www.samson-connect.net.
