From a crowded structure to a useful shortlist: filter molecules by size and composition

When a molecular scene contains many molecules, finding the one you need can become a manual inspection task: check the atom count, look for a particular elemental composition, then repeat for every candidate. The molecule attributes in SAMSON’s Node Specification Language (NSL) offer a more systematic starting point. They let you describe molecules by properties such as atom counts, residue counts, chain counts, and charge.

This is especially useful when you need to narrow a structure set before examining candidates more closely. Instead of relying on names alone, you can express a criterion directly—for example, “fewer than 1,000 atoms” or “between 10 and 20 oxygens.”

Start with the scale of the molecule

The numberOfAtoms attribute has the short form mol.nat. To match molecules with fewer than 1,000 atoms, use:

For a range, the reference gives this example:

Atom-count filters can help separate small ligands from larger molecular structures, or identify a manageable subset for a follow-up inspection. The expression states the criterion; it does not by itself explain what a candidate does biologically, so treat it as a way to organize the search rather than a verdict about suitability.

Use elemental counts as a quick composition check

For common elements, molecule attributes include numberOfCarbons (mol.nC), numberOfHydrogens (mol.nH), numberOfNitrogens (mol.nN), numberOfOxygens (mol.nO), and numberOfSulfurs (mol.nS). These counts give you a direct way to screen by a simple composition constraint.

For example, to match molecules with fewer than 10 nitrogen atoms:

To match molecules with 10 to 20 oxygen atoms:

These are useful checks when you already have a rough expectation for a molecule’s composition. They count atoms of the specified element; they do not encode a particular arrangement or connectivity. Two molecules with the same elemental counts may still have different structures.

Screen larger structures by organization

For molecules organized into chains, residues, or segments, the molecule-specific attributes can narrow a search in a different way. Use mol.nc for number of chains, mol.nr for number of residues, and mol.ns for number of segments. For example:

The first expression matches molecules with fewer than three chains; the second matches those with more than 100 residues; and the third matches those with between two and four segments. You can also use mol.nsg to filter by number of structural groups, such as mol.nsg > 10.

Prefer readable criteria, then use short names

NSL provides full attribute names as well as short forms. For instance, molecule.numberOfResidues > 100 and mol.nr > 100 express the same documented criterion. Full names can make a query easier to understand when you return to it later; short names are convenient when writing compact expressions. A practical habit is to draft a filter with the names that are clearest to you, then switch to short forms if you prefer them.

One important detail: the molecule attribute space matches molecule nodes. Many attributes listed for molecules are inherited from the general node or structural-group spaces, while chain, residue, segment, and structural-group counts are molecule-specific. Keeping that distinction in mind helps you choose an attribute that describes the object you intend to match.

Use these filters to build a shortlist, then inspect the resulting structures in the context of your scientific question. For more attributes, examples, and details about the available syntax, see the SAMSON molecule attributes reference.

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

Comments are closed.