For many molecular modelers, writing Python scripts is a common task—but it can also be a source of friction. Whether you’re building custom visualizations, automating repetitive tasks, or analyzing structural properties, scripting can be both powerful and time-consuming. But what if you could skip the boilerplate and focus directly on your intent?
Enter the /script command in SAMSON AI, a feature that helps you go from plain English to ready-to-run Python with minimal friction. Based on GPT-5, SAMSON AI transforms your requests into concrete Python scripts that use the SAMSON Python API. This can save time, reduce error, and help you learn by example.
Turning ideas into scripts
Using /script is as simple as typing your intent into the SAMSON AI Assistant. You might want to move atoms, analyze geometry, visualize data, or build simple interfaces—all you need is a statement that describes what you want.
Here are a few examples directly from the documentation:
/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 will immediately generate and display a Python script that performs the requested task. You can then run, review, or modify the code within the SAMSON Scripting Editor.
Why this matters
This feature addresses a frequent pain point: scripting is powerful, but it often requires context switching, syntax recall, and significant time investment. With /script, you can:
- Quickly prototype ideas
- Learn how to use the SAMSON Python API by example
- Automatically generate scripts without leaving the modeling environment
Even if you are an experienced Python user, /script can accelerate your workflow and reduce the repetitive steps involved in common scripting tasks.
What can you script?
The flexibility of the scripting API allows you to use SAMSON AI for a wide range of tasks:
- Geometry and structure analysis
- Structure manipulation
- Batch operations
- Visualization logic
- Machine learning integration (via external modules)
And because the generated scripts are editable, you retain full control. Think of SAMSON AI not as replacing coding, but as kickstarting it—by translating your intention into a smart starting point.
Things to keep in mind
The quality of the generated Python scripts depends on the clarity of your input. Being specific helps SAMSON AI tailor the script more closely to your needs. If you ask for something too ambiguous, you might need to refine your command.
Also, keep in mind that code generation depends on what GPT-5 knows about the SAMSON API. If you’re aiming for advanced customization, you might combine AI assistance with manual tweaking.
Try it out
You can access SAMSON AI through Interface > Assistant or by using the shortcut Ctrl + 0 (Windows/Linux) or Cmd + 0 (Mac).
Just type /script followed by your desired task. Whether you’re a beginner looking to learn how to script, or an expert interested in speeding up your workflow, this feature can help reduce friction and boost productivity.
To learn more about all commands available in SAMSON AI, visit the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
