Stop Copy-Pasting Scripts: Embed Python Apps Directly Into Your Molecular Models

Have you ever shared a molecular model with a colleague or a student, only to realize later that the associated analytical Python code or visualization script didn’t make it across? Or maybe your research notes, simulation workflow, and data were scattered across different files, making it hard to reproduce or explain what was done. If this sounds familiar, consider using embedded scripts in SAMSON documents.

The SAMSON platform makes it possible to embed Python scripts and entire Python applications directly into the molecular model documents you’re already using. This means molecules, parameters, analysis tools, code, visualizations—even teaching materials—can all reside in a single, portable, self-contained file. No more wondering whether the script you used last semester is still synced with the model—it’s all embedded.

What Can Be Embedded?

SAMSON documents support Universal File Embedding. This includes, but is not limited to:

  • Python scripts and entire Python applications (e.g., ML-based analysis tools)
  • Research papers and lecture notes
  • Custom color schemes and visual presets
  • Data sets, figures, and raw input files

To embed files, simply drag and drop them into a SAMSON document and choose to embed. Alternatively, use Home > Embed files or Home > Embed folders.

Embed file dialog

How Is It Useful?

This feature is especially valuable for:

  • Researchers: Ensure that data analysis workflows and visualization scripts live next to your molecular models, increasing transparency and reproducibility.
  • Colleagues: Collaborate through documents that include scripts, data, meeting notes, and model progress without juggling separate files.
  • Professors and educators: Distribute learning modules in SAMSON that include both lecture content and executable exercises—feedback becomes immediate.

Once embedded, these files travel with the document. You can transfer the SAMSON document via email, GitHub, or the SAMSON Connect – Documents portal. The recipient opens the model in SAMSON and simply double-clicks a script to open it in the integrated Code Editor.

This is not just convenient—it’s reproducibility, teaching, and collaboration, made easier.

Example Scenarios

  • A computational chemist embeds a Python script that performs an automated molecular dynamics analysis, along with plots and raw simulation data—all in one SAMSON file. Their reviewer has everything they need to reproduce the results.
  • A professor sends students a SAMSON document that contains both a molecular structure and a Python-based GUI built with PyQt for exploring bond angles. Students can interact with exercises directly—no setup required.
  • A biology lab shares a model showing a protein-ligand interaction alongside embedded scripts that generate custom visualizations based on user inputs.

It means fewer broken links, fewer lost files, and better scientific communication.

Learn more about embedding Python apps and scripts in SAMSON documents by visiting the official documentation.

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

Comments are closed.