Molecular modeling workflows can be complex and time-consuming, often requiring the use of multiple tools for tasks like simulation, data analysis, and visualization. For researchers and developers looking to streamline their work, integrating Python scripting into your platform can offer powerful, flexible, and automated solutions. That’s where SAMSON, the molecular design platform, excels.
SAMSON’s Python Integration
SAMSON comes equipped with a fully integrated Python Development Environment, making it easier than ever to automate workflows, develop new tools, and handle computational challenges directly within the platform. Here are the main components designed for Python enthusiasts:
- SAMSON Python API for scripting and interacting with the platform.
- An embedded Python Console using the Jupyter Qt Console.
- A Code Editor based on Monaco Editor from Visual Studio Code for an enhanced programming experience.
- Python Package Manager to install, uninstall, and manage dependencies.
- The ability to embed scripts within SAMSON documents for easy sharing and reproducibility.
Better yet, SAMSON’s integration allows Python enthusiasts to leverage external libraries for deep learning, data visualization, statistics, bioinformatics workflows, and more.
Access the SAMSON Python API
The integrated Python API exposes nearly all the functionalities of SAMSON, enabling users to model, simulate, and even design interactive interfaces. It is ideal for beginners and experts alike. For guidance, SAMSON offers a Python Scripting Guide, full of examples and insights into how to use this powerful API. Furthermore, users can utilize the SAMSON AI assistant via its /script command to generate Python scripts tailored to specific needs.
Streamlined Package Management
With SAMSON’s Python Package Manager, researchers can integrate their favorite Python libraries into their modeling environment. Managing packages is as simple as navigating to Python Console > Edit > Manage packages…. Here are the package management capabilities supported:
- Install packages from PyPI or provide a local package path.
- Specify versions or use flags (e.g.,
--upgrade). - Uninstall unused or outdated packages effortlessly.
For advanced users, the editable/develop mode option allows you to dynamically reflect code changes within local packages during development. However, note that macOS users might encounter specific challenges with this mode, necessitating alternative setup pathways.

Centralized Python Script Development with the Code Editor
SAMSON’s Code Editor, powered by Monaco Editor, enhances coding productivity by offering syntax highlighting, auto-completion, and Python script templates. It allows users to:
- Create, modify, and execute Python scripts directly within the interface.
- Access Python script templates demonstrating various functionalities of SAMSON Python API.
- Integrate a user-friendly visual execution component such as PyQt GUIs.

For those looking to run scripts quickly, the integrated Python Console offers a seamless experience for testing and prototyping Python code.
Reproducibility and Collaboration with Embedded Scripts
SAMSON documents take reproducibility to the next level by allowing users to embed Python scripts and apps. Whether for education, research, or collaboration, you can attach everything from Python apps to analysis scripts directly to your molecular models. Share these self-contained documents via email, GitHub, or SAMSON Connect, and ensure your colleagues or students can run the workflows seamlessly on their machines. This feature is particularly powerful for educators who wish to create interactive lessons and researchers aiming to increase transparency in their computational methods.

SAMSON’s Python integration is designed to empower researchers and developers alike, offering a complete environment for molecular modeling, computational chemistry, and more. With its robust scripting framework, centralized package management, and tools for reproducibility, SAMSON is simplifying and accelerating molecular modeling workflows.
To delve deeper into these features, visit the official documentation page: https://documentation.samson-connect.net/users/latest/scripting/.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
