Find the right molecular segment without searching atom by atom

When a molecular structure contains many chains or segments, finding the one you need can be surprisingly fiddly. A name alone may not tell you whether a segment is the right size or composition, and inspecting every atom manually can distract from the modeling task. SAMSON’s Node Specification Language (NSL) lets you describe a segment by properties such as residue count, atom count, and elemental composition—then use that description to find matching segment nodes.

The key idea is to choose the property that best expresses your question. Segment queries use the segment attribute space, abbreviated s, and match only segment nodes. For example, if you want segments containing more than 100 residues, use:

s.nr > 100

Here, nr is the short name for numberOfResidues. If you are thinking in terms of a bounded size rather than a threshold, the documented range form is:

s.nr 100:120

This is useful when you want to narrow a search to segments around a target length. The long form is also available: segment.numberOfResidues 100:120. The short form is compact for repeated use; the long form can be easier to read when you revisit a query later.

Choose the measurement that fits the question

Residue count is not the same as atom count. If your concern is the number of atoms in a segment, 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 specifies a range. Use residue count to describe segment length in residues; use atom count when the size of the atomic representation is what matters.

You can also search by the number of particular elements. For instance, s.nC 10:20 describes a range for carbon atoms, and s.nO < 10 sets a threshold for oxygen atoms. The corresponding short names are nH for hydrogens, nN for nitrogens, and nS for sulfurs. These attributes can help turn a vague inspection task—“find the segment with relatively few oxygens”—into a specific, repeatable query.

Keep other segment properties in view

Segment attributes also include s.nsg for the number of structural groups, and inherited structural-group attributes such as s.fc for formal charge and s.pc for partial charge. For example, the reference gives s.nsg > 10 and s.pc > 1.5 as valid expression patterns. The documentation lists these numeric attributes as integers or floats, respectively.

Some useful properties are inherited from the more general node attribute space. You can query a segment’s name with an expression such as s.n "A", or check visibility with s.v and hidden state with s.h. Boolean properties can also be negated, as in not s.v. This means a segment query can describe not only its molecular contents, but also basic node properties.

A practical way to build a query

  1. Start with the question you need to answer: segment length, atom count, elemental makeup, charge, or a node property.

  2. Pick the matching attribute and write a simple threshold or range, such as s.nr > 130 or s.nC 10:20.

  3. Check that you are querying segments rather than residues or atoms. The s attribute space is specifically for segment nodes.

  4. Use a long attribute name when clarity matters, and a short name when you want a concise expression.

One helpful distinction: a segment’s numberOfResidues and numberOfStructuralGroups are separate measures. The documentation gives s.nr 100:130 for a residue-count range and s.nsg 10:13 for a structural-group range. Choose the one that reflects the structure you are investigating rather than treating them as interchangeable.

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.