When a molecular model contains many segments, finding the one you need can become a small search problem of its own. Names may be unfamiliar, and a quick visual inspection may not tell you whether a segment is large, compositionally unusual, or worth investigating. SAMSON’s Node Specification Language (NSL) lets you describe segments using attributes such as residue count, atom count, elemental composition, and charge.
The useful shift is to search by a property you can state precisely. Rather than relying only on a segment’s name, you can ask for segments above a size threshold, within a residue-count range, or with a particular charge. The expressions below use the short s prefix for the segment attribute space.
Start with size
For a first pass through an unfamiliar structure, residue count can help distinguish larger segments from smaller ones. For example, s.nr > 100 matches segments with more than 100 residues. If you are interested in a narrower size band, use a range: s.nr 100:120 matches segments with between 100 and 120 residues.
Atom count gives you another way to describe size. The inherited attribute s.nat can be used with a threshold, as in s.nat < 1000, or a range, such as s.nat 100:200. These measures are not interchangeable: residue count describes how many residues a segment contains, while atom count describes how many atoms it contains. Choose the one that fits the question you are asking.
Use composition to narrow the search
If size alone does not identify the segment you want, elemental counts can add useful detail. For example, s.nC < 10 describes segments with fewer than 10 carbons, and s.nO 10:20 describes segments with 10 to 20 oxygens. Related attributes are available for hydrogen, nitrogen, and sulfur counts: s.nH, s.nN, and s.nS.
These attributes are useful when you are checking a structure against a simple expectation—for instance, whether a segment is unusually small or has a notable count of a particular element. They report counts, not chemical identity or function, so use them as a way to narrow down candidates rather than as a complete interpretation of the molecule.
Check charge and segment organization
Two charge attributes are available through inherited structural-group properties. s.fc > 1 matches segments with formal charge greater than 1, while s.pc 1.5:2.0 uses a range for partial charge. Formal charge and partial charge are distinct attributes; select the one appropriate to your question.
To look at organization rather than composition, use s.nsg, the short name for the number of structural groups. For example, s.nsg > 10 matches segments with more than 10 structural groups. This can help you find segments with a particular structural-group count without first inspecting each one individually.
Keep the scope clear
The prefix matters: these are expressions in the segment attribute space, which matches segment nodes. Some available attributes are specific to segments, such as s.nr and s.nsg; others are inherited from broader node or structural-group attribute spaces. For example, s.n refers to a name, while s.v refers to visibility. The documentation also lists boolean attributes such as s.selected and s.hm (has material).
A practical approach is to begin with one clear criterion, such as residue count, then inspect the resulting candidates and refine your search using another relevant attribute. This keeps the query tied to a specific modeling question and makes it easier to understand why a segment matches.
For the complete attribute list and additional examples, see the SAMSON segment attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at www.samson-connect.net.
