When a molecular scene looks wrong: inspect presentation state one flag at a time

A crowded molecular scene can be hard to diagnose. A presentation may seem to have disappeared, remain visible when you expected it to be hidden, or appear selected when you are trying to inspect something else. Before changing the model or rebuilding a view, it helps to ask a smaller question: which presentation nodes match the state I’m looking for?

In SAMSON, the Node Specification Language (NSL) provides a presentation attribute space for matching presentation nodes. Its short name is pr. The attributes listed on the reference page are inherited from the general node attribute space, so you can check common properties such as visibility, selection, and name using the presentation prefix.

Start with the visible state

To match presentations whose visible attribute is true, use:

To match presentations whose visible attribute is false, use:

The full attribute name is visible; v is its short name. These expressions give you a direct way to separate presentations according to the documented visible value, rather than relying only on what is easy to spot in a busy view.

Don’t treat every visibility-related attribute as the same thing

The reference also lists hidden (h) and visibilityFlag (vf). They are distinct attributes, each with true and false values. You can query them independently:

  • pr.h or not pr.h for hidden.
  • pr.vf or pr.vf false for visibilityFlag.
  • pr.v or not pr.v for visible.

A useful troubleshooting habit is to check the attribute named by your question instead of assuming that “hidden,” “visible,” and a visibility flag are interchangeable labels. The documentation lists them separately; it does not define them as synonyms. If you are investigating an unexpected display state, testing these properties separately can help narrow down what you need to inspect.

Separate selection from selection flags

Selection has a similar pair of attributes. selected can be queried with pr.selected or not pr.selected. The inherited attribute selectionFlag has the short name sf, so its examples include pr.sf and pr.sf false. The page specifically notes that selected does not have the short name s in the presentation attribute space.

When selection looks confusing, keep those names distinct. For example, begin by checking pr.selected; if your question concerns the selection flag itself, inspect pr.sf separately. That keeps a visual-selection investigation from turning into guesswork about which property you queried.

Use names to narrow your inspection

Presentation nodes also inherit name, with n as its short name. The reference gives pr.n "A" and pr.n "L*" as examples. If you know a presentation’s name, a name-based query can help you focus your inspection on that target instead of scanning the entire scene. The quoted strings are part of the documented syntax; consult the NSL reference for the full rules governing expressions.

A practical sequence is: identify the kind of presentation state you want to inspect, query that attribute on the pr space, and then check related attributes separately if the result does not explain what you see. This small discipline is especially useful when visibility and selection issues overlap in a dense molecular view.

For the complete attribute list and examples, see the SAMSON presentation attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at samson-connect.net.

Comments are closed.