How to Quickly Find Segments with Specific Properties in Molecular Models

If you’ve ever worked on large molecular systems in SAMSON and struggled to filter or select specific segments based on structural or visual attributes, you’re not alone. Whether you’re analyzing simulations or preparing publication-ready visuals, efficiently narrowing down large systems to relevant molecular segments can save hours.

Fortunately, SAMSON’s Node Specification Language (NSL) supports a powerful system of filters for segment nodes, letting you query based on visibility, material, selection status, atom count, and even elemental composition. Here’s an overview of how you can leverage this to streamline your workflow and avoid manual selection.

Segment Attribute Space Overview

The segment attribute space in NSL (short name: s) allows you to write compact filters for segment nodes. Here’s how you can use it:

Visibility and Display

  • Visible segments: s.v
  • Hidden segments: not s.h or not s.v
  • Segments with materials assigned: s.hm
  • Segments that own materials: s.om

Filtering by Name

You can use s.n to match segment names, with wildcards:

  • s.n "A" matches segments named “A”
  • s.n "L*" matches segments starting with “L”

Selection and Flags

  • s.selected finds selected segments
  • s.sf and s.vf check selection or visibility flags

Atomic and Elemental Composition

NSL supports attribute filters based on atom counts inside segments. This is particularly useful when searching for large fragments or biomolecular domains.

  • Atom count: s.nat < 1000
  • Carbon atoms: s.nC 10:20
  • Hydrogen atoms: s.nH > 5
  • Oxygen atoms: s.nO < 10

Residue and Structural Group Count

To analyze biological macromolecules or coarse-grained models, NSL lets you filter segments based on residue or structural group numbers.

  • s.nr > 130 – segments with more than 130 residues
  • s.nsg 10:13 – segments with 10 to 13 structural groups

Why This Matters

When dealing with complex assemblies such as protein-ligand systems, nanotubes, or coarse-grained models, the ability to filter segments based on properties like visibility, material ownership, or atom composition enables:

  • Rapid selection and isolation of regions of interest
  • Simplified scene preparation for rendering
  • Efficient scripting in automation tasks

No more time spent manually clicking through segment trees. With NSL, a few keystrokes can extract the right subset instantly.

To explore all segment attributes and their syntax, refer to the official documentation.

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

Comments are closed.