If you’ve ever had to script repetitive molecular modeling tasks, you know how time-consuming it can be to write and debug Python code for every small operation. Whether you’re translating atoms, computing geometric properties, or trying to build a custom user interface, the process often interrupts your creative flow. What if you could go from idea to working script in seconds—just by asking in plain English?
That’s exactly what SAMSON AI’s /script command enables. Powered by GPT-5 in the Professional plan, this assistant understands natural language and translates it into executable Python code that works directly with the SAMSON Python API.
How it works
The process is simple: just open the SAMSON AI via Interface > Assistant or using the shortcut (Ctrl + 0 on Windows/Linux or Cmd + 0 on Mac), then type in your request prefixed with /script.
For example:
/script select all atoms and translate them in the z direction by 1 angstrom./script create a GUI that lets me enter a distance in angstrom, with a 'Move' button./script compute the gyration radius of the receptor.
Under the hood, SAMSON AI uses its integration with GPT-5 to produce relevant, context-aware code based on the latest version of the SAMSON API. Whether you’re new to scripting or a seasoned molecular programmer, it can significantly reduce boilerplate and help you focus on your specific modeling goals.
What’s the benefit?
Molecular modelers often switch back and forth between documentation, scripting interfaces, and test environments. SAMSON AI minimizes this friction by acting as a live-coding partner inside your modeling platform. It’s especially useful when:
- You want to experiment quickly without searching the API docs.
- You have a clear idea of what you want to do, but not how to code it.
- You’re looking for rapid prototyping of tools or workflows.
Example use case
Let’s say you’re analyzing a protein and need a GUI for moving selections along the x-axis. Rather than searching for GUI frameworks, writing callbacks, and wiring your code, just type:
|
1 |
/script create a GUI with an input field for distance in angstroms and a 'Move X' button |
Within moments, SAMSON AI will generate functioning Python code you can run and adapt.
Limitations to remember
While SAMSON AI produces helpful code, keep in mind:
- It may misinterpret vague instructions. Be specific.
- The script may need some adjustment for complex tasks.
- It won’t replace the understanding of script logic—but it will speed it up.
Try it yourself
To get started, open the Assistant and type /script. SAMSON AI will even show you available commands so you can choose more advanced options.
To learn more about scripting with SAMSON AI, visit the official documentation page: https://documentation.samson-connect.net/users/latest/samson-ai/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
