Find the segments that deserve a closer look

A molecular structure can contain many segments, and the one you need to inspect may not be obvious from its name alone. Perhaps you are looking for an unusually long chain, a segment with a particular atom composition, or a segment whose size differs from the rest. Scanning the structure manually can be slow—and easy to repeat every time the model changes.

SAMSON’s Node Specification Language (NSL) lets you describe segment-level criteria as expressions. The useful idea is to turn a vague inspection task into a measurable question: how many residues does the segment contain, how many structural groups, or how many atoms of a particular element?

Start with the segment prefix

Segment attributes live in the segment attribute space, whose short name is s. These attributes match segment nodes. For example, s.nr > 100 finds segments with more than 100 residues. The longer equivalent is segment.numberOfResidues > 100.

That distinction matters: the expression is about the segment as a whole, not an individual residue. If the goal is to find long segments, use a segment-level count rather than trying to infer size from a name or from a single component.

Choose the measurement that answers your question

Several attributes describe different kinds of size. s.nr is the number of residues; s.nsg is the number of structural groups; and s.nat is the number of atoms. They are related, but they are not interchangeable. A residue-count threshold is a natural starting point when comparing chain lengths, while atom or structural-group counts may be more useful when the question concerns model contents or representation.

For example, the documented expressions s.nr 100:130 and s.nsg 10:12 specify ranges for residue count and structural-group count. A comparison such as s.nat < 1000 asks for segments below an atom-count threshold. The range and comparison forms make it possible to begin with a practical cutoff, then adjust it as you learn what values occur in your model.

Use composition counts to narrow an inspection

Segment attributes also include counts of carbons, hydrogens, nitrogens, oxygens, and sulfurs. Their short names are s.nC, s.nH, s.nN, s.nO, and s.nS. If you want to identify segments with a small number of a particular element, for instance, the documented pattern s.nO < 10 expresses that criterion. Similar comparisons can be made with the other element-count attributes.

This is a useful way to make a broad model review more systematic: first identify segments by a count that matters to your question, then inspect the resulting matches in context. The expression does not explain why a segment has that composition; it gives you a consistent way to locate segments meeting the stated condition.

Keep names and state in perspective

Counts are not the only available criteria. The inherited name attribute supports quoted strings, with examples such as s.n "A" and s.n "L*". Boolean attributes include s.visible, s.hidden, and s.selected; the documentation also shows negation, such as not s.v. These can help describe a segment by its name or display and selection state, rather than by its size.

For a reliable first pass, write down the property you actually want to compare, choose its matching attribute, and use a threshold or range that reflects the question. Keep the distinction between residues, structural groups, and atoms in mind, since each count answers a different question. If you need more detail on inherited attributes and available expressions, see the segment attributes reference.

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

Comments are closed.