Understanding Property Visibility in SAMSON’s Property Model Attributes

Molecular modelers often deal with complex systems where maintaining clarity is a priority. A major source of frustration can arise when trying to manage visibility and selection states for specific nodes in a structure. Thankfully, SAMSON’s Property Model Attributes include powerful tools to handle attributes like visible, hidden, and associated flags. This blog post explores these attributes and their practical applications.

Why Visibility Management Matters

When modeling molecular systems, hiding or filtering out elements allows researchers to focus on the parts of the system that truly matter. For example, you might want to isolate a specific chain in a protein or visualized materials without distraction. That’s why SAMSON provides a set of attributes under the propertyModel space, allowing precise control over visibility of molecular nodes. Let’s take a closer look at key attributes related to visibility.

The visible Attribute

The visible attribute indicates whether a node is currently visible in the scene. This can be easily utilized in NSL queries to include or exclude certain nodes. It supports boolean values (true, false):

Examples:

  • pm.v: Selects nodes that are visible.
  • not pm.v: Selects nodes that are not visible.

The hidden Attribute

The hidden attribute, effectively an inversion of visible, indicates whether the node is hidden. Here’s how you can query it:

  • pm.h: Selects nodes that are hidden.
  • not pm.h: Selects nodes that are not hidden (i.e., visible).

It’s worth noting that hidden and visible provide complementary perspectives, but their usage depends on how you construct queries to best suit your workflow.

Using Flags for Advanced Control

For finer control, attributes like visibilityFlag (vf) offer options to toggle or work with visibility states programmatically. For example:

  • pm.vf false: Match nodes where the visibility flag is set to false.
  • pm.vf: Match nodes with the visibility flag set to true.

These flags are especially useful in automated workflows or when combining multiple layers of conditions in a query.

Practical Examples

Imagine a scenario where you need to isolate nodes that are both visible and not hidden. Here’s how you could combine these attributes:

  • pm.v and not pm.h: Selects nodes that are visible and not hidden.

Alternatively, if you’re troubleshooting, and need to identify nodes incorrectly set as hidden but visible at the same time (perhaps due to conflicting parameters), you could use:

  • pm.v and pm.h

Conclusion

Managing node visibility in SAMSON’s molecular modeling toolkit is a key skill for efficient workflows. By leveraging attributes like visible, hidden, and visibilityFlag, you can work more effectively and focus on the molecular components most relevant to your project. To deepen your understanding of these attributes and explore their broader applications, visit the official documentation page.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.