Quickly Find and Tweak Render Presets in SAMSON with NSL

When working on molecular models in SAMSON, visuals aren’t just eye-candy — they’re essential. Whether you’re preparing a publication-quality figure or inspecting systems with dozens of different representations, being able to quickly select and adjust render presets can save a lot of time.

If you’ve ever found yourself manually clicking through dozens of visual style nodes to find a specific one or figure out which ones are currently active, you’re not alone. This is a common bottleneck, especially in large systems. Luckily, SAMSON’s Node Specification Language (NSL) provides a powerful way to query and manipulate nodes — including render presets — with ease.

What Are Render Presets in SAMSON?

Render presets in SAMSON are visual style definitions assigned to parts of your molecular system. These could be anything from cartoon styles for proteins, van der Waals views, ball-and-stick, or custom coloring schemes. Under the hood, each of these happens through a special node type: a render preset node.

With NSL, these nodes can be queried using the attribute space renderPreset (short name: rp), letting you search, filter, and select them according to various criteria.

Why You Should Use NSL to Manage Render Presets

Here are a few tasks made easier through NSL queries:

  • Find all active render presets: Use rp.selected to list all currently selected render presets.
  • Locate by name: Want to find a preset with a specific name (or pattern)? Try rp.n "Cartoon*" or rp.n "MyCustomStyle".
  • Select render presets that aren’t flagged: Use not rp.sf to find presets that aren’t flagged for selection.

An Example Table of Common Queries

What You Want To Do NSL Query
Find render presets named “LipidStyle” rp.n "LipidStyle"
Select only render presets with names starting with “A” rp.n "A*"
Check which presets are currently selected rp.selected
Exclude presets that are flagged not rp.sf

Tips for Effective Usage

  • Short names can speed up typing: use n for name and sf for selectionFlag. For example: rp.n "B*" and not rp.sf.
  • The attribute selected applies to visual selections in the viewport, while selectionFlag is useful for scripted selection-based actions.
  • Combine queries using logical operators such as and, or, and not.

When and Why This Matters

Imagine a system where you applied multiple render styles to distinguish between domains in a protein, or between ligands and solvent. Without NSL, managing those render presets can mean laboriously clicking through the Document view. With NSL, a single-line query lets you instantly select, hide, isolate, or edit exactly what you want — more time modeling, less time clicking.

This can also be crucial in collaborative environments, where consistent styling conventions are key to maintaining readability across different datasets and projects.

Curious to dive deeper? Explore the full documentation on Render Preset attributes.

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

Comments are closed.