Find the bond that doesn’t fit: a practical guide to bond searches

When a molecular structure looks wrong, the cause is not always obvious. A bond may be longer than expected, have an unexpected order, or carry a type you need to inspect. Scanning a large model bond by bond is tedious—and it is easy to overlook the one worth checking.

SAMSON’s Node Specification Language (NSL) lets you describe bond properties in a compact query. This guide focuses on a practical use: narrowing a broad structure down to bonds that meet a specific length, order, type, or custom-type condition.

Start with the bond attribute space

Bond attributes live in the bond attribute space, whose short name is b. These attributes match bond nodes only. You can write an attribute using its full name or its shorter form—for example, bond.length or b.len.

The short forms are handy when you are exploring several conditions. The full names can be easier to recognize when you return to a query later. Both forms express the same attribute.

Search by length when geometry raises a question

If you want to locate bonds above a length threshold, try b.len >= 1.5A. To focus on a range, use b.len 1.2A:1.4A. Length values can include units, which helps prevent a common source of confusion: entering a number without being clear about the scale.

The same range can be expressed in nanometers: b.len 0.15nm:2.1nm. Choose units that make sense for the values you are checking, and keep them explicit in the query. A length search is a way to find candidates for inspection; the result alone does not explain why a bond has that length.

Use bond order to narrow a different kind of search

Bond order is a floating-point attribute. For example, b.o >= 2 matches bonds with an order at least 2, while b.o 1.5:3 matches bonds with an order between 1.5 and 3.

Length and order answer different questions. If you are investigating a suspicious geometry, a length query can help locate long bonds. If you are checking assignments or looking for higher-order bonds, an order query gives you a separate way to narrow the search. Keeping these checks distinct makes it easier to understand what each result is telling you.

Filter by a named bond type

For a type-based search, use b.t. The documented shorthand for single bonds is s, so b.t s matches single bonds. You can request more than one type in the same value list: b.t s, d matches single and double bonds. Other available types include triple (t or 3), amide (am), aromatic (ar), dummy (du), and undefined (un).

One detail matters: the bond needs to have its bond type defined for this attribute to be useful. If a type-based query does not return the bonds you expected, check whether the type information is present rather than assuming the query has identified every chemically relevant bond.

When the standard type is not enough

Some workflows use custom bond types. The bond.customType attribute, shortened to b.ct, accepts integers. For instance, b.ct 0 matches custom type 0, and b.ct 0:2 matches custom types between 0 and 2. This is useful when the distinction you need to search for is encoded as a custom type rather than one of the named bond types.

A simple search routine

  1. Choose the property connected to your question: length, order, named type, or custom type.
  2. Write a focused query, using units for lengths and a clear threshold or range where appropriate.
  3. Review the matching bond nodes in the context of the structure. Treat the query as a way to find candidates, not as a diagnosis of what caused an unusual result.
  4. If you need to check another property, run a separate query so the purpose of each search stays clear.

These small expressions can make a large structure easier to investigate: instead of searching visually for every possible issue, you can ask a precise question about the bond attributes available to NSL.

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

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

Comments are closed.