Molecular modelers often face challenges in efficiently visualizing and managing the myriad details associated with molecular structures. Optimizing this visualization can dramatically improve workflows, and SAMSON’s Node Specification Language (NSL) offers the tools to make this possible. Specifically, presentation attributes provide a powerful way to control and customize the visibility and selection of nodes in a molecular project. Let’s explore how to use these presentation attributes effectively.
What are Presentation Attributes?
In SAMSON, presentation attributes are part of the presentation attribute space (shortened as pr). These attributes are tailored for defining and controlling the properties of presentation nodes. They allow users to target specific visualization elements with conditions to enhance clarity and usability. Whether it’s hiding, naming, selecting, or flagging nodes, the pr namespace streamlines visualization tasks.
Key Attributes and How to Use Them
Here are some of the key presentation attributes and what they do:
- hidden (
pr.h): Controls whether a node is hidden or visible. Its values can betrueorfalse. Example:pr.h– Selects nodes that are hidden.not pr.h– Selects nodes that are visible.
- name (
pr.n): Matches nodes by their name. The name should be provided as a string in quotes. Example:pr.n "A"– Matches nodes named “A”.pr.n "L*"– Matches nodes whose names start with the letter “L”.
- selected (
pr.selected): Indicates whether a node is currently selected. It acceptstrueorfalse. Example:pr.selected– Matches selected nodes.not pr.selected– Matches unselected nodes.
- selectionFlag (
pr.sf): Acts as a flag for selection. Its values can also betrueorfalse. Example:pr.sf false– Matches nodes where the selection flag is “off”.pr.sf– Matches nodes with the selection flag “on”.
- visibilityFlag (
pr.vf): Similar tohidden, it determines a node’s visibility flag. Values can betrueorfalse. Example:pr.vf false– Matches nodes with the visibility flag disabled.pr.vf– Matches nodes with the visibility flag enabled.
- visible (
pr.v): Indicates whether a node is visible. It’s set totrueorfalse. Example:pr.v– Matches nodes that are visible.not pr.v– Matches nodes that are not visible.
Why These Attributes Matter
Visualization is a critical part of molecular modeling. With these attributes, users can quickly filter, group, and modify elements in their molecular projects for improved focus and efficiency. For example, highlighting only the selected nodes in a complex biological system can simplify analysis and speed up decision-making processes.
Enhanced Flexibility for Molecular Projects
By leveraging the short names such as h, n, sf, and vf, SAMSON ensures that users have flexible, high-performance tools at their fingertips. These shorthands make it easy to define concise conditions and integrate them into NSL-based workflows for molecular visualization and design.
For detailed technical information about these attributes, visit the documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at SAMSON Connect.
