When working with complex molecular systems, visualization quickly becomes a challenge. Property models are often cluttered with hidden or irrelevant data, making it hard to focus on what matters most. If you’re a molecular modeler using SAMSON, you’ve likely wanted a systematic way to filter your data—especially when only visible or currently selected properties are important in your workflow. Fortunately, SAMSON’s Node Specification Language (NSL) offers simple yet powerful attributes that help you zero in on the data that’s most relevant.
Why filter by visibility or selection?
Imagine analyzing a protein-ligand complex where you’ve applied multiple property models—charges, surface areas, hydrophobicity, etc.—but only the visible or currently selected ones matter for your current task (e.g., exporting a subset, applying further analysis, or creating presentation-ready visuals). Without filters, you’d need to manually clean up the scene, increasing the chances of unwanted properties sneaking in. NSL solves this cleanly and efficiently.
Key attributes to streamline property models
Property models in SAMSON are defined within the pm (short for propertyModel) namespace. Below are a few attributes that are particularly helpful:
pm.v: Targets only visible property models.pm.selected: Targets only selected property models (note: no short name available for this attribute).pm.h: Targets hidden property models.
These attributes can be used individually or combined through logical expressions. Here are a few examples:
|
1 2 3 4 5 6 7 8 |
// All visible property models pm.v // All selected but currently invisible property models pm.selected and not pm.v // All visible and not hidden models (hidden and visible flags can sometimes diverge) pm.v and not pm.h |
These queries are especially useful when scripting or pipeline-building in SAMSON. They allow bulk operations—like deletions, exports, simulations—to target only the parts of your data that are relevant to the task at hand.
What about material information?
You can also use material-related filters like:
|
1 2 3 4 5 |
// Property models that own material pm.om // Property models that have material (but do not necessarily own it) pm.hm |
These flags offer further control over data ownership and style, helpful for scene organization or custom visualization workflows.
No short name? No problem.
Not all attributes have a short name. For instance, selected does not have a short alias like many other attributes (visible is v, ownsMaterial is om, etc.). However, it still functions the same way when used with pm., like:
|
1 |
pm.selected |
Just something to keep in mind when you’re scripting!
Wrap-up
Mastering a few NSL attributes in SAMSON can go a long way in organizing your molecular workspaces. Whether you’re filtering for visualization, export, or computational runs, controlling what’s visible or selected lets you stay focused and efficient. NSL gives you that control, elegantly and flexibly.
To learn more and see all available attributes, check the full documentation at https://documentation.samson-connect.net/users/latest/nsl/propertyModel/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
