Quickly Find the Right Molecules with NSL Attribute Filters in SAMSON

When working with large molecular simulations or complex molecular assemblies, finding the right subset of molecules can sometimes feel like searching for a needle in a haystack. Whether you want to focus on molecules with a specific number of chains, residues, or atoms, or identify those with certain visibility or selection states, manual searching is not only time-consuming—it’s prone to error.

Luckily, the Node Specification Language (NSL) in SAMSON offers a compact and flexible way to filter molecular nodes based on their attributes. In this post, we’ll explore how you can use NSL attribute filters, focusing specifically on those from the molecule attribute space, to simplify your molecular modeling work.

What Are Molecule Attributes in NSL?

In SAMSON’s NSL, molecule attributes are accessible using the shorthand mol. These attributes let you describe and filter molecule nodes according to a variety of characteristics, some inherited and some specific. For example:

  • Visibility: mol.v (visible)
  • Selection: mol.selected and mol.sf
  • Material presence: mol.hm, mol.om
  • Structural counts: mol.nat, mol.nr, mol.nc, mol.nH, etc.

Example: Find Molecules with More Than 100 Residues

If you’re modeling a protein or analyzing a simulation where you’re interested in more complex molecules, you might want to isolate molecules with a high number of residues. NSL makes this easy:

This expression selects all molecules with more than 100 residues.

Filter Based on Multiple Attributes

To drill down further, you can combine attributes. For example, to get molecules that are visible, selected, and have fewer than 3 chains:

This is especially helpful if you need to clean up a visual scene or prepare a focused export.

Partial Matching and Ranges

The NSL also allows you to use wildcards and ranges. Suppose you’re looking for molecules named “LigandX”, or molecules with 10 to 20 oxygen atoms:

This flexibility lets you adapt queries for everything from name-based searches to property-based filtering.

Why This Matters

Efficiently filtering and selecting molecular entities can accelerate workflows in drug design, structural biology, or material discovery. With NSL attributes, you gain a programmatic but human-readable way to tackle large models confidently. Whether you’re scripting a workflow or making an interactive selection in the GUI, the syntax remains the same.

For more details and a full list of molecule attributes, values, and examples, visit the official NSL molecule attribute documentation page.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.

Comments are closed.