For molecular modelers, managing and refining large molecular datasets can be a daunting task. Whether you’re analyzing ligands, residues, or specific atom types, pinpointing the exact nodes you need in a sea of molecular complexity is critical. This is where SAMSON’s Node Specification Language (NSL) comes into play, offering a streamlined way to filter your molecular structures effectively and efficiently.
Why Node Filtering Is Essential
Imagine working with a molecular document containing thousands of atoms or residues. Manually searching or selecting specific components such as ligand molecules or side-chain atoms can be time-consuming and error-prone. With NSL, you can write intuitive expressions to filter and select exactly what you need with just a few keystrokes. This capability not only speeds up your workflow but also ensures precision, paving the way for more accurate downstream analyses.
Using NSL in the Document View
SAMSON allows you to filter molecular structures directly in the Document view, making it an ideal tool for interactive exploration. Here’s how it works:
- Type an NSL expression into the filter box in the Document view interface.
- Press Enter to select the filtered nodes. You’ll instantly see only the nodes that match your criteria.
For example, if you want to select structural groups, you can use the following NSL expression:
n.t sg
This is the short version of node.type structuralGroup, which matches all structural groups in your document. The Document view renders this filtering experience straightforward and interactive, helping you focus on specific components of interest.
Examples to Get You Started
Below are some useful NSL expressions for common filtering tasks:
H linking O: Selects hydrogens bonded to oxygen atoms.node.type residue beyond 5A of node.selected: Finds residues that are beyond 5 angstroms from the current selection.node.category ligand: Isolates only ligands.residue.secondaryStructure helix: Selects residues that are part of alpha helices.
You can also use proximity-based selections. For instance, to select nodes named “CA” that are within 5 angstroms of sulfur atoms, you can write:
"CA" within 5A of S
Boost Your Productivity With AI Assistance
For users who are new to NSL or feel uncertain about writing NSL expressions, SAMSON includes an AI Assistant feature. By clicking on the
Ask AI button in the Document view, you can request the assistant to generate NSL expressions tailored to your active document. This can be a game changer, especially when dealing with complex hierarchies.
More Advanced Capabilities
Beyond basic filtering, NSL supports advanced functionalities like logical operators (and, or, not) and topological proximity operators (withinBond {number_of_bonds} of). These features make it possible to perform intricate queries, such as selecting atoms within a certain number of bonds from a specified group. For instance:
atom.symbol C withinBond 3 of atom.symbol S
This expression identifies carbon atoms within three bonds of sulfur atoms.
Conclusion
SAMSON’s NSL filtering capabilities provide powerful, precise tools to handle molecular complexity, saving time and effort for modelers at every level. You can dive deeper into NSL expressions and learn additional use cases by exploring the full Node Specification Language documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.
