Find the Right Segment Without Inspecting Every Chain

A molecular structure can contain many segments, and checking them one by one is a slow way to answer simple questions: Which segments have more than 100 residues? Which contain between 10 and 20 carbons? Which are hidden? SAMSON’s Node Specification Language (NSL) lets you describe these criteria as queries, so you can narrow the structure to the segments that matter.

This is especially useful when a model is large enough that visual inspection becomes tedious, or when you want to apply the same kind of search again later. The key is to choose an attribute that matches the question you are asking.

Start with the segment namespace

Segment attributes belong to the segment attribute space, whose short name is s. This namespace matches segment nodes. You can write an attribute using its full name or, in many cases, its short form. For example, these express the same residue-count criterion:

  • segment.numberOfResidues > 100
  • s.nr > 100

The short form is convenient when you are writing queries; the full form can be easier to read when you are learning the attribute names. Choose whichever makes your search clearer.

Use the count that answers your question

For a segment-length check, use numberOfResidues, abbreviated nr. For example, s.nr 100:120 matches segments with a number of residues between 100 and 120. A threshold such as s.nr > 130 is useful when you only need to find longer segments.

Do not confuse residue count with numberOfStructuralGroups (nsg). They are separate attributes: s.nsg > 10 searches by the number of structural groups, while s.nr > 10 searches by the number of residues. Picking the right count avoids using a plausible-looking query that answers a different question.

Search by composition or charge

Segments also inherit composition and charge attributes from the structuralGroup attribute space. These let you search by atom counts, such as carbons (nC), hydrogens (nH), nitrogens (nN), oxygens (nO), and sulfurs (nS). For instance, s.nC 10:20 matches segments with between 10 and 20 carbons, while s.nO < 10 looks for fewer than 10 oxygens.

For charge-based searches, s.fc refers to formal charge and accepts integer values; s.pc refers to partial charge and accepts floating-point values. Examples include s.fc > 1 and s.pc 1.5:2.0. Keep the distinction in mind: formal and partial charge are different attributes, and the documentation lists them with different value types.

Include basic node properties

Segments inherit useful node attributes too. To search by name, use a quoted string, as in s.n "A" or s.n "L*". To check visibility, s.v refers to visible segments and not s.v to segments that are not visible. Similar true-or-false attributes include s.h for hidden and s.hm for having material.

A practical approach is to translate your question into one attribute at a time: identify whether you need a residue count, an atom count, a charge, a name, or a display property, then use the corresponding short name and value type. This makes queries easier to read and helps catch common mix-ups before you rely on the results.

For the complete segment attribute reference and additional examples, see the SAMSON segment attributes documentation.

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

Comments are closed.