Filtering Molecular Structures with NSL in SAMSON’s Document View

Molecular modelers frequently need to isolate specific parts of a model — certain residues, atom types, or functional groups — to perform detailed analysis or apply targeted operations. Doing this manually, especially with large molecules or complex systems, is both time-consuming and error-prone.

SAMSON’s Document view offers a powerful way to streamline this task using the Node Specification Language (NSL). With NSL, you can precisely filter and select molecular components based on their attributes, relationships, or names — all within a single, expressive line of text.

Why use NSL in the Document View?

While SAMSON provides graphical interfaces to visualize molecular structures, the real power lies in leveraging NSL to quickly pinpoint relevant nodes. This is particularly useful when working with complex biomolecules where structural elements may be deeply nested.

The Document view lets you enter NSL expressions into the filter bar. These expressions dynamically limit what is shown in the document’s hierarchy tree — and you can then press Enter to select the filtered nodes right away, without navigating manually.

Common Use Case: Selecting Structural Groups

As an example, suppose you’re studying protein structure and want to quickly filter to see only structural groups, which can include side chains, backbones, or other molecular fragments. You can enter this NSL expression in the filter bar:

This is a shorthand for node.type structuralGroup. Once filtered, just hit Enter to select all visible nodes.

Filter and select nodes from the document view

Why It Helps

  • Visual Focus: Hide irrelevant parts of the molecular hierarchy, making it easier to focus and work efficiently.
  • Speed: Instantly select complex sets of nodes without manual clicking.
  • Reproducibility: Use the same NSL expression across projects or share with collaborators.

Pro Tips

  • Use n.t bb to filter backbone elements, or a.s C to filter carbon atoms.
  • If you’re unsure about NSL syntax, click on the Ask AI button next to the filter bar. The AI Assistant can generate NSL queries tailored to your structure.

Filtering with NSL in SAMSON’s Document view is a simple but effective way to navigate large models efficiently and precisely.

To learn more about NSL and explore additional examples, visit the Node Specification Language documentation.

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

Comments are closed.