Find the segment that doesn’t belong: a practical guide to NSL filters

A molecular structure can contain segments of very different sizes and compositions. When you need to find a long chain, inspect a small component, or check whether a segment has an unexpected elemental makeup, scanning the structure manually can become tedious. SAMSON’s Node Specification Language (NSL) lets you search segments by their properties instead.

This guide focuses on a practical starting point: using segment attributes to find candidates by residue count, structural-group count, atom count, and composition. These searches match segment nodes, using s as the short name for the segment attribute space.

Start with the size of the segment

If you are looking for a long segment, try a residue-count threshold:

s.nr > 100

This matches segments with more than 100 residues. To look within a particular span, use a range:

s.nr 100:120

The full attribute name is segment.numberOfResidues; its short form, s.nr, is easier to type when you are exploring several candidate cutoffs.

Residue count is not the only way to describe size. A segment’s number of structural groups can be queried with s.nsg:

s.nsg > 10

Or use a range, such as s.nsg 10:12. This is useful when structural-group count is the more relevant measure for the question you are asking.

Check atom counts and composition

For a broader size check, use s.nat, the short name for numberOfAtoms. For example, s.nat < 1000 matches segments with fewer than 1,000 atoms, while s.nat 100:200 searches a specified interval.

Segment attributes also include counts for several elements. These are inherited from the structural-group attribute space:

  • s.nC < 10 checks for fewer than 10 carbons.
  • s.nH 10:20 checks for a hydrogen count in the range from 10 to 20.
  • s.nN < 10 checks nitrogen count.
  • s.nO 10:20 checks oxygen count.
  • s.nS < 10 checks sulfur count.

These counts can help you investigate whether a segment’s composition is consistent with what you expect. They do not, by themselves, identify a particular molecule or explain why its composition differs; they are filters for finding segments to inspect.

Use charge attributes as another check

For charge-related searches, NSL provides s.fc for formal charge and s.pc for partial charge. For example, s.fc > 1 searches by formal charge, and s.pc 1.5:2.0 searches by partial charge. The documentation lists formal charge as an integer-valued attribute and partial charge as a float-valued attribute.

A simple way to work through a search

  1. Decide which property best describes what you want to find: residue count, structural-group count, total atoms, elemental counts, or charge.
  2. Start with a broad threshold or range, such as s.nr > 100.
  3. Adjust the number or interval to match the size or composition you want to inspect.
  4. Use the full attribute names if they are easier to remember; the short forms are convenient once you know them.

Remember that these are segment-level searches. Several listed properties are inherited from the more general node or structuralGroup attribute spaces, but they are available here for matching segments. The segment-specific counts include numberOfResidues (s.nr) and numberOfStructuralGroups (s.nsg).

For the complete list of segment attributes and additional examples, see the SAMSON segment attributes reference.

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

Comments are closed.