Mastering Node Selection: Quickstart Guide to NSL in SAMSON

For molecular modelers, selecting specific molecular structures and nodes based on their unique properties is often a crucial task. Whether you’re working with ligands, receptors, or residues, having efficient ways to isolate these elements within your documents can save an incredible amount of time and effort. This is where SAMSON’s powerful Node Specification Language (NSL) comes into the picture.

But if you’re new to NSL, where should you begin? In this guide, we walk you through the essentials to get you started quickly. By the end, you’ll have practical tools to perform advanced selection, filtration, and operations on molecular nodes efficiently—all within SAMSON.

What is NSL?

NSL, short for Node Specification Language, is a dynamic tool in SAMSON designed for selecting structures and nodes based on their attributes. For example, NSL can be used to filter atoms, residues, or larger structures like chains and molecules. The ability to logically query and segment data in this way makes NSL an indispensable tool for researchers working on complex molecular models.

Where to Use NSL

In SAMSON, there are two powerful ways to leverage NSL for node selection:

  • Select > Find: Use the NSL string in the Find command for search-driven selections. For example, the NSL string node.type residue will match all residues.
  • Document View: Use NSL expressions in the document view to interactively filter nodes. This is particularly useful for dynamically exploring molecular hierarchies.

Pro-tip: SAMSON also provides an AI Assistant to generate NSL expressions for you. This feature is context-sensitive and can suggest NSL queries tailored to your active document.

First Expressions to Try

The best way to get started with NSL is by trying out some simple but practical expressions:

  • node.type residue: Selects all residue nodes in your document.
  • C or H: Matches atoms that are carbons or hydrogens.
  • "CA" within 5A of S: Finds nodes named “CA” within 5 angstroms of sulfur atoms.
  • node.category ligand, receptor: Isolates ligands and receptors in your model.

You can test these queries in the Find command or the filter box in Document View. For instance, the query “CA within 5A of S” can be typed into the search bar, and the system will identify the relevant nodes for you.

Explore NSL’s Tab Completion

A useful tip for beginners is leveraging NSL’s tab-completion feature in the Find command. Let’s say you’re searching for residues with names starting with “ALA”. Typing "ALA (with the opening quotes) and pressing the Tab key will provide context-sensitive matches like:

  • "ALA 22 Backbone"
  • "ALA 22 Side chain"
  • "ALA 28", and more.

This feature not only boosts productivity but also minimizes errors in constructing your query expressions.

Why Use NSL?

The precision and flexibility NSL offers are immense. With simple syntax and logical operators like and, or, and not, NSL enables you to craft highly specific queries. For example:

  • node.type residue and not residue.type ALA: Selects all residues except alanine.
  • O in node.type sideChain: Identifies oxygen atoms inside side chain nodes.

Additionally, NSL supports proximity-based queries like beyond 5A of, as well as advanced operations for topology and attribute filtering.

Conclusion

Mastering NSL in SAMSON can dramatically enhance your efficiency and precision when working with molecular structures. By starting with simple commands and experimenting with logical and proximity operators, you’ll quickly discover how powerful NSL is in simplifying your workflow.

To dive deeper into NSL and explore its advanced features, visit the official documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON today at SAMSON Connect.

Comments are closed.