Understanding Molecule Visibility and Selection in SAMSON.

Molecular modelers often face challenges when working with large datasets and complex molecular systems. One key challenge is efficiently managing and focusing on the relevant molecules in a project. SAMSON’s Node Specification Language (NSL) provides tools to help users filter molecules based on specific visibility and selection attributes. In this blog post, we’ll explore some of these inherited attributes, such as hidden, visibilityFlag, visible, and selected, which make molecule management significantly easier within SAMSON.

The Basics of Visibility Attributes

SAMSON provides a hierarchy of attributes that enable you to focus on what matters most in your molecular system. Let’s go over some visibility-related attributes, inherited from the node attribute space:

  • hidden (h): This matches nodes that are currently hidden in the visual representation. For example, the expression mol.h will match hidden molecules, while not mol.h will match visible ones.
  • visibilityFlag (vf): This property checks whether the visibility flag of a molecule is set. For instance, mol.vf true ensures that the molecule’s visibility is flagged as on.
  • visible (v): This matches explicitly visible objects. For example, molecules that are visible can be retrieved using mol.v, while hidden ones can be filtered with not mol.v.

By using these attributes, you can programmatically control the visualization of molecules in SAMSON. This is particularly useful when dealing with cluttered scenes or when iteratively refining a model.

Selection Attributes to Identify Active Regions

In addition to visibility, selection attributes inherited from the node space allow you to interact with specific regions or nodes in your model:

  • selected: The molecule.selected attribute applies to molecules that are actively selected by the user. For instance, mol.selected filters selected molecules, and not mol.selected filters unselected ones.
  • selectionFlag (sf): This attribute allows for more automated selection handling. For example, you can use expressions like mol.sf false to work with molecules that are not flagged for selection.

By combining visibility and selection attributes, you can create sophisticated queries within SAMSON to identify, hide, or analyze specific molecular nodes. These attributes are especially helpful for streamlining workflows, organizing data, and preparing export-ready visualizations.

Examples to Put Into Practice

Once you know how to utilize these attributes, you can easily filter and manage molecular datasets:

  • Identify hidden molecules with: mol.h
  • Ensure only visible molecules: not mol.h and mol.vf
  • Filter selected regions for analysis: mol.selected
  • Exclude flagged selections with advanced queries: not mol.sf

Effortless Management in Large Molecular Systems

These visibility and selection attributes make it straightforward to manage complex systems effectively. By simplifying how you focus on relevant molecular nodes, SAMSON enables more efficient workflows for scientists and modelers. Whether you’re designing a material, docking a protein, or optimizing a drug, attributes like hidden, selected, and visibilityFlag ensure you can efficiently manage and manipulate your structural data.

Interested to see these in action? Explore SAMSON’s full documentation at SAMSON Molecule Attributes.

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

Comments are closed.