For many researchers and developers in molecular modeling, scripting is essential for automating tasks, analyzing data, or prototyping new algorithms. But keeping your scripting environment in sync with your modeling platform can be annoying. Between exporting files, switching applications, and reloading data, what should take minutes turns into a tedious routine.
SAMSON, the integrative molecular design platform, offers a way to streamline this workflow: it natively supports reading, writing, and executing Python scripts, thanks to the built-in Code Editor and scripting tools.
What You Can Do with Python in SAMSON
Inside SAMSON, Python scripts (.py) become first-class citizens. You don’t need to switch to a separate coding environment to:
- Run small automation scripts for repetitive tasks.
- Process or transform molecular models using custom logic.
- Interact with the API provided by SAMSON Extensions.
- Prototype code and watch the results directly in the 3D viewport.
This functionality is particularly helpful when you’ve just loaded or built a complex structure in SAMSON and want to programmatically analyze something—like extracting center of mass coordinates, applying transformations, or computing custom properties. Running your code on-the-fly, seeing immediate feedback, and being able to iterate quickly can significantly improve developer productivity.
How It Works
Python scripts can be:
- Read directly from the filesystem, including scripts embedded in SAMSON Documents.
- Written in the integrated code editor or exported to file.
- Executed from within SAMSON—just hit run.
You can also embed Python scripts into SAMSON Documents, making it easier to share interactive workflows, reproducible results, or extension prototypes with colleagues.
This native Python support builds on existing APIs and scripting tools documented under the Python Scripting section, where you’ll also find examples and guides to help you get started.
Why It Matters
Many modeling platforms require external scripting environments. By embedding Python directly, SAMSON reduces the overhead involved in prototyping or automation. You don’t have to leave the application, reload data, or worry about mismatched formats. Everything is already in one place.
Whether you’re building a custom selection script or doing a rapid proof-of-concept for a new scoring function, this integration saves time and lowers the barrier to entry for working programmatically with molecular models.
To learn more, check out the official documentation page on Supported Formats.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
