A molecular structure can contain thousands of atoms, and the ones relevant to a question are rarely grouped into a neat, ready-made selection. You may want to inspect possible hydrogen-bond partners near a ligand, focus on one residue range, or separate water oxygens from the rest of a structure. Selecting by visual inspection alone can be slow—and easy to get wrong.
SAMSON’s Node Specification Language (NSL) lets you describe the atoms you want by combining their attributes. The key idea is to build a query in stages: start with a chemical role, then narrow by location or structural identifiers. The examples below use the atom attribute space, whose short prefix is a.
Start with chemical role
For an initial list of atoms classified as hydrogen-bond acceptors, try:
a.heavy and a.hba
a.heavy restricts the result to non-hydrogen atoms, while a.hba selects atoms marked as hydrogen-bond acceptors. To inspect donor atoms separately, use a.heavy and a.hbd. Comparing these two sets can help organize a search for plausible interaction partners without having to inspect every atom in the model.
There is an important distinction: these attributes identify atoms by their assigned properties; by themselves, they do not establish that a hydrogen bond is actually present. Treat the results as candidates to examine, not as a geometric interaction analysis.
Narrow the search to a region
If the structure is large, combine the chemical filter with coordinate limits. For example, the following query selects heavy acceptor atoms whose x, y, and z coordinates all fall between −5 and 5 angstroms:
a.heavy and a.hba and a.x -5A:5A and a.y -5A:5A and a.z -5A:5A
The numbers here are only an example box. Replace them with limits that describe the region you want to inspect. NSL coordinate attributes accept length units, so ranges can also be written in nanometers—for instance, a.y -1nm:0nm. Using explicit units makes the intended scale easier to read and helps prevent mistakes when working with structures described at different coordinate scales.
Use residue numbers to focus on a local neighborhood
When you already know the residue sequence numbers of interest, use a.resi. For example:
a.heavy and a.resi 40:50
This combines a heavy-atom filter with residues numbered from 40 through 50. To inspect only selected residue numbers, a comma-separated list is available, as in a.resi 42,45,50. Residue sequence number is a useful structural identifier, but it is not the same thing as an atom’s serial number: a.sn refers to the atom serial number.
Keep water and HETATM terminology straight
Water can be isolated with its flag. To select oxygen atoms carrying the water flag, use a.s O and a.w. The a.s attribute matches element symbols, and a.w matches atoms with the water flag.
Do not assume that a.het simply means “any atom that is not carbon or hydrogen.” In this reference, a.het specifically tests whether an atom has a HETATM record in the PDB format. That is different from a chemical-element filter such as not (a.s H, C). Choosing the right meaning matters when comparing imported structures or filtering nonstandard components.
Build queries you can understand later
Short names make repeated searches compact, but readability matters when a query has several conditions. You can use full attribute names—such as atom.hydrogenBondAcceptor—or short names such as a.hba. Start with a simple condition, check that it expresses the intended chemical or structural property, and then add one constraint at a time. This makes it easier to spot an overly broad or overly restrictive filter.
For the complete atom-attribute reference, including geometry, hybridization, charges, ring membership, and element-based properties, see the SAMSON NSL atom attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
