A quicker way to sort a crowded molecular scene

A molecular workspace can fill up fast: a large biomolecular assembly beside smaller ligands, solvent molecules, or other structures. When you need to find a particular kind of molecule, scanning names and representations one by one is tedious—and size alone can be misleading. SAMSON’s Node Specification Language (NSL) lets you filter molecule nodes using counts such as atoms, residues, chains, and structural groups.

Start with the question, not the molecule name

For a first pass, decide what you mean by “large.” A molecule’s atom count, residue count, and chain count describe different things. Atom count can help separate structures by overall size; residue count is useful when you are looking at residue-based structures; and chain count can help distinguish single-chain molecules from multi-chain ones. These are clues for organizing a scene, not proof of a molecule’s identity or function.

Use the mol attribute space for molecule nodes. You can write attributes in their full form or use the short aliases. For example, molecule.numberOfAtoms can be written as mol.nat, and molecule.numberOfResidues as mol.nr.

Make a size-based first pass

If you want to find molecules with more than 100 residues, try mol.nr > 100. To focus on a narrower band, use a range: mol.nr 100:120. The same pattern works for atom counts: mol.nat < 1000 finds molecules below that threshold, while mol.nat 100:200 selects a count range.

These filters can help answer practical questions such as “Which structures in this scene are worth inspecting first?” or “Did I load a compact molecule or a much larger assembly?” Choose thresholds that fit your current dataset; the examples are syntax illustrations, not universal definitions of small or large.

Use chains and segments to add context

When overall size is not enough, check the structure’s organization. For example, mol.nc < 3 matches molecules with fewer than three chains, and mol.nc 2:4 matches molecules with between two and four chains. For segments, use mol.ns > 2 or mol.ns 2:4. Structural-group counts are available too: mol.nsg > 10 matches molecules with more than ten structural groups.

It helps to keep these measures separate. A molecule with many atoms does not necessarily have many chains, and a chain count does not tell you the atom count. Checking more than one attribute can therefore make a search more informative—but interpret each result in the context of how your structures are represented.

Look at composition and charge when size is ambiguous

Inherited structural-group attributes let you filter by elemental counts and charge as well. For instance, mol.nC < 10 checks for fewer than ten carbons, while mol.nO 10:20 specifies an oxygen-count range. Formal charge can be queried with mol.fc > 1; partial charge supports decimal values, such as mol.pc > 1.5. These filters can help distinguish candidates that have similar sizes but different compositions or charge values.

For a repeatable workflow, start with a broad count-based filter, inspect the matching molecules, then refine your search using chains, segments, composition, or charge as needed. The short forms are convenient once you recognize them; the full attribute names can be easier to read while learning. Remember that attributes such as mol.visible and mol.selected are also available when you need to query molecule visibility or selection state.

For the complete attribute list and additional examples, see the SAMSON molecule attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.