Working with Render Presets in SAMSON to Manage Molecular Visual Styles

Controlling how molecular models are shown can greatly impact both understanding and communication of structural details. Whether you’re preparing figures for publications, adjusting scenes for presentations, or simply organizing complex systems, render presets in SAMSON offer a helpful way to manage visual styles in an efficient and reproducible manner.

In SAMSON, a renderPreset node defines how an object is displayed. But what if you want to select or filter only certain visual styles? That’s where the Node Specification Language (NSL) comes in, and this blog post covers a small but impactful subset of it: render preset attributes.

Why this matters

As molecular models grow in size and complexity, distinguishing between different components by visual style becomes essential. Whether you’re comparing ligand conformations or differentiating protein subunits, being able to quickly filter, select, or manage render presets programmatically saves time and avoids repetitive manual work.

Specifying Visual Styles with NSL

In NSL, render preset attributes are accessed using the attribute space renderPreset (short name: rp). This allows you to filter render presets using logical expressions, much like how you’d query a dataset.

Here’s an overview of the supported attributes for render presets and what you can do with them:

Attribute name Short name Possible values Examples
name n strings in quotes rp.n "A"
rp.n "L*"
selected true, false rp.selected
not rp.selected
selectionFlag sf true, false rp.sf false
rp.sf

Practical Examples

  • Find all render presets named “A”:
    rp.n "A"
  • Select render presets with names starting with “L”:
    rp.n "L*"
  • Check which render presets are currently selected:
    rp.selected
  • Exclude selected render presets:
    not rp.selected
  • Filter presets with selectionFlag set to true:
    rp.sf

What is selectionFlag?

The selectionFlag is helpful for more nuanced tracking of state. While selected refers to items currently selected in the interface, selectionFlag lets you track persistent selection states that can be useful when scripting workflows or when combining multiple filters.

Streamline Your Workflow

By integrating queries of render presets into your routine, you can streamline how you access, filter, and manipulate visualization parameters during molecular modeling or when preparing results. This technique is especially useful in multi-model environments or when switching between visualization styles is common.

To summarize, the render preset attribute space in NSL is a small and specific feature—yet it helps solve the very common problem of managing the complexity of molecular visualization setups. It’s worth experimenting with in your next SAMSON project.

To learn more about using render preset attributes in NSL, visit the full documentation: https://documentation.samson-connect.net/users/latest/nsl/renderPreset/

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

Comments are closed.