For molecular modelers working with SAMSON, understanding the Node Specification Language (NSL) is a critical step toward efficient molecular design and data analysis. One powerful aspect of NSL is its comprehensive handling of node attributes. These attributes allow for detailed specification of nodes, enabling precise queries and streamlined workflows.
Why Node Attributes Matter
When dealing with complex molecular models, the ability to filter, categorize, and manipulate data effectively can save significant time and effort. Node attributes in SAMSON are properties or predefined characteristics associated with nodes in the data graph, such as atoms, bonds, residues, or visual models. By leveraging node attributes, you can perform tasks like isolating atoms in ligands, finding hidden nodes, or matching specific categories like glycans or ions.
Key Node Attributes and Their Uses
Here’s a quick look at some essential node attributes available in SAMSON:
- Visibility: The
visibleattribute (n.v) selects nodes whose visibility flag istrue, along with their visible ancestors. For example,n.vmatches all visible nodes. - Category: The
categoryattribute (n.c) helps classify nodes by their structural or visual categories. For instance,n.c ligmatches ligands, whilen.c glymatches glycans. - Selected Nodes: The
selectedattribute (n.s) identifies nodes that are currently selected. This is particularly useful for operations that depend on current user selections. - Material Properties: The
hasMaterial(n.hm) andownsMaterial(n.om) attributes categorize nodes based on whether they have or own a material, enabling material-based queries. - Name Matching: The
nameattribute (n.n) allows for string-based matching, even supporting wildcard characters, e.g.,n.n "L*"matches nodes with names starting with “L”.
Example in Action: Working with Ligands
Suppose you want to isolate all ligands in a molecular system. Using the category attribute for ligands can streamline this task:
node.category ligand (short version: n.c lig)
This query would match all ligands. To go further and, for example, find nitrogens in ligands, the following query would work:
atom.symbol N in node.category ligand (short version: a.s N in n.c lig)
Such precise targeting is invaluable for tasks like ligand-binding studies or optimizing specific molecular components.
Linking Categories: Visual Models
Node attributes also extend to visual models, enabling modelers to select and customize representations efficiently. For example:
node.category vanDerWaals(short version:n.c vdw) matches van der Waals visual models.node.category ballAndStick(short version:n.c bas) filters ball-and-stick visual models.
Combining categories, such as node.category licorice, ribbon (or n.c lic, rib), allows for advanced selection of multiple visual representation styles.
Conclusion
Understanding and effectively using node attributes in SAMSON can lead to more efficient workflows, enabling modelers to harness the full power of their molecular systems. Take your time to explore attributes such as visibilityFlag, selectionFlag, and type, and apply them creatively for your projects.
To dive deeper into the available node attributes and see additional examples, visit the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at samson-connect.net.
