Find the backbone you need by charge, composition, and size

When a molecular structure contains many components, it can be tedious to locate the backbone groups that matter for a particular analysis. A useful starting point is to narrow the search by properties you can state explicitly: formal charge, atom counts, partial charge, or even whether a node is visible or selected. SAMSON’s Node Specification Language (NSL) provides these attributes in the backbone attribute space.

This is especially helpful when your question is not “Which group is this by name?” but “Which backbone groups have this kind of composition or charge?” Instead of scanning groups one by one, you can express a condition and use it to find matching backbone nodes. The examples below use the bb prefix shown on the reference page.

Start with chemistry and size

Backbone inherits several numeric attributes from the structuralGroup attribute space. These include total atom count (nat), counts of carbon, hydrogen, nitrogen, oxygen, and sulfur atoms (nC, nH, nN, nO, nS), and coarse-grained atom count (ncga). These let you describe a group by its size or elemental makeup.

  • bb.nat < 1000 — a documented example for finding groups with fewer than 1,000 atoms.
  • bb.nC 10:20 — a documented range expression for the number of carbons.
  • bb.nO < 10 — a documented example using oxygen count.
  • bb.ncga 100:200 — a documented range expression for coarse-grained atom count.

These criteria are useful for turning a vague inspection task into a reproducible query. For example, if you want to focus on groups with a particular carbon-count range, record that condition rather than relying on visual appearance alone. You can also combine the idea of composition and scale when deciding which groups to examine; the examples here illustrate individual attribute tests, so check the NSL examples page for expression-combination syntax.

Use charge to narrow the search

Two charge attributes are available. formalCharge has the short name fc and accepts integers; partialCharge has the short name pc and accepts floating-point values. The reference page gives examples such as bb.fc > 1, bb.fc 6:8, bb.pc > 1.5, and bb.pc 1.5:2.0.

Keeping these attributes distinct matters: formal charge is documented as an integer, while partial charge is documented as a float. If your filtering question concerns a computed or fractional charge value, use the partial-charge attribute rather than assuming the formal-charge field represents the same thing.

Separate structure properties from display state

Backbone also inherits node attributes for name, visibility, and selection. For example, bb.n "A" and bb.n "L*" show name-based expressions, while bb.v and not bb.v test visibility. Selection can be tested with bb.selected or not bb.selected. These are different kinds of questions from atom counts and charge: they describe node identity or state, not chemical composition.

The page also lists selectionFlag (sf) and visibilityFlag (vf), with examples including bb.sf false and bb.vf false. Use the attribute that matches the condition you intend to test; the reference documents both flags as well as the simpler selected and visible attributes.

A practical way to build a query

  1. Decide what makes a group relevant: name, elemental count, total size, charge, or display state.
  2. Choose the corresponding attribute and its documented short name, if you prefer a compact expression.
  3. Begin with one condition, check the matching nodes, and refine the expression as needed.
  4. Keep useful expressions with your analysis so the same criterion can be applied consistently later.

This approach helps prevent a common source of wasted time: repeatedly inspecting groups that do not meet basic criteria. It also makes the basis for a selection clearer to collaborators. To review the complete attribute list and its examples, see the Backbone attributes reference.

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

Comments are closed.