Find the Backbone You Need: Practical NSL Filters for Molecular Models

When a molecular model contains many structural groups, finding the backbone nodes relevant to a task can be tedious. Names alone may not be enough: sometimes you need to narrow things down by atom count, elemental composition, or charge. SAMSON’s Node Specification Language (NSL) provides backbone attributes for describing those properties in queries.

This guide focuses on a practical subset of the backbone attribute space: filtering by composition and charge, then using names and visibility-related properties to refine what you inspect. The examples below use the bb prefix shown in the reference page.

Start with the question you are trying to answer

A useful filter starts with a concrete question. For example: “Which backbone groups have fewer than 1,000 atoms?” The numberOfAtoms attribute has the short name nat, accepts integer values, and can be used with a comparison:

If you are looking for groups within a size interval, the reference gives this range-style example:

These expressions make the criterion explicit and easier to revisit than manually scanning a crowded model. The same pattern applies to elemental counts: nC for carbons, nH for hydrogens, nN for nitrogens, nO for oxygens, and nS for sulfurs. For instance, you could inspect the documented examples for a carbon-count threshold or interval:

These attributes are especially handy when “small” or “rich in a particular element” needs to become a repeatable, numeric criterion. The documentation lists the count attributes as integers, so comparisons and ranges are expressed using whole-number values.

Use charge attributes when composition is not enough

Two charge measures are available in the backbone attribute space through inherited structural-group attributes. formalCharge (short name fc) uses integers; partialCharge (short name pc) uses floating-point values. The page provides these examples:

Keeping the distinction in mind helps avoid treating the two attributes as interchangeable: their documented value types differ. If a query is not returning what you expect, first check that you selected the intended charge attribute and used a value in the appropriate format.

Refine by name or display state

Backbone nodes also inherit general node attributes. The name attribute accepts strings in quotes, as shown in the reference:

The page provides these as name-expression examples; it does not define the matching behavior of the asterisk, so consult the NSL guidance before relying on it as a particular kind of pattern.

For display and selection state, the examples include bb.v and not bb.v for visibility, and bb.selected and not bb.selected for selection. These are useful when you want to distinguish visible from non-visible nodes, or selected from unselected ones. The short name for selected is intentionally not listed on this page, so use the full form shown in the example.

A simple way to work through a difficult model

  1. Choose one measurable property. Start with atom count, an element count, or a charge value.
  2. Use the documented shorthand if it is convenient. For example, nat means numberOfAtoms, while nO means numberOfOxygens.
  3. Check the value type. Counts and formal charge are integers; partial charge is a float; names are quoted strings; visibility and selection are Boolean.
  4. Refine the search as needed. Name and display-state attributes offer additional ways to describe the backbone nodes you want to inspect.

Backbone attributes are part of a broader NSL system, and many of the properties described here are inherited from the node and structuralGroup attribute spaces. For the complete attribute list and additional details, see the backbone attributes reference.

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

Comments are closed.