Find the side chains that matter: a practical guide to NSL filters

When a molecular structure contains many residues, locating a particular kind of side chain by eye can be slow—and easy to get wrong. A more systematic approach is to filter side-chain nodes by properties such as atom counts, charge, name, or visibility. In SAMSON, the Node Specification Language (NSL) provides a set of attributes for expressing those filters.

Start with the side-chain namespace

The side-chain attribute space is called sideChain, and its short name is s. In the examples below, sc is the prefix used for side-chain attributes. A side-chain expression matches side-chain nodes, which helps keep a search focused on the structural groups you intend to inspect.

Filter by composition

Atom-count attributes are useful when you want to narrow a structure by chemical composition. The documentation gives examples such as:

  • sc.nC < 10 to test for side chains with fewer than 10 carbons.
  • sc.nO 10:20 to specify a range of oxygen counts.
  • sc.nat 100:200 to specify a range for the total number of atoms.
  • sc.nN < 10 to test nitrogen counts.

The short names make these expressions compact: nC means numberOfCarbons, nO means numberOfOxygens, and nat means numberOfAtoms. Other available counts include hydrogens (nH), sulfurs (nS), and coarse-grained atoms (ncga).

Counts are a way to narrow a search, not a complete description of chemical behavior. Treat a matching result as a useful shortlist, then consider the molecular context and the question you are investigating.

Use charge attributes with care

For charge-based searches, side chains inherit formalCharge and partialCharge. The documentation shows integer comparisons and ranges for formal charge, for example sc.fc > 1 and sc.fc 6:8, and floating-point comparisons and ranges for partial charge, such as sc.pc > 1.5 and sc.pc 1.5:2.0.

These attributes let you express different kinds of criteria: formal charge is represented with integer values, while partial charge accepts floats. Keep that distinction in mind when choosing an attribute and writing a query.

Check names and display state

Side chains also inherit node attributes. For example, sc.n "A" searches by a quoted name, while sc.n "L*" demonstrates a name pattern. Visibility and selection can be checked with expressions such as sc.v, not sc.v, sc.selected, or not sc.selected.

One detail worth remembering: selected does not have a short name in this attribute space. Although the side-chain namespace itself has the short name s, use the full attribute name in sc.selected.

A small, reliable filtering routine

  1. Begin with the property that best describes your question: a count, charge, name, or display state.
  2. Try the corresponding side-chain expression on its own and check whether the results make sense for the structure.
  3. Adjust the comparison or range to make the shortlist more or less restrictive.
  4. Use the matching side chains as a starting point for inspection rather than assuming one attribute alone establishes their biological role.

This attribute-based approach turns a vague task—“find the side chains with this kind of composition”—into a clear, inspectable query. For the complete attribute reference and additional examples, see the SAMSON side-chain NSL documentation.

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

Comments are closed.