Making Sense of Selections: Easier Render Preset Filtering in SAMSON

When working with complex molecular systems in SAMSON, clarity is key. Many molecular modelers often find themselves overwhelmed by the sheer number of rendering options available, especially when trying to extract or visualize only the parts that matter. If you’ve ever tried to highlight or customize visuals for specific display presets but found yourself clicking endlessly through the GUI, here’s something you should know: Render preset attributes in the Node Specification Language (NSL) might be a faster path.

Render presets define how different parts of your molecular model are displayed, using visual styles like ball-and-stick, surface, cartoon, or van der Waals representations. But imagine you’ve set up numerous presets and now want to filter them quickly — for instance, only keep those that show a selection, or those you previously hid. Instead of checking each one manually, you can use attribute queries through NSL’s renderPreset space, with the shorthand rp.

Three Simple Attributes You Should Know

The renderPreset attribute space gives you access to three key fields that help you refine your selection:

  • name (short: n): This allows you to select render presets based on their names. Very helpful if you’ve adopted naming conventions. Example:
    rp.n "Cartoon*" finds all presets whose names start with “Cartoon”.
  • selected: This is a logical filter — true if the preset is currently selected. You can negate it with not. Example:
    not rp.selected returns all render presets that aren’t selected.
  • selectionFlag (short: sf): This is slightly different from selected. It’s a property you can assign to flag presets for some custom selection logic. For example:
    rp.sf true finds all presets that have this flag turned on.

The power of this system lies in flexible filtering. You can combine attributes to narrow the list even further. For example:

This selects all surface-related presets that are not flagged — maybe because you’re planning to remove unflagged ones.

Who Benefits Most?

If you routinely switch between different visualization presets — say, turning on cartoon representations for proteins and surfaces for ligands — using these filters lets you build rule-based selections. This is incredibly helpful in modeling pipelines, especially when visual consistency matters across snapshots or simulations.

Limitations to Be Aware Of

The selected attribute doesn’t have a short name in this context (unlike in node filtering where s would work). So you’ll need to type it in full as rp.selected or not rp.selected.

Ready to Explore?

This is just a small part of what NSL can do with render presets, inherited from the broader node space. It offers a systematic approach to model visualization that can save time, reduce mistakes, and scale cleanly across large systems.

To learn more about available attributes and how to use them efficiently, explore 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. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.