Find the right note without losing track of visibility

Notes can be useful landmarks in a molecular model, but they can also become easy to overlook when a project contains many of them. A note may be hidden, not visible, or simply hard to identify by name. When you need to narrow your attention to note nodes, SAMSON’s Node Specification Language (NSL) provides a small set of attributes for describing them.

The key is to use the note attribute space, whose short name is nt. It matches note nodes. That prefix makes your intent clear: rather than referring to a general node attribute in the abstract, you are checking that attribute for notes. For example, nt.h refers to the hidden attribute of a note.

Start with the question you need to answer

When a note seems to have disappeared, check its visibility-related attributes. The documented expressions include nt.h and not nt.h for hidden status, and nt.v and not nt.v for visible status. These give you a direct way to express either side of the check: notes matching the attribute, or notes that do not match it.

There are also two flag attributes: nt.vf for visibilityFlag and nt.sf for selectionFlag. Both accept true or false; for example, nt.vf false and nt.sf false. The documentation lists these separately from visible and selected, so it is useful to preserve that distinction when writing a specification. If you need to know precisely how a flag behaves in a particular workflow, consult the inherited node attribute reference rather than treating the names as interchangeable.

Use names to narrow the search

If the note’s name is more useful than its display state, use nt.n, the short form of name. Name values are written as quoted strings. The reference gives nt.n "A" and nt.n "L*" as examples. This makes names a practical starting point when you have labelled notes and want to refer to one by its label. Keep the quotation marks around the string, as shown in the examples.

For instance, when you are trying to locate a note labelled A, nt.n "A" expresses a name-based check. If you are investigating notes that may be hidden, nt.h is the relevant check; to express the opposite condition, use not nt.h. The examples are deliberately small: they let you focus on one property at a time and reduce ambiguity while you work.

Remember what is inherited

The note attribute list consists of attributes inherited from the general node attribute space. This includes hidden, name, selected, selectionFlag, visibilityFlag, and visible. Most have short names: h, n, sf, vf, and v. One exception matters when you are writing compact expressions: selected has no short name in the note attribute space. Use nt.selected or not nt.selected, rather than assuming that a short form is available.

A simple troubleshooting habit is to first decide what you are looking for—name, hidden state, visibility, or selection—and then use the matching attribute. That keeps a search expression easy to read and makes it easier to adjust when your first check does not identify the note you expected. The examples here are checks, not a claim that every attribute means the same thing or that one automatically changes another.

For the complete attribute list and links to the inherited node definitions, see the SAMSON note attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.