When a Bond Looks Wrong: A Practical Guide to Filtering Bonds in SAMSON

A molecular model can contain hundreds or thousands of bonds. When one looks unusually long, has an unexpected order, or carries a type you did not anticipate, finding it by eye can be tedious. SAMSON’s Node Specification Language (NSL) lets you describe the bond property you want to match, then narrow your search with a compact expression.

This is especially useful when checking a structure after importing or editing it: instead of inspecting every connection, start with a measurable property and make the search specific. The examples below use the bond attribute space, whose short name is b. Bond attributes match bond nodes only.

Start with length when geometry is the concern

Bond length is available as bond.length, or in its shorter form, b.len. Length expressions can include units, so a threshold is easier to interpret when its units are explicit. For example, b.len >= 1.5A matches bonds at least 1.5 angstroms long. To focus on a band of lengths, use a range: b.len 1.2A:1.4A.

You can also express lengths in nanometers. For example, b.len 0.15nm:2.1nm matches bonds with lengths between those values. Keeping the units visible helps prevent confusion when comparing a query with measurements reported in a different unit.

Check order separately from length

Bond order is a different attribute from bond type. Use bond.order or the short form b.o to match floating-point order values. For example, b.o >= 2 matches bonds with an order of at least 2, while b.o 1.5:3 matches orders between 1.5 and 3.

This distinction matters when troubleshooting: a length query asks about the measured distance between bonded atoms; an order query asks about the bond’s order value. If you are investigating an unexpected connection, these are separate properties to check rather than interchangeable labels.

Use bond type when you need a named category

For named bond categories, use bond.type or b.t. The available types include single (s or 1), double (d or 2), triple (t or 3), amide (am), aromatic (ar), dummy (du), and undefined (un).

Examples include b.t s for single bonds and b.t s,d for single or double bonds. To look for less conventional categories, b.t du,un matches dummy and undefined bonds. The documentation notes an important limitation: a bond must have its bond type defined for a type query to match it.

Keep a small query toolkit handy

  • For an unusually long bond: b.len >= 1.5A
  • For a length interval: b.len 1.2A:1.4A
  • For higher bond orders: b.o >= 2
  • For single and double bond types: b.t s,d
  • For a custom bond type: b.ct 0:2

These expressions make it easier to state exactly what you are checking, and the short forms keep repeated searches readable. If a match is not what you expected, verify that you are querying the right property—length, order, type, or custom type—and check units for length values.

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.