For many molecular modelers, writing scripts to carry out repetitive or complex tasks is part of the job. But even experienced users can find themselves bogged down by boilerplate code or searching through documentation to figure out function names, parameters, or object structures. What if you could simply tell your platform what you want to do in English—and get a working script back in seconds?
The /script command in SAMSON AI does exactly that. It turns natural language into executable Python code using SAMSON’s API. This helps scientists focus less on syntax and more on scientific objectives. Let’s take a closer look at how this works and when it can be a game-changer.
Reducing Friction in Complex Workflows
Imagine you’re trying to compute the radius of gyration of a receptor, select atoms, or build a GUI to manipulate a molecule’s position. Typically, you’d need to look up which objects control what, find out how to reference particular nodes, and write the code from scratch. With SAMSON AI, you skip all that by typing:
/script compute the gyration radius of the receptor./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.
SAMSON AI will respond with a ready-to-run Python script using the SAMSON Python API. You can review it, tweak it, and run it—all within the platform.
Useful When You Need Speed and Precision
There are many moments when this capability can save time:
- Quick Prototyping: Rapidly test out models or hypothesis without deep diving into code.
- Learning Tool: For students or newcomers, it provides instant examples of how the SAMSON API is used.
- GUI-based Automation: Some scripts can even include basic user interfaces, helping other collaborators run functions easily without needing scripting knowledge.
From Natural Language to Structured Code
One of the neat side effects of the /script command is how it reveals intermediate steps you might not have thought of. For instance, when translating atoms or generating a GUI, you get insight into how SAMSON internally handles selections, transforms, and user input widgets. This means every script isn’t just a utility — it’s also a learning opportunity.
A Thoughtful Integration of GPT-5
It’s worth noting that this functionality relies on GPT-5 in the Professional plan, making it a powerful example of how large language models aren’t just responding to text, but actively enhancing software workflows. The AI understands SAMSON’s API and outputs well-structured, executable code tailored to your molecular design goals.
Where to Start
To try it out yourself, open SAMSON AI using Interface > Assistant, or press Ctrl+0 (on Windows/Linux) or Cmd+0 (on Mac). Enter your query prefixed by /script and hit Enter. You’ll get a Python script tailored to your request. You can then modify or run it directly in SAMSON’s scripting environment.
To explore more commands and learn how SAMSON AI complements your molecular modeling, visit the original documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
