From a crowded structure to the atoms you actually need

Finding the right atoms in a molecular model can be more tedious than the analysis that follows. A selection that is too broad brings in hydrogens, waters, or neighboring chains; one that is too narrow can quietly leave out atoms you meant to include. SAMSON’s Node Specification Language (NSL) lets you describe an atom subset using properties such as element, residue number, chain, backbone membership, and position.

The useful shift is to treat selection as a series of small, checkable filters. Each condition answers one question about an atom. Combine conditions with and when all must be true, and use commas to list alternatives for a single attribute. This makes a query easier to read—and easier to troubleshoot—than trying to identify atoms one by one.

Start with the structural context

For example, to match backbone atoms from chain A, use:

a.aabb and a.c A

a.aabb matches heavy atoms belonging to an amino-acid backbone, while a.c A restricts the match to chain A. Since the backbone attribute already specifies heavy atoms, adding a separate heavy-atom condition is unnecessary here. If you instead want to express a heavy-atom filter on its own, use a.heavy.

You can narrow the selection further by residue sequence number. To focus on residues 40 through 50 in that chain, combine the conditions:

a.aabb and a.c A and a.resi 40:50

The range notation is handy when you know the region of interest but do not want to list each residue separately. A comma-separated list can specify alternatives; for example, a.c B, C matches atoms from chain B or chain C.

Use chemistry to refine a match

Structural labels are only part of the story. Element and atom-level properties can help isolate chemically meaningful groups. To match oxygen atoms, use a.s O; for oxygen or nitrogen atoms, use a.s O, N. The longer equivalent for carbon is a.e Carbon, while a.s C uses the element symbol.

For example, the documented expression a.s O and a.w matches oxygen atoms carrying the water flag. That distinction matters: an oxygen atom is not automatically a water oxygen. The water attribute describes the atom’s water flag, so combining it with element identity makes the intent clearer.

Likewise, a.het matches atoms whose record type is HETATM in a PDB structure. It is not simply a synonym for “anything that is not carbon or hydrogen.” The documentation shows the latter as a separate elemental test: n.t a and not (a.s H, C). Keep these meanings distinct when building selections, especially in structures with ligands, ions, or waters.

Let ranges do the repetitive work

NSL also supports numeric comparisons and ranges for many attributes. To select atoms by coordinate, for example, use a.x 1nm:10nm for atoms whose x coordinate falls between 1 and 10 nanometers. The units are explicit, which helps avoid mixing up angstroms and nanometers. You can combine coordinate filters, as in a.x > 10 A and a.y > 10 A, to describe a region using more than one axis.

The same general approach applies to other numeric properties: a.oc < 0.3 filters by occupancy, and a.nba > 2 filters by the number of bonded atoms. Choose a property that corresponds to the question you are asking, rather than relying on an atom’s name alone.

A quick check before relying on a query

  • Is the attribute available for these atoms? Coarse-grained mass, radius, and type apply to coarse-grained atoms; some type or geometry attributes may need to be assigned or computed first.
  • Does the field mean what you think it means? HETATM is a record-type flag, while element identifies chemical identity.
  • Are the units clear? Coordinate and radius filters use length units; mass filters use mass units.
  • Can you test the query in stages? Start with one condition, then add chain, residue, or chemistry filters. If the result changes unexpectedly, the last added condition is the first place to inspect.

These patterns turn atom selection from a long manual search into a readable description of the atoms you want. For the complete list of atom attributes, aliases, values, and examples, see the SAMSON atom attributes reference.

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

Comments are closed.