Stop Clicking, Start Searching: Selecting Molecular Structures with NSL

One of the most common points of friction for molecular modelers is efficiently selecting structures—like ligands, residues, or atoms—from large and complex molecular systems. If you’ve ever spent more time than you’d like manually clicking through molecules to highlight regions of interest, the Node Specification Language (NSL) in SAMSON can make your work significantly smoother.

Whether you’re preparing a simulation, visualizing specific structural features, or analyzing non-covalent interactions, NSL lets you describe exactly what you want to select using a simple-yet-powerful syntax. This blog post focuses on using NSL with the Find command to accelerate your structure selections.

What’s the Find Command?

The Find command, accessed from Select > Find or via Ctrl + F / Cmd + F, allows you to type NSL expressions directly into a search bar. SAMSON then uses your NSL query to select nodes such as atoms or residues in the active document.

Even better: the search bar offers context-sensitive auto-completion. Start typing a residue or atom name inside quotes, press the Tab key, and SAMSON will suggest completions based on available nodes. For example, typing:

and pressing Tab could offer suggestions like:

  • "ALA 22 Backbone"
  • "ALA 28"

Writing Useful Selection Queries

Here are a few examples of powerful selections made possible through NSL:

  • n.c lig, rec – Select all ligands and receptors
  • r.id 20:40,50:60 – Select residues with IDs between 20–40 and 50–60
  • C in n.s – Select carbon atoms in the current selection
  • H l O – Select hydrogens linked to oxygen atoms

And if you’re unsure how to formulate a selection, you can ask SAMSON’s AI Assistant to help you generate the NSL expression. Just click on the AI button next to the search bar.

Image Example: Selecting Nodes with the Find Command

Using the Find command, here’s an example of how the interface looks when making a selection using NSL:

Select nodes with the Find command

Why This Matters

Manual selection works fine for small structures, but the moment molecules start getting bigger—or your needs get more specific—manual interaction becomes slow and error-prone. NSL cuts through this by offering precision, speed, and repeatability.

Plus, NSL supports logical, topological, and proximity operators, enabling you to write queries like:

to select carbons within 5 angstroms of GLN 2, or even:

to select all non-alanine residues.

To learn more about NSL syntax, ranges, attribute types, and advanced operators, you can read the full documentation at https://documentation.samson-connect.net/users/latest/nsl/.

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

Comments are closed.