For many molecular researchers and modelers, writing Python scripts to automate modeling tasks can feel like a necessary chore. Whether it’s selecting atoms based on spatial constraints, building user interfaces, or computing molecular properties, scripting can be powerful—but also time-consuming and error-prone.
That’s where SAMSON AI comes in. If you’re using the SAMSON molecular design platform, you’re likely already aware of its tools and extensions for structural biology, quantum chemistry, and drug design. But with the new /script command in SAMSON AI, you can now generate Python scripts on the fly—just by describing what you want in plain English.
What is the /script command?
Built into SAMSON AI (available via Interface > Assistant or Ctrl+0 on Windows/Linux and Cmd+0 on Mac), the /script command uses natural language processing to convert your description into Python code. This code uses the SAMSON Python API, allowing you to directly interact with your molecular data.
Instead of writing code from scratch, simply type commands like:
/script select all atoms and translate them in the z direction by 1 angstrom./script compute the gyration radius of the receptor./script create a GUI that lets me enter a distance in angstrom, with a 'Move' button.
SAMSON AI instantly returns readable, context-specific Python code. This facilitates both automation for complex tasks and serves as a learning resource if you’re new to scripting in SAMSON.
Who is this for?
If you’re a molecular scientist who wants to:
- Prototype and test structural workflows quickly
- Teach or learn molecular scripting in an intuitive way
- Speed up daily repetitive tasks (e.g., selections, transformations, analysis)
Then the /script command can help you save time and reduce mistakes.
How does it work?
When you enter a /script command in SAMSON AI, it leverages GPT-5 (for Professional plan users) to interpret your sentence, map it to SAMSON’s Python API, and format the result as an executable script. You can copy, save, or customize it further if needed.
Why does this matter?
Traditionally, scripting in scientific software means consulting the API documentation, debugging syntax issues, and ensuring that operations match the structure of your molecular data. SAMSON AI eliminates these overheads by providing precise, ready-to-run code with minimal input.
This is especially helpful when you’re trying to automate repetitive analysis steps, explore a new feature, or need to customize functions in a teaching session or lab meeting.
Getting Started
To try it, just open the AI Assistant in SAMSON and type:
|
1 |
/script select all side chains within 5 angstrom of the ligand and color them red. |
…and watch the script appear.
Of course, you can still edit any generated script to fit your needs—that’s the power of combining AI with scripting: flexibility without the boilerplate.
To explore more commands and see additional scripting examples, visit the official documentation for SAMSON AI: https://documentation.samson-connect.net/users/latest/samson-ai/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
