Finding the right atoms in a molecular scene can be tedious. A modeler may need just one chain, a residue range, aromatic atoms, or potential hydrogen-bond partners—and selecting each one by hand is easy to get wrong. SAMSON’s Node Specification Language (NSL) lets you describe these targets as compact, reusable expressions.
The key idea is to combine atom attributes. An attribute narrows the selection by a property such as element, chain, residue number, or bonding behavior. The atom attribute space can be written in full as atom, or with the short prefix a. For example, atom.symbol O and a.s O both match oxygen atoms.
Start with where the atoms are
Protein structures often contain many chains and residues. To focus on residues 40 through 50 in chain A, combine the chain and residue attributes:
|
1 |
a.c A and a.resi 40:50 |
This is more precise than selecting a broad region visually, and the expression makes the selection criteria explicit. You can also use a list of residue numbers, such as a.resi 40:50,100, to include a range and a separate residue. For a structure with alternate atom locations, a.alt A can target atoms assigned to alternate location A.
Separate chemical identity from structural role
Element and symbol queries are useful for basic filtering: a.e Oxygen, Nitrogen selects oxygen and nitrogen by element name, while a.s O, N uses their symbols. But an element alone does not tell you what an atom is doing in the structure. NSL also provides attributes for roles such as backbone membership and hydrogen bonding.
For example, a.aabb matches heavy atoms belonging to an amino-acid backbone. To narrow that to atoms named CA, combine the documented atom-name expression with the backbone attribute: "CA" and a.aabb. The a.hba and a.hbd attributes match hydrogen-bond acceptors and donors, respectively. These let you describe a chemical feature directly instead of relying on element identity as a proxy.
Find ring and aromatic features
When examining a ligand or other small molecule, aromaticity and ring membership can be more relevant than the atom’s position in a protein. Use a.ar to match aromatic atoms, or combine it with the carbon symbol to focus on aromatic carbons:
|
1 |
a.s C and a.ar |
To look for atoms in five- or six-membered rings, use a.ringSize 5,6. One detail matters when interpreting this attribute: if an atom belongs to rings of different sizes, NSL reports the smallest ring size. So this query is a useful way to identify atoms associated with those ring sizes, but it does not enumerate every ring an atom participates in.
Use coordinates when the region matters
Sometimes the target is not defined by chemistry or residue identity, but by location. Coordinate attributes support length units, so a range can be specified in angstroms or nanometers. For instance, a.x 1nm:10nm matches atoms whose x-coordinate falls in that interval. You can combine coordinate conditions—for example, a.x > 10 A and a.y > 10 A—to define a region using more than one axis.
Check what a query actually means
Some attributes depend on information that may need to be assigned or computed first. Geometry queries such as a.g tetrahedral require geometry to be computed; hybridization queries such as a.hy sp2 require hybridization to be assigned, and that information may not exist by default. If a query returns fewer matches than expected, check whether the relevant property is available before changing the expression.
It is also useful to distinguish similar-looking concepts. a.het tests whether an atom has a HETATM record in a PDB structure; it is not simply a test for “not carbon or hydrogen.” Meanwhile, a.heavy means a non-hydrogen atom. Choosing the attribute that matches your actual question helps prevent a selection that looks plausible but represents something different.
These examples can serve as starting points: select by structure, add a chemical criterion, then check any prerequisites for computed attributes. For the complete 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.
