Quickly Find Molecules in Complex Models Using Visibility Attributes

When working with large and complex molecular models, it’s easy to lose track of specific molecules, especially in visualizations involving hundreds of chains, atoms, or residues. A common challenge molecular modelers face is quickly identifying which molecules are visible—and filtering those that aren’t—without needing to sift through the model manually.

If you’re using SAMSON, the integrative molecular design platform, there’s a straightforward way to approach this using the visible, visibilityFlag, and hidden attributes in the molecule attribute space within the Node Specification Language (NSL). Understanding and using these can save significant time and reduce visual clutter while working on models.

Clarifying the Differences

Let’s break down three attributes related to visibility:

  • visible (short name: v): Tells you whether a molecule is currently visible in the workspace. For example, mol.v matches visible molecules, while not mol.v matches those that are hidden.
  • visibilityFlag (short name: vf): Represents an internal visibility flag that can be used, for instance, to apply hiding rules programmatically. You might use mol.vf false to find molecules intentionally hidden via visualization rules.
  • hidden (short name: h): This is a derived attribute indicating whether a molecule is hidden—effectively another way to check visibility, but connected to the SAMSON internal node system.

Practical Use Cases

Let’s say a modeler is working with a protein-ligand complex with additional water molecules and ions. Over time, the scene becomes overloaded. Here’s how you can clean it up or inspect specific elements:

To select only visible molecules:

To identify molecules that are not visible:

To check which molecules were manually hidden:

Each filter returns only the molecules that match the condition, helping you isolate important parts of your system without deleting or permanently altering anything. This is especially useful for preparing publication visuals, running simulations only on active components, or debugging scripts that affect molecule visibility.

Pro Tip

If you’re automating workflows with the Node Specification Language, you can combine filters for even more precise control. For instance, to find all hidden molecules with more than 100 atoms:

Or if you want to ensure only visible protein chains are selected while excluding solvents with fewer atoms:

This makes analyses and visualization cleaner and more focused.

Conclusion

Being able to interpret and use visibility attributes like visible, hidden, and visibilityFlag can make working with complex models in SAMSON faster and more intuitive. Once these concepts click, toggling molecular visibility becomes a natural part of your modeling process.

To explore more attributes like selected, hasMaterial, and numberOfAtoms, consult the full documentation here: https://documentation.samson-connect.net/users/latest/nsl/molecule/

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

Comments are closed.