Find the Backbone Nodes That Matter: A Practical Guide to NSL Filters

When a molecular structure contains many groups, finding the backbone nodes relevant to a particular task can become a small but distracting challenge. You might want to inspect backbones with a certain atom count, identify groups with a particular elemental composition, or focus on a charge range—without confusing those groups with individual atoms.

SAMSON’s Node Specification Language (NSL) provides attributes for describing backbone nodes. The key distinction is that the backbone attribute space matches backbone nodes. Its short name is s, while the examples on the reference page use bb as the prefix. For instance, bb.nC < 10 checks the number of carbons for a backbone node.

Start with the question you need to answer

Rather than scanning a long list of properties, translate your task into a measurable property. If the question is “Is this backbone unusually large?”, start with its atom count. If you are comparing composition, check the element counts. If charge is relevant, decide whether you mean formal charge or partial charge—those are separate attributes, and they use different scales and types of values.

  • Size: bb.nat < 1000 checks for fewer than 1,000 atoms; bb.nat 100:200 expresses an atom-count range.
  • Element counts: bb.nC < 10 checks carbon count, while bb.nO 10:20 expresses an oxygen-count range. Related attributes include bb.nH, bb.nN, and bb.nS.
  • Formal charge: bb.fc > 1 compares an integer formal charge; bb.fc 6:8 gives a range.
  • Partial charge: bb.pc > 1.5 compares a floating-point partial charge; bb.pc 1.5:2.0 gives a range.

These examples are useful because they make the units of thought explicit: atom and element counts are integers, formal charge is an integer, and partial charge is a floating-point value. Keeping formal and partial charge distinct helps prevent a filter from answering a different chemical question than the one you intended.

Use names and display state when composition is not enough

Not every search is chemical. The inherited name attribute accepts strings in quotes, as shown by bb.n "A" and bb.n "L*". The reference also lists node-state attributes for visibility and selection. For example, bb.v and not bb.v test visibility, while bb.selected and not bb.selected test selection state. These can be useful when you are trying to locate a group in a busy scene rather than narrow down its composition.

There is one easy naming detail to watch: the backbone attribute space has the short name s, but the inherited selected attribute has no short name. Use the full example form, bb.selected, rather than assuming every attribute has an abbreviation.

A simple, reliable filtering routine

  1. Confirm that the target you want to describe is a backbone node, not an individual atom.
  2. Choose one property that directly expresses your question: count, element count, charge, name, visibility, or selection.
  3. Use the full attribute name or its documented short name, and check the expected value type before writing a comparison.
  4. Try a focused example first. If the result is not what you expected, check whether you chose the right charge attribute or the right node type.

This one-property-at-a-time approach makes it easier to understand why a result matches. It is also a useful starting point before building more involved NSL expressions using the broader language syntax.

For the complete attribute list and additional examples, see the Backbone attributes reference.

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

Comments are closed.