Molecular modeling often involves handling complex structural data, making it challenging to efficiently query and manipulate specific components of molecular models. The Node Specification Language (NSL) in SAMSON provides an elegant solution to this problem by enabling targeted and flexible queries using structural model attributes.
In this blog post, we’ll explore how you can leverage the structuralModel attribute space to work with molecular data in a more streamlined way. Whether you’re looking to filter models based on the number of atoms, chains, or even specific charges, SAMSON’s structuralModel attributes make the task intuitive and efficient.
What Are Structural Model Attributes?
Structural model attributes represent properties of molecular models and can be used in queries to target and manipulate specific data. For example, queries can be used to match models based on the number of atoms or molecules, visibility flags, formal charges, and more. The structuralModel attribute space has a variety of attributes to help in these tasks, with short names to simplify the syntax.
An Example Use Case
Imagine you’re working with a large molecular dataset, but you’re only interested in models containing fewer than 1,000 atoms or those with a specific formal charge. Instead of manually combing through each model, you can use NSL queries with structural model attributes. Here’s how:
- To find structural models with fewer than 1,000 atoms, you can use:
sm.nat < 1000. - To match models with a total formal charge between 6 and 8, you can use:
sm.fc 6:8.
Key Attributes and Their Applications
SAMSON’s structuralModel attribute space includes both inherited and specific attributes. Below are some key attributes and examples of how you can use them:
| Attribute | Description | Example Usage |
|---|---|---|
hasMaterial (sm.hm) |
Detects if the model has material assigned. | sm.hm (matches models with material assigned). |
numberOfAtoms (sm.nat) |
Filters models based on the total number of atoms. | sm.nat 100:200 (matches models with 100 to 200 atoms). |
numberOfChains (sm.nc) |
Targets structural models with a specific number of chains. | sm.nc < 3 (matches models with fewer than 3 chains). |
formalCharge (sm.fc) |
Matches models with a specific total formal charge. | sm.fc > 0 (matches positively charged models). |
partialCharge (sm.pc) |
Filters models based on their total partial charge. | sm.pc 1.5:2.0 (matches models with a partial charge between 1.5 and 2.0). |
Combining Attributes for Advanced Queries
One powerful feature of the structuralModel attribute space is the ability to combine multiple attributes in a single query. For instance:
sm.nat < 1000 and sm.fc = 0: Matches models with fewer than 1,000 atoms and a neutral formal charge.not sm.v: Targets only invisible models by checking thevisibleattribute.
Why It Matters
By using NSL’s structuralModel attributes, molecular modelers can save significant time and effort. Instead of manually filtering models or writing custom scripts for every query, these predefined attributes provide a ready-to-use syntax for common tasks.
To explore more about the structuralModel attribute space or dive deeper into examples, visit the official documentation page. By utilizing these tools, you can streamline workflows and focus on the scientific challenges that matter.
SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON at SAMSON Connect.
