Stop Copy-Pasting Molecular Workflows: Use Embedded Python in SAMSON Instead

If you’ve ever managed or shared computational models, simulations, or analysis routines in molecular modeling, you probably know the pain of scattered files, forgotten dependencies, or broken scripts that no longer run months later. This is especially frustrating when collaborating across teams or preparing reproducible workflows for students or publications.

SAMSON provides a lesser-known but very effective solution: Python script embedding directly inside SAMSON Documents. This feature lets you keep your entire workflow – molecular models, input data, Python scripts, and even whole Python apps – in a single, self-contained file.

Why embed Python scripts in SAMSON Documents?

When you embed a script, it stays with your project. You open the document, and everything’s there – no need to go hunting for external scripts, re-linking files, or setting up environments from scratch. It simplifies hand-offs, debugging, and version control.

Here’s an example of what you can embed:

  • A Python script to analyze structural properties.
  • A PyQt GUI that interacts with molecular models.
  • A deep-learning pipeline prepared with installed Python packages.
  • Research notes and supplementary material for a paper.

How it works

To embed one or more files or folders into a SAMSON Document, simply drag-and-drop them into the app. A dialog will ask whether you want to embed or link them.

Embed file dialog

Alternatively, use the interface via Home > Embed files or Home > Embed folders.

Once embedded, these files are saved within the document – so you can email it, put it on GitHub, or add it to your shared drive. Others can open it on their copy of SAMSON and run the scripts without additional configuration.

What happens when someone opens your document?

They can double-click the embedded script to open it in SAMSON’s integrated Code Editor, which supports syntax highlighting, autocompletion, and direct execution with a built-in Python Console. They don’t need to search for missing modules or files – it’s all there.

Use cases worth trying

  • Teaching: Distribute interactive exercises with models and scripts in a single file.
  • Publishing: Attach predictive modeling or simulation routines alongside molecular data for reproducibility.
  • Collaboration: Share projects and tools with full functionality retained, even offline.

Useful tip

You can even embed local Python apps developed with external packages (e.g., NumPy, RDKit, or TensorFlow). Combine this with the embedded package manager and SAMSON becomes a portable environment for molecular research.

Learn more about embedding scripts and apps in SAMSON by visiting the official documentation page, or explore the full scripting guide at https://documentation.samson-connect.net/users/latest/scripting/.

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

Comments are closed.