When managing complex molecular systems, one challenge molecular modelers often face is controlling the visibility of specific components in a data graph. Whether hiding irrelevant parts of a molecular structure or customizing what is shown for presentations, efficient visibility management can significantly simplify workflows.
The visibilityFlag attribute in SAMSON’s Node Specification Language (NSL) is a crucial feature for addressing this challenge. Let’s explore how the visibilityFlag can make your molecular modeling processes smoother and more insightful.
What is the visibilityFlag?
In SAMSON, every node has a visibility flag—a property that determines whether the node and its descendants are visible in the data graph. By using NSL expressions, the visibilityFlag can be leveraged to finely control this property across your system.
For example, the visibilityFlag might be set to true to make a node visible or false to hide it. Using NSL, this attribute allows you to filter and select nodes based on their visibility status.
How does the visibilityFlag improve workflows?
- Focus your view: Temporarily hide less relevant parts of a molecular structure to focus on areas of interest, such as ligands or binding sites.
- Custom visualization for presentations: Selectively show parts of your molecular system to communicate important elements effectively.
- Efficient modeling: Visibility control helps clean up cluttered graphs and streamline navigation through complex molecular datasets.
Using the visibilityFlag in NSL
To query nodes based on their visibility status, the node.visibilityFlag attribute (or its short name n.vf) is used in NSL expressions. Here’s how:
node.visibilityFlag true(short version:n.vf true): Matches all nodes with the visibility flag set to true.node.visibilityFlag false(short version:n.vf false): Matches all nodes where the visibility flag is false.
This simple syntax empowers users to gain precise control over which parts of their molecular data are visible or hidden.
How it differs from node.visible
While the visibilityFlag determines whether the visibility of a single node is enabled or disabled, the node.visible property provides a more refined query mechanism that also considers the visibility of ancestors. This distinction can be particularly useful in hierarchical modeling.
Practical example
Imagine you are working on a molecular graph where you want to selectively visualize atoms in a specific category. With the visibilityFlag, you can write simple expressions to isolate such nodes:
|
1 |
node.visibilityFlag true |
This would ensure that only nodes with a visibility flag set to true are rendered in your view, helping you declutter your workspace.
Learn more about managing visibility
The visibilityFlag is just one of the many powerful attributes available in SAMSON’s Node Specification Language. To explore other attributes and how they can improve your molecular modeling experience, check out the detailed documentation at https://documentation.samson-connect.net/users/latest/nsl/node/.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON and start exploring its features at https://www.samson-connect.net.
