A Quick Guide to Selecting Backbones in SAMSON Using NSL

When working on complex molecular systems in SAMSON, efficiently selecting specific components—like molecular backbones—is crucial. Whether you want to inspect properties, apply materials, or run analyses, the Node Specification Language (NSL) provides a clear and expressive way to specify what you need. This blog post focuses on using NSL attributes for backbones, a commonly manipulated structural element in molecular modeling workflows.

Why This Matters

Molecular modelers often face the challenge of selecting specific subsets of a system to analyze structure-function relationships, visualize properties, or fine-tune simulations. Doing this manually can be inefficient and error-prone, especially in large biological systems.

NSL dramatically simplifies this by letting you write concise conditions to select exactly what you need. Specifically, the bb prefix (short for backbones) in the backbone attribute space allows you to filter or highlight atoms or groups with a fine level of control.

Simple Examples

The attributes available for backbones include inherited properties from both node and structuralGroup levels. Here are a few useful examples to get you started:

  • Select visible backbones: bb.v
  • Select hidden backbones: not bb.v
  • Backbones with more than 100 atoms: bb.nat > 100
  • Backbones named with prefix “A”: bb.n "A*"

Being able to do this with a single line of input saves time and avoids the need for repeated manual selections.

Attribute Cheat Sheet

Attribute Short name Value type
hasMaterial hm true/false
hidden h true/false
name n string
ownsMaterial om true/false
selected (no short name) true/false
numberOfAtoms nat integer
numberOfCarbons nC integer
partialCharge pc float

Combining Conditions

NSL becomes powerful when you start combining different conditions. For example:

  • bb.nat > 50 and bb.v — selects large and visible backbones.
  • not bb.hm and bb.sf — finds backbones missing a material but marked for selection.

Tips and Common Use-Cases

  • Preprocessing: Select visible backbones only before exporting a model.
  • Scripting: Use short names to simplify logic in automation scripts.
  • Exploration: Identify backbones with particular element counts (e.g., bb.nC > 10 for carbon-rich structures).

A Note on Short Names

Most attributes come with short names (like n for name), but be mindful—selected doesn’t have a shorthand, so you will always need to use bb.selected.

In summary, NSL’s backbone attribute space gives molecular modelers precise control over selection tasks, helping them focus on analysis rather than tool navigation. Using these attributes can streamline visualization, batch operations, and even custom tool integration.

To dive deeper into the full list of available attributes and examples, visit the official documentation: https://documentation.samson-connect.net/users/latest/nsl/backbone/

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

Comments are closed.