From Molecular Haystack to Useful Backbones: A Practical NSL Checklist

When a molecular scene contains many structural groups, finding the backbone you need can become a surprisingly fiddly task. A name alone may not be enough: you might also need to distinguish groups by atom count, elemental composition, charge, or visibility. SAMSON’s Node Specification Language (NSL) lets you express these checks as compact queries against backbone nodes.

This guide focuses on a practical subset of the backbone attribute space: the inherited structural-group attributes for composition and charge, plus a few node attributes that help identify or inspect candidates. The examples use the bb prefix shown in the reference page. Backbone attributes also have the short name s.

Start with the size of the group

If you are trying to narrow down candidates before inspecting them, atom counts are a useful first filter. The numberOfAtoms attribute has the short name nat. For example, bb.nat < 1000 selects backbones with fewer than 1,000 atoms, while bb.nat 100:200 specifies a range.

Element-specific counts can make the next step more informative. Use nC, nH, nN, nO, and nS for the numbers of carbon, hydrogen, nitrogen, oxygen, and sulfur atoms, respectively. For example, bb.nC < 10 checks for fewer than 10 carbons, and bb.nO 10:20 specifies an oxygen-count range.

There is also ncga, the short name for numberOfCoarseGrainedAtoms. This can be useful when you need to inspect coarse-grained atom counts separately from the overall atom count; for instance, bb.ncga < 1000.

Keep the two kinds of charge separate

Charge-based searches can be confusing if formal and partial charge are treated as interchangeable. NSL exposes both on backbones. formalCharge (fc) uses integer values: examples include bb.fc > 1 and bb.fc 6:8. partialCharge (pc) uses floating-point values, such as bb.pc > 1.5 or bb.pc 1.5:2.0.

Choose the attribute that matches the question you are asking, and preserve the distinction when recording a search. A formal-charge query is not a substitute for a partial-charge query.

Use names and display state as extra clues

When a group has a meaningful label, the inherited name attribute (n) can help you locate it. The documented examples include bb.n "A" and bb.n "L*". The name value is written in quotes.

To check display or selection state, use the boolean attributes. visible has the short name v, so bb.v and not bb.v express visible and not-visible checks. Similarly, hidden can be checked with bb.h or not bb.h. The page also lists selected (without a short name), selectionFlag (sf), and visibilityFlag (vf). For example, bb.selected checks selection state, while bb.vf false checks the visibility flag.

A simple way to build a search

Begin with the question that matters most: is the candidate too large, does it have a particular elemental count, or are you checking charge? Pick the corresponding attribute and use a comparison or range in the documented form. Then use a name or display-state query when those details help distinguish candidates. Keeping each check readable makes it easier to revisit a search and understand why it was made.

These attributes are inherited from the node and structuralGroup attribute spaces, and the backbone attribute space matches backbone nodes. The reference page lists the available names, abbreviations, value types, and examples. Learn more in the SAMSON backbone attributes documentation.

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

Comments are closed.