Making your molecular models clearer with visibility flags

In molecular modeling, clarity is essential. When working with complex assemblies, it’s easy for molecular scenes to become visually overwhelming. SAMSON’s Node Specification Language (NSL) provides a simple way to control the visibility of elements using note attributes. This is particularly helpful for modelers who need to focus on annotations or reduce visual clutter without deleting important data.

Let’s look at how the note attributes in SAMSON can help you efficiently manage and manipulate note nodes in your scene — especially their visibility. The note attribute space, accessed via the short name nt, includes several useful attributes like visible, hidden, visibilityFlag, and more.

Understanding visibility controls for notes

The most relevant note attributes to control the visibility of your annotations and notes in a SAMSON document are:

  • nt.v: This corresponds to the visible attribute. Set it to true to make note nodes visible and false to hide them.
  • nt.h: The hidden attribute. Similarly, this can be used to hide notes when set to true. Keep in mind that this is equivalent in effect to setting nt.v to false.
  • nt.vf: The visibility flag. While similar to visible, using flags can provide more flexible programmatic control in scripts.

For example, if you want to hide all notes in your scene temporarily, you could use:

Or if you’d like to select all visible note nodes to apply batch styling:

When and why to use these attributes

If you annotate parts of your molecular model with notes—such as labeling active sites, mutations, or structural elements—these notes can add value. But during presentations or simulations, these annotations might obstruct the geometry. In such cases, toggling visibility using note attributes saves time and preserves your workflow.

Furthermore, using nt.n filters lets you selectively show or hide notes with matching names. Let’s say you want to only display note nodes whose names begin with “L”:

This flexibility allows you to keep your visualizations clean and focused on the exact subset you’re interested in at each moment.

Combining attributes for powerful queries

Another strength of SAMSON’s NSL system is its support for combining attributes. Suppose you’re working with a large biomolecular structure and want to find all annotations that are currently visible and unselected. You could use:

This can be particularly helpful in scripting quality control or preparing figures for publication or presentations.

You can also use these attributes to drive automated behavior in custom SAMSON Extensions or workflows involving selection filters.

Conclusion

Managing annotations efficiently is key to understanding and communicating molecular structures. The note attributes in SAMSON, especially those related to visibility, offer a straightforward way to gain better control over your molecular scenes without losing information.

To dive deeper into all note attributes and example usages, visit the official documentation: https://documentation.samson-connect.net/users/latest/nsl/note/

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

Comments are closed.