Large molecular structures can contain many chains, and the difficult part is often not seeing them—it is identifying the one that fits a specific criterion. Maybe you need a chain with a particular ID, a chain longer than a chosen residue count, or a quick way to distinguish chains with different structural complexity. Node Specification Language (NSL) lets you express those criteria directly using chain attributes.
The key idea is to query at the right level. A chain query matches chain nodes, not individual atoms or residues. In the chain attribute space, the short prefix is c, so a query such as c.nr > 100 asks for chains whose number of residues is greater than 100. Using the chain prefix helps make the intent clear: you are describing a property of a chain as a whole.
Start with the question, then choose an attribute
If you know the chain ID, use c.id. For example, c.id 1 matches chains with chain ID 1. To specify multiple IDs or a range, the documented form is c.id 2:4, 6. This is useful when you already have IDs from a structure or analysis and want to refer to those chains explicitly.
If you are looking for chains by size, use c.nr, the short name for number of residues. For instance, c.nr 100:120 matches chains with a residue count between 100 and 120, while c.nr > 130 focuses on chains above that threshold. This can help turn a vague instruction like “find the longer chains” into a reproducible criterion.
Other count attributes answer different questions. c.ns refers to the number of segments, and c.nsg refers to the number of structural groups. For example, c.ns < 3 matches chains with fewer than three segments, while c.nsg > 10 matches chains with more than ten structural groups. These measures are not interchangeable: choose the one that corresponds to what you mean by size or organization, rather than treating every count as a measure of chain length.
Use inherited counts carefully
Chain nodes also inherit attributes from the structural-group space. These include c.nat for number of atoms, c.nC for carbons, c.nH for hydrogens, c.nN for nitrogens, c.nO for oxygens, and c.nS for sulfurs. For example, c.nat < 1000 describes a chain with fewer than 1,000 atoms, and c.nO 10:20 describes a chain with an oxygen count between 10 and 20. These can help you narrow a search by composition, but they do not replace residue counts: two chains with similar numbers of residues can differ in atom count or elemental composition.
There are also inherited node attributes for properties such as name, visibility, and selection. A chain name can be queried with c.n, with string values written in quotes—for example, c.n "A". The chain page notes that selected is available as c.selected, but has no short name in this attribute space. That detail matters when adapting expressions: not every attribute has a shorthand.
Make the query useful and repeatable
A practical approach is to write down the property you need before choosing the attribute: identity (c.id), residue count (c.nr), segment count (c.ns), structural-group count (c.nsg), or composition. Then use a threshold or range that reflects the task. Keeping the expression explicit makes it easier to revisit the same criterion later and to understand why a chain matched.
When a result surprises you, check the level and the measurement. A chain-level query will not mean the same thing as an atom-level query, and numberOfResidues, numberOfSegments, and numberOfStructuralGroups describe different properties. Choosing the appropriate attribute is often the difference between a useful filter and a confusing one.
For the full list of chain attributes, short names, value types, and examples, see the SAMSON chain attribute reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
