Quickly Filter Molecules by Atom Types, Chains, or Residues in SAMSON

When working with complex molecular systems, modelers often face a common challenge: how to efficiently pick and analyze only the molecules that meet specific structural criteria. Whether you’re trying to extract smaller fragments from massive biomolecules or isolate candidates for simulation based on basic composition, doing this manually can be time-consuming and error-prone.

Fortunately, if you’re using SAMSON, the integrative molecular design platform, the Node Specification Language (NSL) offers a concise and powerful way to query for molecules with desired attributes. In this post, we’ll look at practical filters you can use in NSL to quickly pinpoint molecules based on their number of atoms, chains, residues, or elemental composition.

πŸ’‘ Practical Use Case: Finding Ligands in a Biomolecular Environment

Imagine you’ve imported a structure containing a protein complex and several small ligands. You want to quickly select the ligands for analysis β€” not the protein. Ligands typically have:

  • Fewer atoms
  • Only one chain
  • Fewer residues

Using NSL, you can write a simple query:

This matches molecules with less than 100 atoms, exactly one chain, and fewer than 10 residues β€” effectively isolating many common ligands.

πŸ” Attribute Overview

Here are some key molecule attributes exposed in NSL:

  • mol.nc: number of chains
  • mol.nr: number of residues
  • mol.nat: number of atoms
  • mol.nC, mol.nH, mol.nN, mol.nO, mol.nS: number of carbons, hydrogens, nitrogens, oxygens and sulfurs
  • mol.fc: formal charge
  • mol.pc: partial charge

Each can be combined with comparison operators (<, >, ==) and ranges (e.g., 10:20).

🎯 Example Queries

Here are a few practical examples:

  • mol.nC > 15 – Molecules with more than 15 carbon atoms
  • mol.nr 50:100 – Molecules with 50–100 residues
  • mol.nO < 5 and mol.nH > 10 – Oxygen-poor, hydrogen-rich molecules

Combining and nesting queries allows you to create highly specific selections while still being readable.

πŸ§ͺ Why It Matters

This filtering capability helps molecular modelers:

  • Focus on ligands, cofactors, or fragments inside large structural datasets
  • Prepare subsets of molecules for simulation or property calculation
  • Standardize selection criteria in workflows to improve reproducibility

It’s especially useful when dealing with systems like protein assemblies from PDB files, where identifying functional molecules quickly is essential.

You can combine this with visualization filters or export selections for further use in other SAMSON tools or extensions.

To learn more about all available molecule attributes, visit the full documentation page: NSL Molecule Attributes

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.