When a Bond Looks Wrong: A Practical NSL Checklist

A molecular structure can look convincing at a glance and still contain bonds worth checking: an unexpectedly long connection, an unusual bond order, or a bond type that is not what you intended. The challenge is finding those bonds without having to inspect every connection one by one.

In SAMSON, the Node Specification Language (NSL) lets you search bond nodes by attributes such as length, order, and type. These searches are useful as focused checks: choose an attribute that describes the issue you want to investigate, then use a value or range to narrow the candidates.

Start with bond length

If you are looking for bonds outside a length range of interest, use b.len, the short name for bond.length. For example, b.len >= 1.5A matches bonds at least 1.5 angstroms long. To inspect a band of values, try b.len 1.2A:1.4A. The full attribute form is bond.length 1.2A:1.4A.

Length searches accept units, which helps when your reference value is in a different unit system. For example, b.len 0.15nm:2.1nm searches a range expressed in nanometers. Remember that 1 nm equals 10 Å, so 0.15 nm is 1.5 Å. Checking the units before running a query can prevent a misplaced decimal from turning a narrow search into a very broad one.

Check bond order separately

Length and order describe different properties. A bond-length query finds bonds based on their measured separation; an order query finds them based on their bond order. Use b.o for order: b.o >= 2 matches orders of at least 2, while b.o 1.5:3 selects orders within that range.

This distinction is useful when reviewing a structure: a bond can merit attention because of its length, its assigned order, or both. Treating these as separate searches makes it clearer which property caused a bond to appear in the results. The examples here describe individual attribute queries; they do not assume a particular way to combine multiple conditions.

Use type names or short forms

For a check based on chemical bond type, use b.t, the short name for bond.type. For example, b.t s matches single bonds, and b.t s,d matches single and double bonds. You can also use the longer names: bond.type single and bond.type single, double.

NSL recognizes single (s or 1), double (d or 2), triple (t or 3), amide (am), aromatic (ar), dummy (du), and undefined (un) types. One important limitation: a type search requires the bond to have its bond type defined. If a query does not find the bonds you expected, that is worth checking before concluding that those bonds are absent.

When a custom type matters

Some workflows use custom integer types. Search those with b.ct: b.ct 0 matches custom type 0, and b.ct 0:2 matches custom types between 0 and 2. This is distinct from the standard bond-type labels above, so choose the attribute that matches the data you are trying to inspect.

All four attributes belong to the bond space, whose short name is b, and they match bond nodes only. A practical way to begin is to turn a question into one attribute-specific query: “Which bonds are at least this long?”, “Which have order 2 or higher?”, or “Which are aromatic?” Using explicit units and the compact short names keeps these checks readable and easier to revisit.

For the complete attribute reference and additional examples, see the SAMSON bond attributes documentation.

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

Comments are closed.