Easily Select Visual Representations in SAMSON Using NSL

A common task in molecular modeling involves managing the many visual representations of structures—especially when the scene includes numerous models like ball-and-stick, ribbon, or surface renderings. Being able to quickly isolate, hide, or modify these visual elements is essential for clear data interpretation and efficient workflow. But finding the right subset of models can be time-consuming without the right tools.

This is where SAMSON’s Node Specification Language (NSL) becomes particularly useful. NSL allows you to define and locate parts of your molecular scene using concise expressions. In this post, we’ll focus on selecting visual model categories with NSL—something especially handy when dealing with large or complex models.

Why Visual Models Matter

Visual model nodes in SAMSON represent how a molecular system is rendered. These don’t change the underlying data, but affect how we perceive the system. Representations like ribbons help understand secondary structures, while surfaces like van der Waals models help explore molecular interactions.

Instead of manually finding these models in the data graph, we can easily query them using NSL. The attribute node.category or its short version n.c enables us to do this efficiently.

Available Visual Model Categories

  • ballAndStick (bas)
  • licorice (lic)
  • vanDerWaals (vdw)
  • cartoon (car)
  • ribbon (rib)
  • tube (tub)
  • gaussianSurface (gau)
  • solventAccessibleSurface (sas)
  • solventExcludedSurface (ses)
  • surface (sur)

Quickly Selecting Visual Models

You can use a simple NSL query to select all models of a given type:

This selects all van der Waals models.

Want to select multiple types? Just list them separated by commas:

This matches both licorice and ribbon visual models.

Use Cases

  • Isolate for export: Only export ribbon models for publication.
  • Simplify complex scenes: Temporarily hide all surface models using not n.c sur.
  • Apply materials: Select just one type of model—say, n.c gau—and apply a new rendering style.

Final Tips

These expressions can be combined with other node attributes if needed. For example, only visible ribbon models:

Using NSL, you can manage your visual scene more effectively and improve how you present your modeling results.

To learn more about node attributes supported by NSL in SAMSON, visit the full documentation here.

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

Comments are closed.