Molecular modelers often find themselves repeating tedious scripting tasks—especially when moving or manipulating atoms in 3D space. Whether you’re prepping a structure for simulation, analyzing trajectories, or coding interactions, it all adds up. What if you could just explain what you want in plain English, and get valid Python code ready to run in SAMSON?
Enter SAMSON AI’s /script command. It lets you describe a molecular operation in natural language and generates Python code that runs in SAMSON using its Python API. This is particularly useful for users who:
- Don’t want to memorize the entire SAMSON scripting API
- Frequently build small tools for repetitive simulation setup
- Want to integrate machine learning or custom analyses
Getting Started with /script
Let’s say you want to translate all atoms along the z-axis by 1 angstrom. Instead of looking up the right vector math, you can just ask:
|
1 |
/script select all atoms and translate them in the z direction by 1 angstrom. |
SAMSON AI responds with the complete Python script using the SAMSON Python API. You can immediately use or modify it in the Script Editor. This lets you build up your own automation toolset faster—and without syntax struggles.
Yes, You Can Request GUIs
You can even request small graphical interfaces:
|
1 |
/script create a GUI that lets me enter a distance in angstrom, with a 'Move' button. |
SAMSON AI will generate a script complete with a button, an input field, and handlers that update your structure based on your parameters. This can be a quick way to prototype new interfaces or just create personalized utilities without diving into GUI frameworks manually.
Combine with Other Libraries
The Python scripts generated by /script can use other Python modules. You could ask for scripts that:
- Compute RMSD over a trajectory using NumPy arrays
- Train a basic ML model based on molecular features
- Parse PDB files and highlight residues meeting criteria
If the module is available in your Python environment inside SAMSON, the code will run as expected.
Why This Helps
This AI-based script generator makes scripting more accessible. You don’t need to start from a blank slate, look up documentation, or guess function names. You describe what you want, and get an editable starting point. It lowers the barrier especially for those who are new to automating workflows but still want reproducibility and efficiency.
This feature is part of SAMSON’s overall approach to retrieval-augmented agency: the AI assistant doesn’t just chat—it acts, learns, refers, and scripts on your command. It’s an assistant that understands your domain and tools.
Learn more about SAMSON AI’s scripting capabilities and all other commands in the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.
