Streamline Molecular Modeling with SAMSON’s Python Environment

For molecular modelers, efficiency and automation are key to tackling complex workflows. Repetitive tasks, pipeline integrations, and custom application needs can consume vast amounts of precious time. If you’ve ever wished for an intuitive way to speed up and scale your work, SAMSON’s Python scripting environment has you covered.

An Integrated Python Environment Tailored for Modelers

At the heart of this capability is the SAMSON Python API, which empowers you to script nearly every functionality in SAMSON. Whether you want to automate processes, build modeling pipelines, or integrate with advanced machine learning libraries, the environment is designed to adapt to your needs.

The Python scripting environment includes:

  • A Python Console integrated with Jupyter Qt for real-time scripting and workflow automation.
  • A Code Editor, based on Monaco Editor (used in Visual Studio Code), offering syntax highlighting and code templates.
  • A Python Package Manager for seamless package installation and management.
  • Capabilities to embed Python scripts and apps directly within SAMSON documents for reproducible workflows and sharing.

Get Started with the Python Console

The Python Console provides direct access to SAMSON’s functionality. Whether you’re processing molecular simulations or visualizing data, the integrated Jupyter Qt Console makes everything accessible at your fingertips.

To activate the Python Console:

  • Go to Interface > Python Console in SAMSON’s menu.
  • If you prefer shortcuts, use Ctrl+8 on Windows/Linux or Cmd+8 on macOS.

Need a visualization? Here’s how the Python Console looks in action:

Python Console

Manage Your Python Packages Effortlessly

The Python Package Manager simplifies managing dependencies for your projects. From editing workflows to incorporating advanced statistical or bioinformatics libraries, SAMSON’s package management tools provide full flexibility.

To open the Python Package Manager:

  • Navigate to Edit > Manage packages… in the Python Console.

From there, you can view installed packages, install new ones, or uninstall obsolete ones. Package installation uses pip, and you can specify versions or add flags just as you would in traditional Python environments. You can even install local Python packages directly by specifying a path to them.

Take a look at the Python Package Manager interface:

Manage packages...

Scripting with a Powerful Code Editor

SAMSON’s Code Editor, based on Monaco Editor, ensures a seamless coding experience. It supports Python files and integrates with SAMSON projects for maximum efficiency.

Features like syntax highlighting, auto-completion, and Python script templates make it ideal for both beginners and experienced modelers. You can use the Code Editor to experiment with or refine Python scripts that interact with SAMSON’s API.

Here’s what the Code Editor interface looks like:

Code Editor Interface

Sharing and Collaboration Simplified

SAMSON enables you to embed Python scripts and even entire Python apps directly into its documents. This is perfect for collaboration or sharing reproducible projects with colleagues. Simply drag and drop your files or use Home > Embed files or Home > Embed folders.

By embedding scripts, SAMSON documents become self-contained, making file sharing via email, GitHub, or SAMSON Connect seamless. Others can easily open the document and run your scripts directly.

Conclusion

SAMSON’s Python environment is a game-changer for molecular modelers seeking to streamline workflows and automate tedious tasks. From scripting to package management and collaboration, everything is built around the principles of transparency, scalability, and ease of use. To learn more about these functionalities, visit the full SAMSON Scripting Documentation.

SAMSON and all SAMSON Extensions are free for non-commercial use. Get started by downloading SAMSON at SAMSON Connect.

Comments are closed.