Selecting Visual Presets in SAMSON: A Quick Guide with the NSL

When working on molecular models in SAMSON, visualization is often more than just aesthetics—it’s essential. Different render presets can highlight atomic structures, interaction networks, or molecular surfaces, which all help communicate scientific insight effectively. But when projects become complex, selecting and managing these render presets efficiently becomes more than a minor inconvenience.

This is where the Node Specification Language (NSL) becomes useful. NSL is SAMSON’s own query language, designed to help users identify and select nodes (like atoms, bonds, groups, and more) based on their attributes.

One particularly handy use case? Selecting render presets based on specific criteria. This capability alone can save time, prevent errors, and ensure your molecular scenes are always easy to interpret. Let’s walk through a couple of key attributes that can help you filter and manage your render presets more effectively.

Accessing Render Preset Attributes

Render preset attributes in NSL live in the renderPreset attribute space, denoted by the short name rp. These attributes allow you to select or exclude certain presets during scripting or search. You can think of them as metadata associated specifically with how a structure should be rendered.

1. name (short: n)

Use this to filter presets based on assigned names. Very useful when your presets follow a naming convention (for example, all ligand-related visuals starting with “L”).

This is handy for batch-processing rendering styles or exporting consistent images across similar molecule types.

2. selected

This boolean attribute allows you to filter based on whether a render preset is currently selected. Although derived from the node space, selected does not have a short name in the renderPreset context.

Combine this with scripts to apply operations only to render presets you are currently working on.

3. selectionFlag (short: sf)

Another boolean flag used to mark presets for further action. For example:

This can be useful for tagging and batch operations, especially when working on collaborative projects involving multiple visualizations.

These attributes might seem simple, but they provide a powerful way to handle large or multi-scale systems where visualization presets vary across hierarchical levels. By using the NSL efficiently, you make sure your workflow remains clean, minimal, and focused—without the visual clutter.

For example, if you’re highlighting ligands across different scenes, a search like:

allows you to instantly locate all ligand rendering presets that haven’t yet been flagged. Pair this with visual scripting in SAMSON and you’ve got a fast, reproducible workflow for managing intricate visual detailing.

Want to dive deeper into all available attributes and examples? You can read more at the official documentation page here: https://documentation.samson-connect.net/users/latest/nsl/renderPreset/

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

Comments are closed.