Mastering Node Attributes in SAMSON’s Node Specification Language

Molecular modelers often need precise control over their data graphs when working with large and complex molecular systems. The Node Specification Language (NSL) in SAMSON provides an intuitive way to handle this complexity via node attributes. In this post, we delve into the definition and practical use of NSL node attributes, offering molecular modelers a useful guide for streamlining searches and optimizations in their workflows.

What are Node Attributes?

In SAMSON, node attributes are properties or characteristics associated with individual nodes in a data graph. These attributes define a node’s behavior, visibility, lock status, selection state, and more. These attributes make it easy to filter or group nodes that meet specified criteria.

A notable example is the selectionFlag, which identifies whether a node (regardless of its type—such as atom, bond, etc.) is selected. An NSL query like node.selectionFlag true (or its short version: n.sf true) matches all selected nodes. This power of defining behavior is invaluable for tasks like model refinement, visualization, and targeted operations.

Available Node Attributes

Here are some key node attributes in NSL and how they can simplify your work:

  • category (n.c): Defines structure or visual model categories (e.g., ligands, glycans, ribbons, etc.).
  • hasMaterial (n.hm): Checks whether a node has inherited or owns a material.
  • hidden (n.h): Identifies hidden nodes, even if hidden by ancestor nodes.
  • locked (n.l): Matches nodes that are locked in interactions or display.
  • name (n.n): Enables filtering based on names with wildcards (e.g., "L*").
  • selected (n.s): Finds nodes explicitly selected by the user.

Practical Examples

Below are a few representative NSL queries and their real-world applications:

  • n.l: Matches all nodes that are locked.
  • n.c lig: Selects all ligand-related nodes in your molecular system.
  • n.n "A": Filters nodes with the exact name “A”.
  • n.hm and not n.s: Finds nodes that have materials but are not selected.
  • n.c lip, gly: Filters for categories “lipids” and “glycans” together.

These queries can help speed up workflows, whether for visualization or running simulations on specific subsets of a molecular assembly.

Integrating Node Attributes into Daily Work

The modularity provided by NSL’s attributes ensures that molecular modelers can analyze complex molecular structures and turn their datasets into actionable insights. It allows users to:

  • Easily identify regions of interest (e.g., binding sites, ligands).
  • Control the appearance of their model by defining visibility and material properties.
  • Focus computational resources on specific molecular components.

Learn More

Mastering node attributes in NSL can significantly contribute to efficient workflows, precise data analysis, and error reduction. For a more in-depth look at the available attributes, including examples and explanations for each, visit the official NSL documentation page.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download it from SAMSON’s official website.

Comments are closed.