Filter Segments by Atom Types and Charges in SAMSON

When designing or analyzing complex molecular systems, it’s often essential to isolate specific parts of a model based on chemical or structural properties. Yet, manually selecting these segments in a visual interface can be tedious — especially in large-scale molecular systems like biomolecular assemblies or nanostructures.

Fortunately, the Node Specification Language (NSL) in SAMSON offers a precise and flexible way to filter segments based on diverse criteria such as atom count, element composition, charge, and more. In this blog post, we’ll explore practical examples of how to use segment attributes in NSL to speed up your workflow and focus on what matters in your molecular modeling tasks.

Segment Attributes You Can Use

The segment attribute space (short name: s) matches segment nodes and allows you to define search filters using various attributes. These include attributes from the node, structuralGroup, and segment attribute spaces.

Useful Filters You Should Know

  • Number of Carbons: Filter based on the number of carbon atoms.

    s.nC < 10 – matches segments with fewer than 10 carbon atoms.

    s.nC 10:20 – matches segments with 10 to 20 carbon atoms.
  • Number of Hydrogens, Oxygens, Nitrogens, or Sulfurs:

    Use the same syntax: s.nH, s.nO, s.nN, s.nS
  • Number of Atoms: Filter by overall atom count in a segment.

    s.nat < 1000, s.nat 100:200
  • Formal or Partial Charge: Find segments with specific charges.

    s.fc > 1, s.pc 1.5:2.0

Combining Filters for More Precision

Filters can be combined using logical operators. For instance:

  • s.nC > 5 and s.nH < 30 – segments with more than 5 carbons and fewer than 30 hydrogens.
  • s.fc 1 and s.nat > 50 – segments with formal charge of 1 and more than 50 total atoms.

This makes it easy to home in on structural motifs or charged regions of interest across complex molecular systems, such as identifying potential binding sites with elevated partial charges or locating hydrophobic segments based on atom composition.

Saving Time with Targeted Selections

Instead of visually inspecting large models or writing custom scripts, NSL lets you select segments that meet chemically relevant criteria directly from SAMSON’s search bar, significantly reducing model preparation time.

When to Use These Filters

  • Before simulations: to isolate segments for docking, MD or electrostatic analyses.
  • In structural analysis: to identify charged clusters or hydrophobic patches.
  • During visualization prep: to declutter large systems by hiding irrelevant segments.

Tips

Don’t forget that these attributes are inherited — for example, s.fc (formal charge) comes from the structuralGroup attribute space, but can still be used directly with segments!

If you’re unsure about the attribute short names or types, the full reference is available in the NSL documentation.

To explore all segment-related attributes, check out the original documentation page: Segment attributes in the NSL documentation.

SAMSON and all SAMSON Extensions are free for non-commercial use. To get started, download SAMSON at https://www.samson-connect.net.

Comments are closed.