Molecular modelers often face significant challenges when querying, categorizing, and visualizing elements in their molecular designs. Understanding and efficiently utilizing the concept of node attributes in SAMSON’s Node Specification Language (NSL) can help overcome these issues. This blog post offers a comprehensive overview of NSL’s node attributes, their potential values, and practical applications.
What Are Node Attributes?
In SAMSON, node attributes represent the properties or states of nodes within the data graph. These attributes allow for performing various actions, such as filtering or selecting nodes, based on properties like visibility, selection, type, and categories.
For instance, using NSL expressions, you can filter nodes with specific characteristics, regardless of whether they represent atoms, bonds, or other node types. This capability proves invaluable in managing large molecular systems.
Core Attributes and How to Use Them
Some commonly used node attributes in NSL include:
- Category (short name:
c): Used to match nodes based on groupings like structure categories (e.g., ligand, lipid) or visual model categories (e.g., ball-and-stick, ribbon). For example,n.c ligmatches ligands. - Selected (short name:
s): Allows you to work with selected nodes, using expressions liken.sto identify or filter nodes currently selected in the data graph. - Type (short name:
t): Helps identify nodes by their type, such as atoms, bonds, or molecules. For example, you can usen.t ato match all atoms orn.t a, bto match both atoms and bonds. - Visibility (short name:
v): Indicates whether nodes are currently visible, using expressions liken.vto select visible nodes.
With these attributes, complex queries become streamlined. For example, n.t a in n.c lig retrieves all atoms within ligands, while a.s O in n.c wat identifies oxygen atoms within water structures.
Categories Explained
Among node attributes, categories deserve special attention. Categories group nodes into structural or visual model classifications. Examples include:
- Ligands matched by
n.c lig, enabling molecular modelers to isolate specific ligands in their models. - Glycans, represented by the short name
gly, matched usingn.c gly.
On the visual side, selecting specific visual representations becomes easy with keywords like n.c bas for ball-and-stick models or n.c lic for licorice visualizations.
Tips for Practical Use
Here are some guidelines to get the most out of NSL and node attributes:
- Combine Short Names: Use short name abbreviations for queries. For instance, instead of
node.category ligand, writen.c ligto save time. - Wildcard Matching: When using the
nameattribute, wildcard patterns can identify nodes by partial names. For example,n.n "L*"matches all nodes whose names start with “L”. - Experiment with Filtering: Use combinations like
not n.hto filter out hidden nodes orn.vto focus solely on visible elements.
Conclusion
Delving into SAMSON’s NSL node attributes unlocks powerful new ways to query and interact with your molecular models. Whether you’re identifying specific molecular structures, visual representations, or states, these tools enhance flexibility and control over molecular system design workflows.
To learn more, visit the full documentation page at https://documentation.samson-connect.net/users/latest/nsl/node/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON for free at https://www.samson-connect.net.
