A cleaner way to find the backbone you actually need

A molecular structure can contain many kinds of nodes, and a broad search can return more than you intended. When your task is to inspect or select backbone nodes, the useful first step is to keep the search focused on the backbone attribute space. In SAMSON’s Node Specification Language (NSL), this space matches backbone nodes and provides filters for their names, composition, charge, visibility, and selection state.

The examples below use the bb prefix shown in the backbone reference. That gives your query a clear scope: you are asking about backbone attributes rather than relying on a general search across different node types. The backbone space also has the short name s; note that selected itself has no short name in this space.

Start with the problem you want to solve

Before writing a query, decide what you need to narrow down. Are you looking for a backbone with a particular name? A small number of atoms? A particular elemental composition? Or nodes that are currently hidden? Turning that question into one attribute at a time makes it easier to check what the expression means and adjust it when the result is not what you expected.

For example, numeric attributes support comparisons and ranges. To look for backbones with fewer than 1,000 atoms, use bb.nat < 1000. To inspect backbones with 100 to 200 atoms, use bb.nat 100:200. These two forms answer slightly different questions: one sets an upper bound, while the other specifies an interval.

Use composition counts to narrow candidates

Backbone attributes include counts for carbon, hydrogen, nitrogen, oxygen, sulfur, and coarse-grained atoms. This is useful when size alone does not distinguish the structures you are reviewing. For instance, bb.nC < 10 filters by carbon count, while bb.nO 10:20 describes an oxygen-count interval. The corresponding short names are nC, nH, nN, nO, and nS; total atom count uses nat, and coarse-grained atom count uses ncga.

These are counts, not names or atom-selection expressions. Keeping that distinction in mind helps avoid a common source of confusion: a filter such as bb.nC < 10 refers to a backbone’s carbon count, whereas a query in another attribute space may describe individual atoms or other node types.

Check charge without guessing

Charge filters can help focus a review on backbones with particular charge values. Formal charge is an integer attribute, so examples include bb.fc > 1 and bb.fc 6:8. Partial charge is a floating-point attribute, with examples such as bb.pc > 1.5 and bb.pc 1.5:2.0. The type of value matters: use an integer-style filter for formalCharge and decimal values for partialCharge.

Make visibility and selection checks explicit

Backbones inherit node attributes for visibility and selection. For quick checks, the reference shows expressions such as bb.v and not bb.v for visible state, and bb.h and not bb.h for hidden state. Selection can be queried with bb.selected or not bb.selected. If you need the related flags, bb.vf and bb.sf are the short names for visibilityFlag and selectionFlag; the examples include bb.vf false and bb.sf false.

Those names are similar, but the documentation lists them as separate attributes. When you are troubleshooting a result, check whether you meant the state itself—such as visible or selected—or the corresponding flag attribute. This small check can save time when a query appears to behave differently from your intention.

A practical query-building habit

Build a filter in stages: begin with the backbone scope, add one measurable constraint, and then refine based on what you need to inspect. For example, start with an atom-count interval such as bb.nat 100:200, then decide whether a composition count or charge condition is relevant. The reference lists each attribute and its supported value type, so it is a good place to verify syntax before adding more conditions.

For quoted names, the examples include bb.n "A" and bb.n "L*". Use quotes around the name value, and consult the NSL reference if you need to confirm how a particular name expression is interpreted.

For the complete attribute list and inheritance details, see the SAMSON backbone attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.