Quickly Filter Complex Molecular Segments Without Writing Scripts

When analyzing large biomolecular systems, molecular modelers often face a routine but time-consuming challenge: efficiently selecting the relevant segments based on their properties, such as number of atoms, residues, or specific elements like carbon or nitrogen. Manual selection or scripting can become error-prone and slow, especially when dealing with models with thousands of molecular entities. Luckily, SAMSON’s Node Specification Language (NSL) offers a targeted solution to this filtering problem—and it’s easier than it sounds.

Let’s explore how using segment-level attributes in NSL can help you quickly find what you’re looking for and save valuable time.

What Are Segment Attributes?

In SAMSON, segment nodes typically represent meaningful groupings like protein chains or complex substructures. The NSL allows you to filter these segments using a wide range of attributes. For example, you might want to:

  • Select all segments with more than 100 residues.
  • Find segments containing more than 20 carbon atoms.
  • Identify hidden or visible segments.

These operations can be performed directly within SAMSON using NSL queries. Here’s how it works.

Filtering by General Segment Properties

One of the most commonly-used attributes is numberOfResidues. You can select segments based on this using simple expressions:

  • s.nr > 100: segments with more than 100 residues
  • s.nr 100:130: segments with 100 to 130 residues

Other helpful segment-specific properties include:

  • s.nsg – number of structural groups
  • s.om – whether the segment owns material
  • s.h – whether the segment is hidden

Filtering by Chemical Composition

Segments inherit properties from structural groups, allowing you to filter based on chemical characteristics:

  • s.nC – number of carbon atoms
  • s.nH – number of hydrogen atoms
  • s.nN – number of nitrogen atoms
  • s.pc – partial charge (floating-point values)

For example, to find segments with more than 10 nitrogen atoms:

Or to filter segments with a partial charge greater than 1.5:

Filtering by Visual Status

Visual properties are particularly relevant when preparing presentations or models:

  • s.v – visible flag
  • s.h – hidden flag
  • s.selected – selection status

You can combine multiple filters using logical operators. For example:

This selects all visible segments with more than 100 residues.

Why It Matters

Being able to express these queries directly in NSL removes the need for external scripting or tedious manual selection. This is particularly useful when dealing with repeating structures, different chains in protein complexes, or large molecular machines. The syntax is compact, readable, and designed to cover a wide range of molecular modeling tasks.

In short, segment-level attributes allow you to search efficiently across your molecular systems based on logical criteria, enabling faster workflows, especially in high-throughput or comparative studies.

To explore all segment-specific attributes and try examples, visit the full documentation: https://documentation.samson-connect.net/users/latest/nsl/segment/

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

Comments are closed.