A large molecular structure can contain several chains, and it is easy to lose time inspecting them one by one just to find the chain you need. Maybe you know its chain ID, expect it to contain a certain number of residues, or want to narrow the view to unusually short or long chains. SAMSON’s Node Specification Language (NSL) lets you describe those criteria as queries against chain nodes.
This guide focuses on a practical subset of the chain attributes: IDs, names, residue counts, segment counts, and structural-group counts. The examples use the short attribute prefix c, which applies to chains.
Start with the question you can answer
Before writing a query, identify what you know about the chain. A numeric chain ID is useful when you already know which ID to find. A residue count is more useful when you are looking for a chain by its approximate size. Segment and structural-group counts describe different aspects of the chain’s organization, so choose the one that matches your question.
Find a chain by ID
The chainID attribute has the short name id. To match chain ID 1, use:
c.id 1
You can also query a range or list of IDs. For example, c.id 2:4, 6 matches chains with IDs from 2 to 4 and with ID 6. This is useful when checking a small set of candidate chains rather than searching the whole structure manually.
Chain IDs are numeric in this attribute. If what you have is a chain name rather than an ID, use the inherited name attribute instead. For example, the documentation shows c.n "A" and c.n "L*". Names are provided as quoted strings.
Use residue count to narrow by size
If you are trying to locate a long chain, query the number of residues with nr:
c.nr > 100
To look for chains with a residue count in a particular interval, use a range:
c.nr 100:120
This is often a more direct starting point than judging chain length visually. It can also help you spot chains that are much shorter or longer than expected, which is useful when checking a structure before further analysis.
Don’t confuse the three kinds of counts
NSL provides separate attributes for the number of residues, segments, and structural groups. They answer different questions:
c.nrmatches the number of residues. For example,c.nr > 130finds chains with more than 130 residues.c.nsmatches the number of segments. For example,c.ns 2:4finds chains with between 2 and 4 segments.c.nsgmatches the number of structural groups. For example,c.nsg > 10finds chains with more than 10 structural groups.
These values should not be treated as interchangeable. If your criterion is based on residue length, use nr; if it is based on segmentation, use ns. Choosing the matching attribute makes a query easier to interpret and reduces the chance of filtering for the wrong property.
A simple selection routine
- Write down the fact you know: an ID, a name, an approximate residue count, or a structural organization count.
- Choose the corresponding attribute:
id,n,nr,ns, ornsg. - Begin with a focused expression, such as
c.id 1orc.nr 100:120. - If the result is not specific enough, adjust the numeric value or range using the same attribute.
Chain attributes also include properties inherited from other NSL attribute spaces, such as visibility, selection, atom counts, and charge. The complete reference identifies which attributes are inherited and lists their short names and examples.
For the full chain attribute reference and additional examples, see the SAMSON chain attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
