Easily Filter Molecular Models by Size in SAMSON

When working with complex molecular systems, especially large biomolecules or materials, molecular modelers often face the challenge of managing and organizing large numbers of structures. One common pain point is the need to filter out parts of a system based on quantitative attributes—say, to isolate folders that have more than 100 atoms, or that contain structures with a specific number of residues or chains.

In SAMSON, this task is made easier through the Node Specification Language (NSL), and more specifically, through folder attributes tailored to structural properties. You can use these attributes to create powerful filters and search queries that help identify only the parts of a molecular system that meet specific structural criteria.

Matching Folders by Atom Counts

The folder.numberOfAtoms attribute (short name: f.nat) is one of the most useful tools for dealing with molecular subsystems of different sizes. For instance, to find folders with more than 100 atoms, you can use:

Or to locate structures with an atom count ranging from 100 to 200:

This is particularly useful if you want to:

  • Filter out fragments from a system that are too small to analyze meaningfully
  • Target medium-sized ligands or molecules in a large biomolecular complex
  • Group folders by structural complexity for simulation setup

Beyond Atoms: Chains, Molecules, Residues

Filtering by number of atoms is just one approach. You can extend this power to other structural elements:

  • f.nc: Number of chains
  • f.nm: Number of molecules
  • f.nr: Number of residues
  • f.ns: Number of segments

Each of these attributes allows integer values and supports ranges. For example:

A Practical Example

Imagine you are analyzing a protein-ligand complex and want to work only with the chains that represent proteins. If you know your proteins typically include more than 120 residues, you can use:

This would instantly hide away small fragments, ligands, or ions automatically loaded with the structure—letting you focus on the protein chains only.

Working With Elemental Count Attributes

Attributes also exist for elemental counts, such as f.nC (carbon), f.nH (hydrogen), f.nO (oxygen), etc. This can help if you’re analyzing atomic composition, such as filtering hydrocarbons by:

Or for hydrogen-rich compounds:

Tips for Effective Use

  • All these filters work in combination: you can use multiple attributes at once in your queries for refined filtering.
  • Try using the short attribute names (e.g. f.nm) for quicker query writing.
  • Ranges are inclusive: f.nr 100:130 includes structures with exactly 100 and 130 residues too.

These filters become especially helpful when you’re preparing simulations, extracting specific fragments for docking studies, or curating datasets from large generated libraries. With just a few lines, you can isolate the systems that matter, save time, and reduce errors.

To learn more, explore the full list of folder attributes in the documentation here: https://documentation.samson-connect.net/users/latest/nsl/folder/

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

Comments are closed.