A molecular model can become difficult to work with long before the molecule itself becomes complicated. A structure may contain several chains, and finding the one you need by clicking through the scene can be slow—especially when you want a repeatable way to identify chains by ID, length, or composition.
SAMSON’s Node Specification Language (NSL) lets you describe chain-level criteria as short expressions. The chain attribute space uses c, so an expression such as c.id 1 refers to a chain’s ID, rather than to an atom or residue.
Start with chain identity
If you know which chain you are looking for, filter by its chain ID. For example, c.id 1 matches a chain with ID 1. You can also specify several IDs or a range: c.id 2:4, 6 matches chains with IDs 2 through 4, as well as ID 6.
This is useful when a structure contains multiple chains and you need to focus on a particular one—or compare a small set without repeatedly locating each chain in the model. The ID is the chain identifier; it is not a count of residues or atoms.
Use residue count when “long” means sequence length
Chain ID answers which chain? It does not tell you whether a chain is long. For that, use numberOfResidues, abbreviated nr. For instance, c.nr > 100 matches chains with more than 100 residues, while c.nr 100:120 matches chains in the 100-to-120-residue range.
This distinction helps avoid a common selection mistake: atom count and residue count describe different things. A chain with many atoms is not necessarily the chain you mean when you are searching by sequence length. Choose the measurement that matches the question you are asking.
Check how a chain is organized
NSL also exposes numberOfSegments (ns) and numberOfStructuralGroups (nsg). For example, c.ns < 3 matches chains with fewer than three segments, and c.nsg > 10 matches chains with more than ten structural groups.
These criteria are helpful when a model contains chains with different structural organization. They are not interchangeable with residue count: each attribute describes a separate property. If you are unsure which property will separate the chains you care about, try one criterion at a time and compare the matches.
Use inherited attributes for extra checks
Chains also inherit attributes from the node and structural-group spaces. You can, for example, search by name using c.n "A", test visibility with c.v, or check an atom-count threshold with c.nat < 1000. Composition-related attributes include c.nC for carbon count, c.nN for nitrogen count, and c.nO for oxygen count. The reference lists the available attributes and their short names.
A practical way to work is to begin with the clearest criterion—often chain ID or residue count—then use another attribute if you need to narrow your search. Keep the expressions tied to the question: use c.nr for residue length, c.ns for segment count, and c.nat for atom count. That makes selections easier to understand and reuse.
For the full attribute list and syntax examples, see the SAMSON chain attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
