When a molecular model contains many structures, finding the right backbone group can become a tedious inspection task. You may need to narrow the scene to groups with a particular atom count, a specific elemental composition, or a charge value—then repeat the search after changing your criteria. SAMSON’s Node Specification Language (NSL) offers a more direct approach: query backbone attributes instead of checking each group manually.
Backbone attributes belong to the backbone attribute space. The documentation gives s as its short name and uses bb in its examples. These attributes let you describe useful properties of a backbone node, including atom counts and charge. The key benefit is practical: you can express a selection criterion in a compact, readable form and adjust the value when your question changes.
Start with counts
If the size of a group matters, use numberOfAtoms, abbreviated nat. For example, bb.nat < 1000 describes backbones with fewer than 1,000 atoms, while bb.nat 100:200 specifies a range of atom counts. A range can be a useful first pass when you want to focus on groups of roughly comparable size, rather than manually counting atoms or scanning names.
You can also query counts for individual elements. The short names are nC for carbons, nH for hydrogens, nN for nitrogens, nO for oxygens, and nS for sulfurs. For instance, bb.nO < 10 specifies a criterion based on oxygen count, and bb.nC 10:20 specifies a carbon-count range. The same pattern works for the other listed elements.
For coarse-grained structures, numberOfCoarseGrainedAtoms has the short name ncga. The example bb.ncga 100:200 shows how to express a range for that count. Keeping this attribute distinct from numberOfAtoms makes it easier to state which count you intend to use.
Keep the two kinds of charge separate
The backbone attribute list includes both formalCharge (fc) and partialCharge (pc). They are different attributes, so choose the one that matches the property you want to inspect. The documentation’s examples include bb.fc > 1 and bb.pc > 1.5. Formal charge examples use integers; partial charge examples use floating-point values. For partial charge, a range can be written as bb.pc 1.5:2.0.
Check visibility and selection state
Backbones also inherit node attributes that can help when organizing what is shown or selected. For example, bb.v tests the visible attribute, and not bb.v expresses its negation. The selected attribute can be written as bb.selected or not bb.selected. One small detail worth remembering: although the backbone space has the short name s, selected has no short name in this attribute space. Use its full name to avoid confusing it with the space abbreviation.
A useful workflow is to begin with the attribute that best captures your question—such as atom count, element count, charge, visibility, or selection—and then refine the expression as needed. Short names are convenient for repeated queries; full attribute names can be easier to read when sharing an expression with a colleague. The examples above are individual criteria documented for backbone attributes; consult the NSL reference for the broader language and its syntax.
For the complete list of backbone attributes and examples, see the Backbone attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at samson-connect.net.
