When a Bond Looks Wrong: Find It with Four NSL Filters

A molecular model can contain many bonds, and visual inspection alone may not make it easy to find the one you need to examine. Perhaps you want to locate bonds within a particular length range, inspect bonds with an unusual order, or isolate bonds whose type is recorded as undefined. In SAMSON, the Node Specification Language (NSL) lets you describe those criteria as compact queries.

This guide focuses on bond attributes: what each one tells you, when it can help, and how to combine its notation with a practical inspection question. Bond attributes belong to the bond attribute space, abbreviated b, and match bond nodes only.

Start with the question you want to answer

Different bond attributes describe different properties. Choosing the right one is useful because “find a particular bond” can mean several things:

  • Length: How long is the bond?
  • Order: What numerical bond order is recorded?
  • Type: Is it single, double, aromatic, or another listed type?
  • Custom type: Does it have a particular integer custom-type value?

These attributes are not interchangeable. A query for a bond type, for example, is not the same as a query for a numerical order. Decide which property answers your question before writing the expression.

Search by bond length, with units

Bond length is often the most direct attribute to use when you are looking for bonds that fall inside or outside a distance interval. The full name is bond.length; its short form is b.len. Values can include length units, such as angstroms (A) or nanometers (nm).

  • b.len >= 1.5A matches bonds at least 1.5 angstroms long.
  • b.len 1.2A:1.4A matches bonds between 1.2 and 1.4 angstroms.
  • b.len 0.15nm:2.1nm expresses a range in nanometers.

Including units makes the intended scale easier to read and helps prevent confusion when comparing values written in different units. The documentation supports both angstrom and nanometer examples; use a range that reflects the question you are investigating rather than assuming a particular bond length is automatically incorrect.

Use order when the numeric value matters

The bond.order attribute, abbreviated b.o, accepts floating-point values. It is useful when your criterion is expressed numerically rather than as a named bond category.

  • b.o >= 2 matches bonds with order at least 2.
  • b.o 1.5:3 matches bonds with order between 1.5 and 3.

For example, if you need to inspect bonds in a particular order interval, a range keeps the search focused without requiring you to list every value separately.

Use type for named categories

When you want a category such as single or aromatic, use bond.type (short form b.t). NSL accepts the full names and listed short forms: single or s, double or d, triple or t, amide or am, aromatic or ar, dummy or du, and undefined or un. Single, double, and triple also accept 1, 2, and 3, respectively.

Examples include b.t s for single bonds and b.t s,d for single or double bonds. You can also query b.t du,un to match dummy and undefined bonds. One important limitation: the bond must have its bond type defined for a type query to be useful. If the type is not defined, the query cannot identify it as a defined single, double, or other named category.

Custom types are integer labels

If your workflow uses custom bond-type values, the bond.customType attribute (b.ct) matches integer values. For instance, b.ct 0 matches custom type 0, while b.ct 0:2 matches values between 0 and 2. This is separate from the named categories queried with b.t.

A simple way to build a query

Begin with one property and a narrow criterion. For a distance-based search, try a length range; for a categorical search, choose a bond type; for a numeric-order search, use an order condition. Then adjust the expression to broaden or narrow the set of matching bond nodes. Short forms such as b.len, b.o, and b.t make repeated queries concise, while full names can make saved expressions easier to interpret.

These filters help you find bonds to inspect; they do not by themselves explain why a bond has a particular value or determine whether that value is chemically appropriate. Interpret matches in the context of your model and analysis.

For the complete list of bond attributes and syntax examples, see the SAMSON bond NSL reference.

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

Comments are closed.