Molecular modelers often work with large and complex structures consisting of multiple paths or conformations. When analyzing such data, one common task is to identify and isolate specific molecular paths based on their size — for instance, focusing on paths with a certain number of atoms. Doing this manually can be time-consuming and error-prone. This is where the numberOfAtoms attribute in SAMSON’s Node Specification Language (NSL) makes a difference.
Why filter by number of atoms?
In many molecular modeling scenarios, researchers want to focus only on significant conformations or paths that meet certain criteria. For example, one might want to:
- Ignore small fragments or solvent paths with very few atoms.
- Focus on large assemblies or domains by selecting paths with more than 100 atoms.
- Analyze paths within a specific size range to compare structurally similar units.
This type of selection is straightforward in SAMSON thanks to NSL’s path.numberOfAtoms attribute — a tool that can save time and reduce clutter in your analysis.
How it works
The numberOfAtoms (or nat for short) attribute belongs to the path attribute space, denoted by p. It allows you to filter paths based purely on how many atoms they contain. The values accepted are integers or ranges of integers.
Some useful queries include:
p.nat > 100: Selects all paths containing more than 100 atoms.p.nat 100:200: Selects all paths containing between 100 and 200 atoms.
These expressions can be typed into selection fields when using filtering tools in SAMSON that accept NSL queries.
Usage examples
Let’s say you are working with a protein complex, and you’re only interested in intact protein chains while ignoring bound ligands or water molecules. Ligands and water often appear as small paths with fewer than 20 atoms. You can use:
|
1 |
p.nat > 50 |
to highlight all significant chains while hiding smaller components.
In comparative studies or structural clustering workflows, selecting paths with a similar number of atoms helps maintain consistency. For instance, by using:
|
1 |
p.nat 120:150 |
you restrict your dataset to paths within a specific atom count, ideal for normalizing input to machine learning pipelines or global alignment routines.
Best practices
When using p.nat, remember that it:
- Applies only to conformation nodes (paths).
- Is effective when used alongside other attributes (e.g. name, selection flags) to fine-tune your queries.
- May involve invisible hydrogen atoms — consider preprocessing your model if needed.
Streamlining your workspace by focusing only on relevant molecular paths can significantly accelerate your workflow and reduce visual clutter.
To learn more, visit the full documentation page here: https://documentation.samson-connect.net/users/latest/nsl/path/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
