Quickly Select Specific Bonds in SAMSON Using NSL

When working on complex molecular systems, selectively targeting and analyzing specific kinds of bonds—by type, order, or length—can significantly speed up your workflow. Whether you’re reviewing molecular geometries, preparing simulations, or visualizing particular features, manually clicking through bonds or writing custom code can be time-consuming and error-prone.

Fortunately, the Node Specification Language (NSL) in SAMSON allows you to define and automate bond selection using a simple but powerful query syntax. In this guide, we’ll focus on how to filter bonds using their types.

Why Bond Types Matter

Bond type assignment is a common part of molecular modeling. Visualizing distinct bond types can clarify molecular properties, such as identifying single versus double bonds in organic molecules, isolating aromatic interactions in proteins or ligands, or reviewing parameters for dummy bonds during simulations.

In SAMSON, each bond can be tagged with one of the following types:

  • single (s, 1)
  • double (d, 2)
  • triple (t, 3)
  • amide (am)
  • aromatic (ar)
  • dummy (du)
  • undefined (un)

How to Filter by Bond Type Using NSL

To filter bonds by type in NSL, the typical query structure is:

Some examples include:

  • b.t s – selects all single bonds
  • b.t d – selects all double bonds
  • b.t ar – selects all aromatic bonds
  • b.t du,un – selects dummy and undefined bonds (very useful when cleaning up or checking your structure)

You can also combine types easily with commas, like:

This will match both single and double bonds – helpful for quickly parsing through most covalent connections while leaving out less common bond types.

When This is Useful

  • Model Cleanup: Find and correct undefined or dummy bonds with b.t du,un.
  • Structure Analysis: Select and measure only aromatic bonds using b.t ar.
  • Highlighting Chemistry: Color different bond types separately in your visualization pipeline.

Important Notes

Bond type filtering requires that bond types are already assigned in your structure. If not, you may need to use a SAMSON Extension that assigns them (such as a force field plugin or an import tool).

Explore More Tools

Bond type filtering is just one way NSL can boost your molecular modeling workflow. The full bond attribute suite includes criteria on bond length (b.len), order (b.o), and custom types (b.ct), giving you fine-grain control over what you see and interact with.

📘 Learn more in the full bond attribute documentation

SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.

Comments are closed.