Large molecular structures can be difficult to inspect one piece at a time. A useful first step is to narrow the structure by segment: for example, find segments with a certain number of residues, check which ones are unusually large, or distinguish them by composition. In SAMSON, the Node Specification Language (NSL) provides attributes for describing and matching segment nodes.
A segment query is useful when your question is about a whole structural unit rather than an individual atom or residue. Segment attributes include its name and visibility state, counts of atoms and selected elements, charge, and the number of residues or structural groups. The segment attribute space is written as segment, or with the short prefix s.
Start with size, not guesswork
When a structure contains many segments, residue count is a straightforward way to find candidates by scale. For example, s.nr > 100 matches segments containing more than 100 residues. To focus on a narrower size range, use s.nr 100:120. These queries can help answer practical questions such as “Which segments are large enough to inspect first?” or “Are there segments in this particular size band?”
Segment size can also be expressed as a count of structural groups. Use s.nsg > 10 to match segments with more than 10 structural groups, or s.nsg 10:12 for the documented range example. These measures describe different things: the residue count is not interchangeable with the structural-group count. Choose the one that corresponds to the way you are thinking about the structure.
Use composition to narrow the candidates
Segments inherit several composition and charge attributes from the structural-group attribute space. For example, s.nC < 10 checks for fewer than 10 carbons, while s.nO 10:20 checks for an oxygen count between 10 and 20. Similar count attributes are available for hydrogen, nitrogen, sulfur, all atoms, and coarse-grained atoms. Formal charge is an integer attribute, as in s.fc > 1; partial charge is a floating-point attribute, as in s.pc > 1.5.
These filters are most useful as focused questions, rather than as a substitute for understanding the model. A segment with a particular atom count or charge is a candidate to examine; the query itself does not explain why that segment has those properties. Start with a broad criterion, then refine your search using another relevant attribute.
Remember the inherited node attributes
Segments also inherit general node attributes. You can check visibility with s.v or not s.v, and hidden state with s.h or not s.h. A name can be matched with an expression such as s.n "A"; the reference also shows s.n "L*" as an example. The selected attribute is a small syntax exception: it is written s.selected, not with a short name like s.v.
A practical way to work is to translate your inspection goal into one clear attribute: residue count for segment length, element counts for composition, charge for charge-related screening, and visibility or name when you need to identify a particular part of the model. Then use the short forms to keep repeated expressions compact. For a complete list of segment attributes and examples, see the SAMSON segment attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
