Controlling Visibility and Selection of Notes in SAMSON

When dealing with complex molecular models, it can be useful to add annotations to guide collaborators, highlight relevant parts of a structure, or track modeling workflows. In SAMSON, these annotations can be represented as note nodes. While note nodes may seem straightforward, controlling their visibility and selection properties programmatically—especially in large models—can save time and reduce errors.

This post introduces a set of simple yet powerful attributes used to manage notes in SAMSON using the Node Specification Language (NSL). Understanding these attributes will help you filter, control, and manipulate note nodes in large molecular documents with greater efficiency.

Why manage note visibility and selection?

In large molecular systems or collaborative environments, notes can accumulate quickly. Some notes may be relevant for interpretation or review, while others may become obsolete or temporarily irrelevant. Having a quick way to hide, show, or select specific notes—or even exclude them from view—can improve navigation, reduce clutter, and support precise structural editing.

The nt attribute space

The nt attribute space represents attributes specific to note nodes. These attributes are inherited from the more general node attribute space, but filtered to work exclusively with notes. For example, nt.v refers to the visibility of a note node, and nt.selected indicates whether a note is selected.

Frequently used attributes

Here are some of the most useful attributes when working with notes in NSL:

  • nt.h (hidden): Determines whether a note is hidden. You can use nt.h to filter hidden notes or not nt.h to find visible ones.
  • nt.v (visible): Specifies if a note is currently visible. Note that a node can be visible even if not selected. Use nt.v and not nt.v.
  • nt.sf (selectionFlag): Indicates whether a note is selectable. Set to false to exclude from interactive selections.
  • nt.selected: True if the note is currently selected. There is no short name for this attribute.
  • nt.vf (visibilityFlag): Similar to nt.v but relates to visibility control programmatically or via UI toggles.
  • nt.n (name): Allows filtering by name. Wildcards are supported, e.g., nt.n "Note*".

Example usage scenarios

Let’s say you want to:

  • Find all visible notes: nt.v
  • Hide all notes with a certain prefix: nt.n "Obsolete*" and nt.v
  • Select all notes that are currently visible and have selectable status: nt.v and nt.sf

These expressions can be particularly helpful when automating tasks or using scripts during modeling sessions or collaborative reviews.

Additional details

All note attributes follow the same boolean or string pattern. Boolean values are true or false, while name matches require quoted strings. Keep in mind that the selected attribute does not have a short form like the others, and must be explicitly written as nt.selected.

By using combinations of these attributes, molecular modelers can create filters to speed up group selections, augment preparation pipelines, or simply organize annotations.

To learn more about note attributes in NSL, 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 download SAMSON at https://www.samson-connect.net.

Comments are closed.