When a molecular model contains many structures, finding the backbone you need by clicking through the scene can be slow and error-prone. You may be looking for a group with a particular atom count, a small number of carbons, a specified charge, or simply a backbone that is currently visible. SAMSON’s Node Specification Language (NSL) lets you express these checks as attribute queries, so you can focus on properties rather than repeatedly inspecting nodes by eye.
This guide focuses on a practical subset of the backbone attribute space: composition, charge, names, and display or selection state. The backbone attribute space uses the prefix bb. The examples below are individual expressions taken from the reference; they show the kind of property each expression tests.
Start with the prefix
Backbone attributes are queried with bb, followed by an attribute name or its short form. For example, bb.nC < 10 uses the short name nC for numberOfCarbons. Remember that these attributes are defined for backbone nodes. If a query does not return what you expect, first check that you are using the correct attribute space and that the node you want to match is a backbone.
Use composition to narrow the search
Atom-count attributes can help distinguish backbones by composition or size. The reference provides counts for total atoms (nat), carbons (nC), hydrogens (nH), nitrogens (nN), oxygens (nO), sulfurs (nS), and coarse-grained atoms (ncga). These attributes accept integer comparisons and ranges.
bb.nat < 1000checks for fewer than 1,000 atoms.bb.nC 10:20checks for a carbon count in the documented 10–20 range.bb.nO < 10checks for fewer than 10 oxygen atoms.bb.ncga 100:200checks a range of coarse-grained atom counts.
These filters are useful when the structure’s composition is more informative than its display name. For example, a count range can help you identify a manageable size class without having to estimate it visually. The documentation also lists bb.nH 10:20, bb.nN 10:20, and bb.nS 10:20 as examples.
Tell charge measures apart
Two charge attributes are available, and they are not interchangeable: formalCharge (short name fc) takes integer values, while partialCharge (short name pc) takes floating-point values. The reference examples are bb.fc > 1 and bb.fc 6:8 for formal charge, and bb.pc > 1.5 and bb.pc 1.5:2.0 for partial charge. Choose the attribute that matches the kind of charge information you intend to inspect; the different value types are a useful reminder to check your query before relying on its results.
Find, or exclude, named backbones
The name attribute accepts strings in quotes. For instance, bb.n "A" and bb.n "L*" are examples from the reference. If you are filtering by name, keep the string in quotation marks. The example containing an asterisk is documented as a valid expression; consult the NSL examples for more detail about expression behavior rather than assuming how a pattern will match.
Check visibility and selection state
Sometimes the problem is not composition but knowing which backbones are currently shown or selected. The visible attribute has short name v, and examples include bb.v and not bb.v. The inherited selected attribute can be checked with bb.selected or not bb.selected. Other useful state attributes include hidden (h), selectionFlag (sf), and visibilityFlag (vf); for example, the reference shows bb.vf false and bb.sf false.
A reliable workflow is to begin with one clear criterion, check that it identifies the expected backbone nodes, and then refine your search using another property. This makes it easier to spot whether a mismatch comes from the chosen attribute, its value type, or the node being queried. For the complete attribute list and additional NSL examples, see the backbone attributes reference and the NSL examples.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
