From a crowded structure to the atoms you actually need

A molecular structure can contain thousands of atoms, and the hard part is often not seeing them—it’s selecting the right ones without accidentally including the wrong ones. A broad selection may mix hydrogens with heavy atoms, include several chains, or pick up water and other records alongside the atoms you meant to study. SAMSON’s Node Specification Language (NSL) lets you describe a selection by combining atom properties, so you can make the criteria explicit and reuse them.

Start with the question, not the expression

Before writing a query, decide what makes an atom relevant. Is it part of a particular chain or residue range? Does it need to be a heavy atom, a backbone atom, an aromatic atom, or a hydrogen-bond acceptor? Turning that scientific question into separate conditions makes a selection easier to check and adjust.

In NSL, atom attributes belong to the atom attribute space. You can write the full form, such as atom.symbol, or use its short form, a.s. Both express the same attribute. For example, this selects carbon atoms:

a.s C

To select oxygen or nitrogen atoms instead, use a comma-separated list:

a.s O, N

Build a selection in layers

A useful way to avoid an overly broad result is to add constraints one at a time. Suppose you want heavy atoms in residues 40 through 50 of chain A. The expression combines the chain, residue sequence number, and heavy-atom attributes:

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

Here, a.c identifies the chain, a.resi accepts a residue-number range, and a.heavy excludes hydrogen atoms. If the result is not what you expect, each condition can be inspected or removed independently. That makes troubleshooting more straightforward than relying on a single vague criterion.

For amino-acid backbone atoms, use a.aabb. This attribute matches heavy atoms that belong to an amino-acid backbone, so it can be combined with chain or residue conditions:

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

This is more specific than selecting atoms just because their names look familiar. For example, an atom-name filter such as "CA" can be useful, but combining it with the backbone attribute expresses the structural intent too: "CA" and a.aabb.

Don’t confuse record type with chemistry

One common source of confusion is treating “heteroatom” as if it simply meant an atom that is not carbon or hydrogen. NSL’s a.het attribute refers to atoms whose record type is HETATM in the PDB file format. That is a record-based distinction, not a general chemical test. The documentation also gives not (a.s H, C) as a way to select atoms that are not hydrogen or carbon. These two filters answer different questions, so choose the one that matches your task.

Similarly, use a.w when you want atoms flagged as water. To narrow that to water oxygen atoms, combine the attributes:

a.s O and a.w

Thinking carefully about what each attribute means helps prevent a selection that looks plausible but includes the wrong class of atoms.

Use interaction properties when chemistry matters

If you are examining potential hydrogen-bond interactions, select atoms by their assigned interaction role rather than by element alone. For example, a.hba matches hydrogen-bond acceptors, while a.hbd matches hydrogen-bond donors. These properties can be combined with structural filters, such as a chain or residue range, to focus the selection. A hydrogen attached to a donor can be identified with a.dbh.

Some attributes depend on information being available or computed first. Geometry queries such as a.g tet require atom geometry to have been computed, and hybridization queries such as a.hy sp2 require hybridization to be assigned. If a query returns fewer atoms than expected, check whether the relevant property is present before assuming the selection syntax is at fault.

Add spatial limits when location matters

NSL can also filter atoms by coordinates. For instance, a.x 1nm:10nm selects atoms whose x coordinate lies in that range, while a.x > 10A and a.y > 10A applies conditions to two axes. Coordinate values support length units, so keep units explicit when comparing distances or positions.

The practical habit is simple: write the smallest clear set of conditions that captures the modeling question, then add filters only when they make the result more precise. For the full attribute reference and additional examples, see the SAMSON atom attributes documentation.

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

Comments are closed.