For molecular modelers, selecting specific atoms, residues, and structural groups can often feel like searching for a needle in a haystack. What if there was a precise, straightforward way to find exactly what you need without manually navigating complex molecular systems? Introducing the Node Specification Language (NSL) in SAMSON: a tool that empowers you to select nodes based on properties and attributes.
In this blog post, we’ll explore how NSL can revolutionize your workflow by enabling efficient node searches and filtering using intuitive expressions. Whether you’re working with ligands, receptors, or protein backbones, NSL can make your life easier.
What is the Node Specification Language?
NSL is a powerful querying language used in SAMSON to identify and select nodes (atoms, residues, structural groups, etc.) based on their properties. You can use NSL in the Find command or as a filter in the Document view.
The key advantage of NSL is its flexibility. You can write short, human-readable expressions for complex queries. For example, n.c lig, rec quickly selects ligands and receptors, while Hydrogen or simply H matches all hydrogen atoms in your molecular system.

Using the Find Command
The Find command in SAMSON provides a simple interface to input NSL expressions and select nodes from the active document. Just open the Find utility and type your query in the search box. Features like context-sensitive completion also make it intuitive—just press Tab when typing to view suggestions tailored to your query.
Let’s consider an example:
- Entering
"ALAand pressing Tab lists all nodes beginning with “ALA,” such as: "ALA 22 Backbone""ALA 22 Side chain""ALA 22"
NSL isn’t just for advanced users—anyone can find it useful. For instance, you can ask SAMSON’s AI Assistant to generate NSL expressions for tailored queries based on the active document.
Examples of NSL Expressions
Ready to dive deeper? Here are some useful real-world examples of NSL expressions:
node.category ligand, receptor: Matches ligands and receptors.r.id 20:40: Selects residues with IDs between 20 and 40.a.ci > 2: Matches atoms with chain IDs greater than 2.C in node.selected: Filters carbons in the current selection.
You can combine expressions with logical operators for advanced cases. For example, C or H selects carbon and hydrogen atoms, while n.t r and not r.t ALA matches all non-alanine residues.
Proximity-Based Selections
NSL also includes proximity operators, allowing you to select nodes based on spatial relationships. For example:
"CA" within 5A of S: Finds nodes named “CA” within 5 angstroms of any sulfur atom.n.t a b 5A of node.selected: Matches atoms beyond 5 angstroms of the current selection.
Proximity tools make it easy to focus on relationships and interactions within complex molecules, saving time and improving precision.
Final Thoughts
The Node Specification Language in SAMSON simplifies even the most complicated queries into easy-to-write expressions, enabling molecular modelers to focus less on navigation and more on analysis. Discover the myriad ways NSL can enhance your modeling tasks by exploring the official documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON today at https://www.samson-connect.net.
