Find the Side Chains That Matter: Practical NSL Filters for Molecular Models

In a large molecular model, the side chain you want can be easy to lose among thousands of atoms and groups. Maybe you are checking residues with a particular name, narrowing attention to groups with certain atom counts, or reviewing charge-related properties. Searching visually can become slow and error-prone. SAMSON’s Node Specification Language (NSL) offers a more direct approach: describe the side-chain nodes you want to match using their attributes.

Start with the side-chain attribute space

The side-chain attribute space is identified as sideChain, with the short name s. The documentation’s examples use the prefix sc, as in sc.nC < 10. These attributes apply to side-chain nodes and include properties inherited from the general node and structural-group attribute spaces.

That inheritance is useful: you can query both node properties, such as visibility, and structural properties, such as atom counts. The key is to choose the attribute that represents the question you actually need to answer.

Use names when identity is the first clue

If you know the side-chain name, the name attribute is a natural starting point. For example, sc.n "A" searches by a quoted name value. The reference also gives sc.n "L*" as an example of a name pattern. This can be handy when you have a naming convention in mind but do not want to inspect every candidate individually.

Names are a good first pass, but they do not answer every structural question. If your goal is to narrow candidates by composition or size, use the corresponding numeric attributes instead.

Turn composition into a quick filter

Side-chain attributes include counts for atoms and several elements: numberOfAtoms (nat), carbons (nC), hydrogens (nH), nitrogens (nN), oxygens (nO), sulfurs (nS), and coarse-grained atoms (ncga). These accept integer comparisons and ranges in the documented examples.

  • sc.nC < 10 selects by a carbon-count threshold.
  • sc.nO 10:20 specifies an oxygen-count range.
  • sc.nat 100:200 specifies a total-atom-count range.

These filters can help turn a broad inspection task into a more focused one. For instance, if you are looking for unusually large or element-rich side-chain nodes, a count attribute gives you a clear criterion to investigate. The values are counts, not a substitute for understanding the chemical context: use the query to find candidates, then interpret them in the model.

Keep formal and partial charge distinct

The page lists formalCharge (fc) as an integer attribute and partialCharge (pc) as a floating-point attribute. The examples are sc.fc > 1 and sc.fc 6:8 for formal charge, and sc.pc > 1.5 or sc.pc 1.5:2.0 for partial charge.

This distinction matters when translating a scientific question into a query. Formal charge is represented here with integer values; partial charge can be compared using decimal values. Avoid treating the two attributes as interchangeable: choose the one that matches the quantity you intend to inspect.

Check visibility and selection separately

Side chains also inherit node attributes such as visible, hidden, selected, selectionFlag, and visibilityFlag. For example, sc.v and not sc.v express visibility tests, while sc.selected and not sc.selected test selection state. These are useful when the immediate problem is not chemical composition but finding nodes that are already visible or selected.

One small naming detail is worth remembering: the side-chain page notes that selected is inherited without the short name s. When in doubt, use the full attribute name shown in the reference rather than guessing a shorthand.

A simple way to think about the query

Before writing an expression, state the filter in plain language: “side chains with fewer than ten carbons,” “side chains with partial charge above 1.5,” or “side chains that are not visible.” Then map the property to its NSL attribute and use the documented operator and value type. This keeps the query tied to a specific question and makes it easier to review later.

For the complete attribute list and additional examples, see the SAMSON side-chain attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.