You select a molecular component—or try to find it with a query—and it seems to vanish. The node may not be the problem. In SAMSON, some node states can be inherited from ancestors, so a child’s effective state may differ from its own flag. Knowing which attribute answers which question can make hierarchy-related searches much less puzzling.
Node Specification Language (NSL) lets you query nodes across the data graph. For example, node.type atom (or the shorter n.t a) matches atoms. But when you are investigating visibility, selection, or locking, it helps to distinguish a node’s own flag from its state in the hierarchy.
Effective state versus local flag
For visibility, node.visibilityFlag reports the node’s visibility flag. The shorter form is n.vf; to match nodes whose flag is false, use n.vf false. By contrast, node.visible describes whether a node is visible considering both its own flag and its ancestors. Its short form is n.v.
This difference is useful when a node appears hidden even though you expected it to be shown. Try asking two separate questions:
n.vf false: which nodes have their own visibility flag set to false?n.v: which nodes are visible, with ancestor visibility taken into account?
The related hidden attribute, n.h, matches nodes that are hidden because their own visibility flag is false or because an ancestor’s flag is false. So n.h is useful for finding hidden nodes, while n.vf helps inspect the flag on the node itself.
The same distinction applies to selection
node.selectionFlag (n.sf) checks a node’s selection flag. For example, n.sf false matches nodes whose flag is false. node.selected (n.s) instead matches nodes that are selected because their own flag is true or an ancestor’s selection flag is true.
If a child seems selected unexpectedly, compare n.sf with n.s. The first is about the child’s flag; the second accounts for selection inherited from an ancestor. Similarly, node.lockedFlag (n.lf) checks the node’s own locked flag, while node.locked (n.l) also matches nodes locked through an ancestor.
A practical query-building routine
- Start with the node type. For atoms, use
n.t a; for residues, usen.t r. - Check the local flag. Use
n.vforn.sfwhen you want to inspect visibility or selection flags on the nodes themselves. - Check the effective state. Use
n.v,n.h, orn.swhen the hierarchy matters. - Narrow by context. NSL supports queries that relate nodes to categories. For example,
a.s N in n.c ligmatches nitrogen atoms in ligands.
This sequence separates two common questions: “What is set on this node?” and “What state does this node have in its hierarchy?” That distinction can help you diagnose a query result without assuming that a child’s flag tells the whole story.
One more useful distinction: having versus owning material
The same kind of precision helps with materials. node.hasMaterial (n.hm) matches nodes that have a material either because it is applied directly to them or inherited from an ancestor. node.ownsMaterial (n.om) matches nodes to which a material is applied directly. If you are checking where a material originates, these attributes answer different questions.
For the complete list of node attributes, categories, types, and examples, see the SAMSON node attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
