Selecting Molecular Segments by Atom Counts, Charges and More in SAMSON

When working with large molecular systems, filtering specific parts of the model becomes crucial to speed up workflows and improve clarity. For example, you might want to focus only on segments with a large number of atoms or a particular chemical composition, or even filter visually hidden segments. In SAMSON, the Node Specification Language (NSL) gives you a flexible and powerful way to do this.

This post focuses on how you can use NSL to query segment attributes to immediately identify and isolate segments based on a wide range of criteria. Segment-level queries can save significant time for users analyzing biomolecules, polymers, or complex materials containing many repeating units or structural blocks.

What Are Segment Attributes?

In SAMSON, a segment can refer to a larger structural unit within a molecule—like a protein chain. The Node Specification Language allows you to use the s attribute space to match only those nodes that are segments. This means you can construct filters like s.nat > 500 to find segments with more than 500 atoms, or s.nN > 5 to find segments with more than 5 nitrogen atoms.

Some Useful Segment Attributes

Here’s an overview of some powerful segment attributes you can use in SAMSON:

  • s.nat: Number of atoms in the segment
  • s.nC, s.nH, s.nN, s.nO, s.nS: Counts of specific atom types (C, H, N, O, S)
  • s.fc: Formal charge of the segment
  • s.pc: Partial charge (float values permitted)
  • s.nr: Number of residues in the segment
  • s.nsg: Number of structural groups
  • s.h: Whether the segment is hidden

Examples You Might Actually Use

Here are a few real-world examples that molecular modelers often need:

  • s.nat > 1000: Find segments made of more than 1000 atoms
  • s.nC 10:30: Select segments with 10 to 30 carbon atoms
  • s.fc > 1: Find segments with a formal charge greater than +1
  • s.pc 1.5:2.0: Segments with partial charges in the specified range
  • s.h: Filter only hidden segments (useful for cleaning up the view!)

Combine multiple queries with logical operators for even finer selection. For example:

This will select segments with more than 5 oxygen atoms that are not hidden.

Use Case: Filtering Complex Biomolecular Systems

Imagine working with a protein with multiple chains, where you’re only interested in chains that are highly charged and contain a large number of residues. Instead of manually searching through hundreds of objects, you could quickly isolate these segments with a query like:

This powerful query functionality helps streamline analysis, simulations, or visualization tasks.

Conclusion

The ability to filter segments using detailed attributes in SAMSON gives users more control over molecular modeling tasks. Whether you’re simplifying a complex structure or preparing for downstream simulations, NSL queries like these can significantly boost productivity.

To explore the full list of segment attributes and syntax, visit the official documentation page.

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

Comments are closed.