When a molecular structure contains many backbone groups, finding the ones relevant to a question can take longer than expected. You may be looking for groups with a particular elemental composition, a certain number of atoms, or a specific charge. In SAMSON, the backbone attribute space in Node Specification Language (NSL) provides a way to express these criteria directly—without relying only on names or visual inspection.
The key detail is scope: backbone attributes match backbone nodes. In the examples below, bb is the prefix used for that attribute space. These expressions are therefore for querying backbone nodes, not a general instruction to select individual atoms that meet a criterion.
Start with a broad composition check
For a quick first pass, use the inherited atom-count attributes. For example:
bb.nat < 1000checks for a number of atoms below 1,000.bb.nC 10:20specifies a range of 10 to 20 carbons.bb.nH < 10specifies fewer than 10 hydrogens.bb.nN 10:20specifies a range of 10 to 20 nitrogens.bb.nO < 10specifies fewer than 10 oxygens.
The short names make repeated queries compact: nat means numberOfAtoms, while nC, nH, nN, and nO refer to counts of carbon, hydrogen, nitrogen, and oxygen. The same attribute family includes nS for sulfur and ncga for coarse-grained atoms.
Choose the charge attribute that fits the question
Formal charge and partial charge are separate attributes, so it helps to choose deliberately. formalCharge (short name fc) takes integer values; an example query is bb.fc > 1. partialCharge (short name pc) takes floating-point values; examples include bb.pc > 1.5 and bb.pc 1.5:2.0.
In other words, if your criterion concerns an integer formal charge, use fc; if it concerns a decimal partial charge, use pc. Keeping those concepts distinct can prevent an otherwise reasonable-looking query from answering the wrong question.
Use names and state when composition is not enough
Composition may narrow the search, but names and node state can also be useful. The inherited name attribute accepts strings in quotes; the reference gives bb.n "A" and bb.n "L*" as examples. Backbone nodes also expose boolean attributes for visibility and selection, including bb.visible, not bb.visible, bb.selected, and not bb.selected. The documentation notes that selected does not have a short name in this attribute space, so use its full form rather than assuming one.
A simple query-planning habit
Before writing a query, translate the scientific question into the attribute type it needs: an element count, an integer formal charge, a floating-point partial charge, a name, or a visibility/selection state. Then use the corresponding short name and an example expression as a starting point. For instance, a search involving carbon counts belongs to nC, while a partial-charge threshold belongs to pc. This small check helps keep the query aligned with the property you actually mean to inspect.
The backbone page lists the available attributes and their value types, including inherited properties from the node and structuralGroup spaces. For the full reference and additional context, see the SAMSON backbone attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
