Understanding Node Visibility in SAMSON’s Node Specification Language

When working on complex molecular models in SAMSON, keeping track of node visibility is important for clarity and efficiency. Whether you’re visualizing specific regions of a molecular structure or navigating a large data graph, the node.visibilityFlag and node.visible attributes in the Node Specification Language (NSL) provide powerful tools to manage visibility.

Why Node Visibility Matters

In molecular modeling, you may need to focus on a subset of your data while filtering out irrelevant elements. This can become challenging when dealing with extensive hierarchical graphs. Properly managing visibility ensures smoother workflows and better resource allocation. Imagine selectively visualizing ligands, suppressing solvent molecules, or quickly toggling between parts of a protein—visibility controls make this intuitive.

Decoding Node Visibility in NSL

SAMSON uses the concepts of visibility flag and effective visibility to define how nodes are displayed:

  • The node.visibilityFlag attribute: This attribute tracks the visibility status of a specific node. It directly corresponds to whether a node is flagged visible (true) or not (false).
  • The node.visible attribute: Unlike node.visibilityFlag, this accounts for the node’s visibility in the overall hierarchy. A node is considered visible only if its node.visibilityFlag is true and all its ancestors are also visible.

Using Visibility Attributes in NSL

The following examples demonstrate how to work with visibility attributes:

  • To find nodes with their visibilityFlag set to true, use:
  • To select all visible nodes, including checking ancestor visibility in the hierarchy, use:
  • To isolate hidden nodes within your graph, use:

These expressions give you flexible control to precisely tailor the visibility of nodes in your SAMSON project.

Practical Applications

Here are a few scenarios where visibility attributes prove indispensable:

  1. Focus on relevant data: Quickly select visible atoms or residues to manipulate them while hiding less relevant structures like solvent molecules.
  2. Debugging molecular hierarchies: Verify why certain elements are hidden due to the visibility properties of ancestor nodes.
  3. Data presentation: Create clear visual outputs by toggling visibility flags for specific parts of a structure, ensuring your diagrams are easy to interpret.

Learn More

The topic of node visibility is just one of many tools provided by SAMSON’s NSL. To explore these attributes in more detail, visit the official documentation.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.

Comments are closed.