Spotting the Right Render Preset in SAMSON Using NSL

When working with complex molecular models, keeping track of how elements are displayed can become challenging. Whether highlighting active sites, customizing visual styles for presentations, or debugging display issues, efficiently selecting and manipulating render presets is key to productivity when using SAMSON.

SAMSON’s Node Specification Language (NSL) offers a powerful way to control selections in your molecular models. A particularly useful NSL feature is the ability to work with Render Preset nodes—the elements that define how molecules and their components appear on screen.

Why You Might Care About Render Presets

Render presets are used to control how atoms, residues, molecules, or any part of a system are visually depicted in SAMSON: as spheres, sticks, surfaces, ribbons, or any custom render style. But when multiple presets stack up in complex scenes, managing them manually becomes tedious.

Let’s say you’re working on a multi-chain protein and want to find the preset that colors one specific ligand in green. If there are many rendering rules applied, clicking through each one can become frustrating. This is where using NSL to query render preset attributes provides a huge time-saver.

Introducing the renderPreset Attribute Space

In NSL, render presets live in their own attribute space: renderPreset or simply rp. This allows you to write concise expressions to filter and identify just the nodes you’re interested in.

Specifying Preset by Name

The name attribute (short name: n) helps you search by name. For example:

This selects render presets named exactly “SurfaceView” or those whose names start with “Lig”.

Working with Selection State

You can also query based on whether a preset is currently selected, using the selected attribute:

This is useful when refining a project that contains many display settings and you want to isolate or delete unused ones.

Using Selection Flags

The selectionFlag (short name: sf) is a more technical but powerful filter. For example:

This finds render presets that do not use selection flags—helpful to optimize how renderings are applied dynamically.

Putting It All Together

Need to find and isolate all render presets related to ligands that are currently selected?

This type of filtering lowers the chance of user error and lets you focus on your visual adjustments with minimal distraction.

As projects grow in complexity, these expressions help molecular modelers maintain control over presentation and clarity, especially ahead of publication or when sharing work with colleagues.

To learn more about renderPreset attributes and other capabilities of the Node Specification Language, visit the official documentation page at https://documentation.samson-connect.net/users/latest/nsl/renderPreset/.

SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON here.

Comments are closed.