For molecular modelers, sharing results and workflows seamlessly can be a challenge. Collaborating with colleagues, ensuring reproducibility, or packaging research outputs often requires tedious exchanges of files and instructions. What if there was a way to share not only your molecular models but also the Python scripts and apps that automate workflows or process data?
This post explores how SAMSON’s embedded Python scripting feature addresses these challenges through a powerful yet intuitive approach. By embedding Python scripts and apps directly into SAMSON documents, you can streamline collaboration, ensure reproducibility, and package complex molecular design workflows efficiently.
What is Embedded Python Scripting?
SAMSON documents support Universal File Embedding. This feature enables users to embed Python scripts, entire apps, research papers, datasets, images, and more within a single SAMSON document. The document becomes self-contained, allowing seamless file transfer and usage across computers without additional setup steps.
Once the Python script is embedded, it can be opened easily in the SAMSON Code Editor by simply double-clicking on it. If you’re working with colleagues or students, they can open the document and execute your embedded Python app or script immediately.
How It Works
Embedding a file or folder in SAMSON is straightforward:
- Drag and drop: Simply drag and drop the file or folder onto the SAMSON interface. You’ll be prompted to embed it in the document.
- Use the menu: Navigate to Home > Embed files or Home > Embed folders to include your content in the document.
Here’s what the embedding process looks like:

Applications
Embedded scripting in SAMSON opens up various possibilities:
- Collaboration: Share SAMSON documents containing molecular models, project notes, embedded automation scripts, and visualization presets with colleagues. Your team can execute the scripts without extra configuration or dependency concerns.
- Reproducibility in Research: Attach executable scripts for data analysis or workflow automation directly to your published molecular models. This adds an element of transparency to your research findings.
- Educational Deployment: Professors can distribute SAMSON documents with lecture notes and embedded Python-based exercises, creating interactive learning experiences that students can explore hands-on.
- Interactive Learning: Generate fully functional learning modules by embedding documentation, visualization presets, and step-by-step interactive examples in SAMSON documents.
Streamlined Sharing
Once complete, your SAMSON document (with its embedded Python scripts/apps) can be shared easily via email, GitHub, or the SAMSON Connect – Documents platform. This ensures that recipients have everything they need to replicate or expand upon your work, without worrying about setting up dependencies or recreating workflows.
Why Use Embedded Scripts?
The ability to combine molecular models, Python scripts, and metadata in one compact file isn’t just a convenience — it’s a game-changer for molecular design workflows. From ensuring proper Python script execution to packaging self-contained projects, SAMSON documents provide a comprehensive solution that addresses the fragmented nature of traditional collaboration tools.
Ready to explore? Check out the full SAMSON scripting documentation here and take your molecular modeling collaboration to the next level.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
