Find the Segment That’s Hiding in Plain Sight

A molecular structure can contain many segments, and the one you need is not always easy to spot by eye. Perhaps you are looking for a long chain, a segment with an unusual atom count, or a segment whose composition might explain an unexpected charge. Scrolling and visual inspection can turn a simple question into a slow search.

SAMSON’s Node Specification Language (NSL) lets you describe segment properties as filters. The useful starting point is that the segment attribute space, abbreviated s, matches segment nodes. Its attributes include segment-specific counts as well as properties inherited from nodes and structural groups.

Start with the scale of the segment

If you are trying to distinguish a large segment from smaller ones, use the number of residues or structural groups. For example, s.nr > 100 matches segments with more than 100 residues. To focus on a narrower size band, use s.nr 100:120. The corresponding long-form attribute is segment.numberOfResidues.

Structural-group count offers another way to describe segment size. s.nsg > 10 matches segments with more than 10 structural groups, while s.nsg 10:12 specifies a range. These two measurements answer different questions: residue count is useful when the length of a segment matters; structural-group count is useful when you want to filter by the number of groups it contains.

Use atom counts to narrow the search

Segments inherit atom-count attributes from the structural-group attribute space. That means you can query the total number of atoms with s.nat, or focus on particular elements with s.nC, s.nH, s.nN, s.nO, and s.nS. For example, s.nat < 1000 selects segments below a total atom-count threshold, and s.nO 10:20 matches segments with between 10 and 20 oxygen atoms.

These counts can help turn a vague visual clue into a testable condition. If you suspect a segment is unusually rich in a particular element, query that element’s count directly rather than relying on appearance. The same approach works for coarse-grained atom counts using s.ncga.

Check charge and identity

For charge-related filtering, s.fc refers to formal charge and accepts integer comparisons or ranges. For example, s.fc > 1 looks for segments with a formal charge greater than 1. The s.pc attribute refers to partial charge and accepts floating-point values; s.pc 1.5:2.0 is an example range query.

If you already know a segment’s name, the name attribute can help you identify it: s.n "A" searches for a segment named A. To filter by display state, the inherited visibility attribute has the short form s.v; the examples s.v and not s.v represent visible and non-visible segments, respectively.

A practical way to approach a search

  1. Decide what you know: approximate length, atom composition, charge, name, or visibility.
  2. Choose the matching attribute, such as s.nr for residue count or s.nO for oxygen count.
  3. Use a threshold when you know a cutoff, or a range when you know an approximate interval.
  4. Refine the criterion based on what you learn, using one relevant property at a time.

Keeping the query tied to a specific property makes it easier to understand why a segment matches. It also helps avoid confusing segment-level filtering with residue-level filtering: these expressions are written in the segment attribute space and match segments.

For the complete list of inherited and segment-specific attributes, see the SAMSON segment attributes reference.

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

Comments are closed.