Spend Less Time Repeating, More Time Discovering: Automating Molecular Workflows in SAMSON

If you’re a molecular modeler, you’re probably all too familiar with repetitive tasks: loading structures, setting up visual styles, preparing systems, analyzing trajectories, and more. These operations can quickly become tedious, especially when they need to be performed multiple times or across many datasets.

This is where scripting in SAMSON can make a real difference. With the integrated Python environment, you can streamline your entire workflow—from system preparation to analysis—right inside SAMSON.

Embedded Jupyter-like Python Console

The Python Console in SAMSON is not an external terminal window. Instead, it comes with an embedded Jupyter-style Qt Console fully integrated into the application. It lets you interact with your molecular models in real-time using Python scripts.

To open the Python Console, go to Interface > Python Console.

Python Console

Package Management Made Easy

Need to analyze molecular dynamics data with MDAnalysis? Or maybe perform statistical tests using scipy? You can install and manage Python packages directly within SAMSON.

Simply go to the Python Console, then Edit > Manage packages…. A graphical package manager will open, allowing you to install, uninstall, or upgrade packages just like you would with pip.

Manage packages...

You can even install local packages in editable mode to update them without reinstallation—handy if you’re developing your own tools or workflows.

Run Scripts in an Integrated Code Editor

The built-in Code Editor in SAMSON integrates the powerful Monaco Editor used in Visual Studio Code. It includes syntax highlighting, auto-completion, and immediate access to the SAMSON Python API.

Code Editor Interface

To run a script, simply click Run or use the Python Console. Developing and testing code becomes seamless, especially since you can embed scripts directly within SAMSON documents.

Embed Scripts Directly in Your Projects

One of SAMSON’s unique features is the ability to embed Python scripts and files in its documents. This creates fully self-contained projects that are easy to share and reproduce.

Embed file dialog

Whether you’re collaborating with peers, preparing course materials, or publishing reproducible research, embedded scripts enable you to share more than just static models—you share executable workflows.

Conclusion

Scripting in SAMSON can drastically cut down on repetitive tasks and help you standardize analyses across multiple projects. With an embedded Python environment, complete with package management and code editing, SAMSON offers researchers an efficient, integrated solution for molecular modeling automation.

Explore the full scripting capabilities in the SAMSON documentation.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.