A large molecular structure can be difficult to inspect one piece at a time. When a segment contains many residues, atoms, or structural groups, manually scanning the structure to find candidates can become a slow first step—especially when you are trying to narrow the scene before investigating further.
SAMSON’s Node Specification Language (NSL) lets you describe segment-level criteria as queries. The segment attribute space has the short name s, and its attributes match segment nodes. You can use these queries to identify segments by size, composition, charge, name, or visibility-related state, rather than relying only on visual inspection.
Start with the scale of the segment
If your first question is “Which segments are large enough to inspect?”, use the number of residues or structural groups:
s.nr > 100matches segments with more than 100 residues.s.nr 100:120matches segments with a residue count between 100 and 120.s.nsg > 10matches segments with more than 10 structural groups.s.nsg 10:12matches segments with 10 to 12 structural groups.
These attributes describe different measures of segment size. Residue count is useful when your inspection is organized around residues; structural-group count offers another way to describe the contents of a segment. Choose the measure that best fits the question you are asking.
Use atom counts to narrow the search
Segments also inherit atom-count attributes from the structuralGroup attribute space. For example, s.nat < 1000 looks for segments with fewer than 1,000 atoms, while s.nat 100:200 targets a range. Element-specific counts can help you focus on composition: s.nC < 10 checks carbon count, and s.nO 10:20 checks oxygen count in a range. Similar attributes are available for hydrogen, nitrogen, and sulfur.
These counts are useful for turning a broad visual search into a more concrete one. For instance, you can first look for segments in a residue-count range, then use a composition-related query to investigate a different subset. The examples here are individual expressions; use the criteria that match the question at hand.
Check charge and segment identity
For charge-based inspection, s.fc > 1 matches segments with formal charge greater than 1, and s.pc > 1.5 matches segments with partial charge greater than 1.5. Formal charge uses integer values; partial charge uses floating-point values. If the segment name is what matters, name queries accept quoted strings, for example s.n "A" or s.n "L*".
Don’t overlook inherited attributes
Segment queries also include attributes inherited from the general node space, such as hidden, visible, selected, and hasMaterial. For example, s.h checks hidden state and s.v checks visibility. The documentation notes that selected is inherited without the short name s; its examples are s.selected and not s.selected. This detail can prevent a small syntax surprise when you move between attributes.
A practical approach is to begin with one clear criterion—such as residue count—then refine your inspection using composition, charge, name, or visibility as needed. Keeping the query tied to a specific question makes it easier to understand why a segment matched and to adjust the search when the result is too broad or too narrow.
For the complete 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.
