A molecular model can contain many structural groups, and manually inspecting each one to find a backbone with a particular size or composition is tedious. SAMSON’s Node Specification Language (NSL) lets you filter backbone nodes using attributes such as atom counts, element counts, charge, name, and visibility. The practical benefit is simple: turn a question about your model into a precise expression, then use the result to focus your inspection.
Start with the backbone selector
Backbone attributes belong to the backbone attribute space. In the examples on this page, the prefix bb identifies the backbone nodes being tested. For instance, bb.nC < 10 describes backbones with fewer than 10 carbon atoms, while bb.nat 100:200 describes those with between 100 and 200 atoms.
The documentation also identifies s as the short name for the backbone attribute space. One detail worth remembering: the examples use bb as their prefix, and selected specifically has no short name in this space. Use bb.selected rather than assuming that s is a shortcut for this attribute.
Use composition to narrow a large model
If you are looking for groups with a particular elemental makeup, the count attributes offer a direct way to express the constraint. Examples include bb.nC < 10 for carbon count, bb.nH 10:20 for hydrogen count, and bb.nO 10:20 for oxygen count. Related attributes are available for nitrogen and sulfur, as well as total atom count through bb.nat.
Think of these expressions as ways to make a broad inspection more manageable. Rather than scanning every backbone, you can start with one measurable property—for example, atom count—and then explore another property in a separate query. The available reference lists each attribute’s accepted values and examples, so you can check the syntax before building a more specific filter.
Check charge and size
Backbone nodes inherit structural-group attributes, including formal and partial charge. To look for a formal charge greater than 1, the documented expression is bb.fc > 1. To specify a range, use an expression such as bb.fc 6:8. Partial charge is represented by bb.pc; the page gives bb.pc > 1.5 and bb.pc 1.5:2.0 as examples.
These distinctions can prevent a common source of confusion: formal charge uses integer values, whereas partial charge uses floating-point values. Choose the attribute that corresponds to the question you are asking, and use the appropriate kind of value.
Include names and display state
Not every useful filter is chemical. The inherited name attribute accepts strings in quotes; the reference shows examples such as bb.n "A" and bb.n "L*". Backbone nodes also inherit boolean attributes for visibility and selection. For example, bb.v tests visibility, while not bb.v tests the opposite; bb.selected and not bb.selected provide the corresponding selection checks.
When a result looks unexpected, check which attribute you used and whether it is inherited from node or structuralGroup. The backbone reference groups these inherited attributes and shows their short names, possible values, and example expressions. That makes it useful both for writing a first filter and for diagnosing a query that does not match what you intended.
For the complete attribute list and syntax examples, see the Backbone attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
