Find the Bond, Not the Needle: Practical Filters for Molecular Models

When a molecular model contains many bonds, finding the ones you need by visual inspection can be slow and error-prone. Maybe you want to check unusually long connections, isolate a particular bond order, or inspect bonds whose type is missing. In SAMSON, the Node Specification Language (NSL) lets you describe these targets with bond attributes and use the resulting expressions to match bond nodes.

The useful first step is to decide what you mean by “the right bond.” Bond type, order, and length describe different things, so a filter for one is not a substitute for another. NSL gives each attribute a full name and a shorter form: bond attributes use the bond space, abbreviated as b.

Start with the question you want to answer

Looking for a length range? Use bond.length or its short form, b.len. Length values can include units, which helps make the intended scale explicit. For instance, b.len 1.2A:1.4A matches bonds between 1.2 and 1.4 angstroms. The equivalent interval in nanometers can be written as b.len 0.12nm:0.14nm. A threshold such as b.len >= 1.5A is useful when you want to inspect bonds at or above a chosen length.

Units matter when comparing values or sharing a query with someone else. Writing the unit directly in the expression makes it easier to recognize whether a range is intended to be in angstroms or nanometers. The documentation includes examples in both units, such as b.len 0.15nm:2.1nm.

Checking bond order? Use bond.order, abbreviated as b.o. It accepts floating-point values, so you can specify a threshold or an interval: b.o >= 2 matches bonds with order at least 2, while b.o 1.5:3 matches orders from 1.5 to 3. This is different from selecting a named bond type: order is expressed numerically, whereas type uses labels such as single or aromatic.

Selecting a named bond type? Use bond.type, or b.t. For example, b.t s selects single bonds, and b.t s,d selects single and double bonds. You can also use the longer names: bond.type single, double. Other available types include triple, amide, aromatic, dummy, and undefined. A bond must have its type defined for this attribute to match it, so a type-based query may not be the right way to find bonds whose type is absent or unavailable.

Use the shortest expression that answers the question

For a quick investigation, begin with one attribute and a clear criterion. If the goal is to inspect long bonds, try a length threshold. If the goal is to review double bonds, filter by type. If you need to explore a numerical range of orders, use the order attribute instead. Keeping these questions separate makes it easier to understand why a bond matched and to adjust the search without changing several assumptions at once.

Short names are convenient when writing expressions repeatedly, while full names can be easier to read when you are learning or sharing a query. The same distinction applies to custom types: bond.customType and b.ct match integer custom-type values. For example, b.ct 0:2 matches custom types between 0 and 2.

One small but important habit: check whether an example is an exact value, a range, or a threshold. A colon expresses a range, and comparison operators such as >= express a boundary. This makes a query more readable later, when you may not remember whether you meant “exactly this order” or “at least this order.”

These expressions are a practical way to turn a visual inspection task into a specific, repeatable search. For the complete list of bond attributes and examples, see the SAMSON bond attributes reference.

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

Comments are closed.