Anyone who’s worked with large molecular systems in SAMSON knows that identifying and selecting specific molecules based on their properties can quickly become tedious. If you’ve ever found yourself manually seeking out molecules with a certain number of residues, or trying to filter by visibility, chain count, or atom composition, you’re not alone. Thankfully, SAMSON’s Node Specification Language (NSL) streamlines this process by allowing powerful attribute-based molecule selection. This post introduces practical use cases of molecule attributes in NSL to simplify and speed up your modeling workflows.
Why attributes matter for selection
Molecule attributes in NSL are designed to match molecule nodes based on structural or visual characteristics. Whether you’re working on a protein-ligand complex or a supramolecular assembly, these attributes offer a programmable way to slice your system into manageable pieces.
Useful molecule attributes at a glance
- Number of chains (
mol.nc): e.g.,mol.nc < 3 - Number of residues (
mol.nr): e.g.,mol.nr 100:130 - Number of atoms (
mol.nat): e.g.,mol.nat < 1000 - Visibility (
mol.v): e.g.,not mol.vto filter hidden molecules - Partial charge (
mol.pc): e.g.,mol.pc > 1.5 - Name matching (
mol.n): e.g.,mol.n "L*"for all molecules starting with 'L'
Real-world examples
Let's say you're working with a large biomolecular simulation and you want to isolate only smaller molecules with limited complexity. You could write:
|
1 |
mol.nat < 500 and mol.nr < 50 and mol.nc < 2 |
This query will return molecules that have less than 500 atoms, fewer than 50 residues, and less than 2 chains – perfect for identifying small ligands or ions within your ensemble.
Alternatively, to identify all title molecules named like water, you could use:
|
1 |
mol.n "H2O" |
Or even filter out all invisible molecules that might clutter your project view:
|
1 |
not mol.v |
Combining attributes for targeted selection
NSL allows you to combine multiple attribute-based filters for highly specific selections. Here’s one line that selects molecules with more than 3 chains and visible in the viewport:
|
1 |
mol.nc > 3 and mol.v |
Need molecules enriched in a particular element? Try filtering by the number of specific atoms (e.g., sulfurs):
|
1 |
mol.nS > 10 |
Want only positively charged species?
|
1 |
mol.fc > 0 |
The best part? These filters are composable and easily integrated into selection and analysis workflows inside SAMSON, removing the need to manually inspect systems component by component.
Key takeaways
- Use
mol.[attribute]syntax to query molecule nodes efficiently. - Attribute filters can be combined with logical operators like
and,or, andnot. - Ranges are supported (e.g.,
mol.nat 100:300). - String matching (e.g.,
mol.n "L*") helps match molecule names with wildcards.
With these tips, you can move faster through system preparation, analysis, and visualization – especially for larger and more complex molecular assemblies.
To learn more and explore the full list of molecule attributes, visit the official documentation page: https://documentation.samson-connect.net/users/latest/nsl/molecule/
SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON at https://www.samson-connect.net.
