Understanding Presentation Attributes in SAMSON’s NSL

As a molecular modeler, you often need to control the visibility and organization of nodes in your projects. SAMSON’s Node Specification Language (NSL) provides specific tools to address this through its presentation attribute space, focusing on attributes that affect presentation nodes. This blog post explores these useful presentation attributes, helping you manage and interact with nodes effectively.

What Are Presentation Attributes?

Presentation attributes in the NSL belong to the presentation attribute space (short name: pr). They apply exclusively to presentation nodes, offering fine-grained control over node visibility, naming, and selection. These attributes are especially useful when working on visualizing and managing molecular data in complex modeling scenarios.

Key Attributes and How to Use Them

Here’s a quick look at the most relevant attributes under the presentation space:

  • hidden (pr.h): Controls whether a node is hidden or visible. Possible values are true and false. Example: pr.h or not pr.h.
  • name (pr.n): Assigns or queries node names as strings. For example, pr.n "A" finds nodes named “A,” and pr.n "L*" selects nodes whose names start with “L.”
  • selected: Indicates whether a node is selected. This attribute doesn’t have a short name. Example: pr.selected or not pr.selected.
  • selectionFlag (pr.sf): Manages flags related to selection, with values of true or false. Example: pr.sf or pr.sf false.
  • visibilityFlag (pr.vf): Allows you to set flags for visibility. Examples include pr.vf and pr.vf false.
  • visible (pr.v): Marks whether a node is currently visible. Usage examples are pr.v and not pr.v.

Practical Examples

Imagine you’re working on a molecular design project and want to hide all nodes except the ones of interest. Using pr.hidden, you can quickly filter visible nodes without manual intervention, saving time and improving focus. Similarly, you could apply pr.name with a string filter to locate or rename specific nodes within a complex structure.

Where These Attributes Come From

Most of these presentation attributes are inherited from the more general node attribute space. This inheritance ensures consistency across NSL and reinforces how nodes are managed and visualized throughout SAMSON. For example, hidden and visible align with node.hidden and node.visible. However, the selected attribute in the presentation space differs slightly, as it does not use a short name.

Understanding these nuances helps you make the most of SAMSON’s capabilities while tailoring the platform to your specific molecular modeling needs.

Conclusion

The presentation attributes in SAMSON’s Node Specification Language (NSL) are indispensable for efficiently managing visibility, selection, and labels of your nodes. They offer clear, intuitive ways to streamline and enhance your molecular modeling workflows. To dive deeper and explore additional examples or technical details, visit the original documentation page: https://documentation.samson-connect.net/users/latest/nsl/presentation/.

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

Comments are closed.