For molecular modelers, one of the critical aspects of the job is efficiently identifying and categorizing structural groups based on their properties. Luckily, SAMSON’s Node Specification Language (NSL) provides a powerful way to achieve this through the concept of Structural Group Attributes. In this post, we’ll delve into how to use these attributes to match and manipulate structural groups effectively.
Why Structural Group Attributes Matter
Imagine you’re working with a highly complex molecular system. To streamline your work, you might need to filter structural groups based on specific characteristics like their number of Carbon atoms, total partial charge, or visibility state. Without a clear and structured mechanism, this process can quickly escalate into a chaotic and time-consuming task. SAMSON’s structuralGroup attributes offer an elegant solution, allowing you to define and query meaningful conditions directly within the NSL syntax.
Getting Started with Structural Group Attributes
Structural group attributes in NSL are defined in the structuralGroup (sg) attribute space. These attributes can match structural groups (e.g., molecules or groups of atoms) in your system that meet specific criteria. They are divided into two main categories:
- Attributes inherited from the
nodeattribute space: For example,hasMaterial(sg.hm) orvisible(sg.v). - Attributes specific to structural groups: For example,
formalCharge(sg.fc) ornumberOfAtoms(sg.nat).
Example: Filtering Structural Groups by Atom Count
One of the most common tasks molecular modelers face is grouping structural entities based on their atom counts. Using the numberOfAtoms attribute (sg.nat), this becomes straightforward.
Syntax: sg.nat allows you to match structures with a specific number of atoms. Possible values are integers.
Examples:
sg.nat > 100: Matches structural groups containing more than 100 atoms.sg.nat 100:200: Matches structural groups with atom counts between 100 and 200.
More Advanced Matching: Partial Charge and Element-Specific Filters
More sophisticated filtering is also possible. For instance, you can use partialCharge (sg.pc) to match groups based on their total partial charge:
sg.pc 1.5:2.0: Matches structural groups with a total partial charge between 1.5 and 2.0.
Additionally, filters like numberOfCarbons (sg.nC) or numberOfOxygens (sg.nO) let you zero in on structural groups containing very specific types of atoms:
sg.nC < 10: Matches groups with fewer than 10 Carbon atoms.sg.nO 10:20: Matches groups with Oxygen atom counts between 10 and 20.
Controlling Visibility and Attributes
For an interactive modeling session, controlling visibility can be crucial. Attributes like visible (sg.v) and hidden (sg.h) allow you to easily toggle visibility or query the current state of specific structural groups.
For example:
sg.v: Matches visible structural groups.not sg.v: Matches hidden groups.
Where to Go from Here
Structural group attributes bring flexibility and precision to the molecular modeling workflow within SAMSON. By using these attributes, you can easily filter, manipulate, and analyze structural groups based on specific needs.
To explore more examples and learn about all available structural group attributes, visit the official documentation page.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download it at SAMSON Connect.
