Find the Side Chains That Matter: A Practical NSL Filtering Guide

When a molecular structure contains many residues, locating a particular kind of side chain can become a tedious visual search. You may be looking for groups with a certain elemental composition, a charge-related value, or simply side chains that are currently hidden. SAMSON’s Node Specification Language (NSL) lets you describe those criteria as expressions, so you can search by attributes instead of scanning the structure one node at a time.

This guide focuses on a useful, self-contained part of NSL: the sideChain attribute space. Its short name is sc, and expressions beginning with sc match side chain nodes. The examples below use the attribute names and expression forms documented for this space.

Start with the question you want to answer

A good filter begins with a specific question. For example: “Which side chains have fewer than ten carbon atoms?” The corresponding expression is:

Here, nC is the short name for numberOfCarbons. Other element-count attributes follow the same pattern: nH for hydrogens, nN for nitrogens, nO for oxygens, and nS for sulfurs. If you want to inspect side chains with between 10 and 20 oxygen atoms, for example, the documented range form is:

These are useful starting points when composition is more informative than a residue’s displayed name. The broader numberOfAtoms attribute is shortened to nat, while ncga refers to numberOfCoarseGrainedAtoms.

Use charge attributes carefully

For charge-related searches, NSL provides formalCharge (fc) and partialCharge (pc). The examples show an integer comparison and range for formal charge, and a floating-point comparison and range for partial charge:

These expressions make it possible to express the threshold or interval you are interested in directly. Formal charge uses integer values; partial charge uses floating-point values. If you are unsure which charge measure suits your question, keep them distinct rather than treating the two attributes as interchangeable.

Filter by name or current display state

Side chains also inherit node attributes. To search by name, use n and a quoted string, as in sc.n "A" or sc.n "L*". The documentation’s examples show these forms; consult the NSL reference for the precise matching behavior you need.

For visibility and selection, the expressions can be especially handy when a structure is visually busy. Use sc.v to match visible side chains and not sc.v to match those that are not visible. Likewise, sc.selected and not sc.selected express selected and unselected states. The full attribute name matters here: selected has no short name in the side-chain attribute space, so use sc.selected, not a shortened form.

Other inherited Boolean attributes include hidden (h), hasMaterial (hm), ownsMaterial (om), selectionFlag (sf), and visibilityFlag (vf). The reference gives examples such as sc.h, sc.sf false, and sc.vf.

A practical way to work

Write down the property you need, choose its attribute, and begin with one expression—for example, sc.nC < 10 or sc.pc 1.5:2.0. Check which side chains match, then adjust the value or try another documented attribute if the results do not answer your question. Keeping the first search narrow makes it easier to understand what each criterion is doing. The attribute space also includes numberOfAtoms, numberOfCarbons, numberOfHydrogens, numberOfNitrogens, numberOfOxygens, numberOfSulfurs, formalCharge, and partialCharge, so there are several ways to describe a side chain beyond its name.

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

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

Comments are closed.