When working with complex molecular systems, it is often necessary to focus on conformations that meet specific structural criteria. One frequently encountered need is identifying conformations with a large number of atoms—common in macromolecular systems or aggregated structures.
If you’re using SAMSON for molecular design, you’re probably already familiar with the Node Specification Language (NSL), which helps you query nodes in a scene. But did you know that SAMSON’s NSL allows you to filter conformations based on their number of atoms, making it much easier to select relevant structures in large datasets?
Why filter by number of atoms?
When you load large ensembles of conformations (e.g., from molecular dynamics simulations), it can be difficult to track which ones meet certain complexity requirements. Some conformations may correspond to small fragments, while others are complete assemblies or aggregates. Selecting only the conformations with enough atoms allows you to:
- Ignore fragmented or incomplete structures
- Focus on structurally significant conformations
- Automate scripting or batch operations only on valid targets
Using co.nat in NSL
The attribute numberOfAtoms is specific to the “conformation” attribute space in NSL. This attribute can be used to query and filter conformations based on how many atoms they contain. In NSL code, this is abbreviated using co.nat.
Here are a few practical examples:
co.nat > 100: Matches all conformations with more than 100 atoms.co.nat 100:200: Selects conformations with between 100 and 200 atoms (inclusive).
These expressions can be entered in the NSL query bar or used in scripts that automate selection and filtering in SAMSON. For example, if you are analyzing a simulation with hundreds of frames, and only a subset of them correspond to aggregated states or valid complex structures, filtering with co.nat > 100 will significantly speed up your workflow.
Combining with other attributes
You can also combine co.nat with other attributes in NSL. For example:
co.nat > 150 and co.selected: Matches conformations with more than 150 atoms that have already been selected in the GUI.co.nat 50:100 and not co.sf: Matches conformations with between 50 and 100 atoms and without selection flags.
When should you use this?
This approach is useful in many situations, such as:
- Filtering frames from a molecular dynamics simulation
- Working with structural ensembles from docking runs
- Selecting specific models from a morph or interpolation
These small but effective NSL expressions enable users to work faster by reducing manual sorting. And because NSL is reproducible, it ensures consistent analyses.
📚 To learn more about available attributes and see further examples, visit the full documentation page on Conformation Attributes in NSL.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.
