From a crowded structure to a useful atom selection

Large molecular structures can make a simple task surprisingly fiddly: finding just the atoms you need without accidentally including nearby atoms from another chain, residue, or chemical group. In SAMSON, the Node Specification Language (NSL) lets you build atom selections by combining attributes such as chain, residue number, element, hydrogen-bond role, and position.

A reliable approach is to narrow the selection in stages. Start with the structural region, then add the chemical property that matters. This makes each part of the expression easier to check and adjust.

1. Restrict the structure first

For example, to select heavy atoms from residues 42 through 60 in chain A, use:

Here, a.c is the chain attribute, a.resi is the residue sequence number, and a.heavy excludes hydrogen atoms. The range 42:60 selects residue numbers in that interval. Starting with this structural filter can make the next step—asking for particular chemistry—much easier to reason about.

Chain and residue filters answer different questions. A residue number may occur in more than one chain, so including the chain can help make the selection specific. If you want atoms from multiple chains, the chain attribute can accept a list, such as a.c B, C.

2. Add the chemical feature you care about

To narrow the same region to atoms marked as hydrogen-bond donors or acceptors, add those attributes:

a.hbd matches hydrogen-bond donors, while a.hba matches hydrogen-bond acceptors. The result is a selection based on both location in the structure and the assigned hydrogen-bond role. Donor and acceptor attributes are useful filters, but they do not by themselves describe a particular interaction between two atoms.

If you are investigating one role at a time, keep the query simpler: use a.hbd for donors or a.hba for acceptors. Separating the searches can help when you want to inspect each group independently.

3. Use element and position filters when needed

Element symbols are another useful way to refine a search. For example, a.s O, N selects oxygen and nitrogen atoms. You can combine this with chain and residue constraints:

Coordinate attributes can restrict a selection to a spatial range. For instance, a.x 0A:10A selects atoms whose x coordinate falls between 0 and 10 angstroms. Add y and z ranges to define a rectangular region:

Coordinate filters describe position along individual axes; they are not a distance-from-a-point expression. Keep the units explicit when working with spatial ranges, especially if switching between angstroms and nanometers.

Check what an attribute means

A few distinctions can prevent misleading selections. a.het refers specifically to atoms whose record type is HETATM in a PDB file; it is not simply a synonym for “not part of a protein.” Likewise, a.heavy means non-hydrogen atoms. For computed properties such as geometry and hybridization, the documentation notes that the relevant property must first be computed or assigned. If a selection is unexpectedly empty, check that the attribute is available for the atoms in your structure and that its required preparation has been performed.

When a query returns more atoms than expected, test it piece by piece: first chain and residue, then element, then the chemical property. This simple debugging habit makes it easier to spot whether the issue is a range, an attribute, or an assumption about the input structure.

For the complete list of atom attributes, short names, possible 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.