Stop scanning the structure: find segments by size and composition

When a molecular model contains many segments, locating the one you need by eye can become tedious. A segment may be interesting because it contains a certain number of residues, has a particular elemental composition, or falls within a charge range. SAMSON’s Node Specification Language (NSL) lets you describe those criteria as expressions, so you can narrow the search without relying on names alone.

Start with the segment prefix

In NSL, the segment attribute space is written s. It matches segment nodes, and its attributes let you describe properties such as residue count and atom count. For example, s.nr > 100 matches segments with more than 100 residues. The longer equivalent is segment.numberOfResidues > 100.

If you have a target size range in mind, use range notation: s.nr 100:120 matches segments with between 100 and 120 residues. This can be a more practical first pass than choosing a single cutoff: it expresses the size window you want to inspect directly.

Choose the count that answers your question

“How large is this segment?” can mean different things. NSL provides several counts inherited from the structural-group attribute space, as well as segment-specific counts:

  • s.nr — number of residues. Use it when your question concerns segment length in residues.
  • s.nsg — number of structural groups. For example, s.nsg > 10 matches segments with more than 10 structural groups, while s.nsg 10:12 specifies a range.
  • s.nat — number of atoms. The reference gives examples such as s.nat < 1000 and s.nat 100:200.

These counts are not interchangeable. A residue count answers a different question from an atom count, so choose the attribute that corresponds to the unit you actually want to compare.

Use composition and charge as filters

Segment attributes also include counts for several elements. For example, s.nC < 10 filters by carbon count, and s.nO 10:20 describes a range of oxygen counts. The available element-count attributes include carbon (nC), hydrogen (nH), nitrogen (nN), oxygen (nO), and sulfur (nS). The broader atom-count attributes include total atoms (nat) and coarse-grained atoms (ncga).

For charge-related searches, use s.fc for formal charge and s.pc for partial charge. For example, s.fc > 1 expresses a formal-charge threshold, while s.pc 1.5:2.0 expresses a partial-charge range. The reference defines formal charge as an integer-valued attribute and partial charge as a float-valued attribute.

Don’t overlook names and display state

Not every useful filter is numeric. The segment name attribute accepts strings in quotes; the reference includes s.n "A" and s.n "L*" as examples. Segments also inherit node attributes for visibility and selection state. For instance, s.v and not s.v express visible and not-visible conditions, while s.selected and not s.selected express selection-state conditions.

A useful way to build a query is to start with the property that best separates the segments you care about: residue count for length, element counts for composition, or a charge attribute for charge. Then refine the expression based on what you need to inspect. Even when you ultimately review the candidates visually, a clear attribute-based filter gives you a more reproducible starting point than manually searching through a crowded structure.

For the complete attribute list 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.