Sharing a molecular model with collaborators often comes with a familiar headache: supplementary scripts are in a separate folder, dependent files are missing, and paths break across systems. As molecular modelers, we frequently juggle multiple files—models, data, Python scripts, results—and ensuring everything stays connected (and executable) can be a challenge, especially for team collaboration or teaching.
SAMSON offers a neat solution: you can embed entire Python scripts and even complete Python apps directly into your molecular modeling documents. This turns your model into a self-contained, executable file that travels with all the components packaged in.
Why Embed Scripts into Documents?
Instead of sending models and separated scripts and packages, embedding means collaborators or students can simply open a single SAMSON Document (.sbn file), run the embedded scripts, and immediately reproduce or explore your results without worrying about missing files or paths. It simplifies collaboration, reduces friction in education settings, and promotes reproducibility in computational research.
Here’s how it works.
Drag-and-Drop Simplicity
To embed a Python script into your SAMSON document:
- Drag the script file or an entire folder directly into the SAMSON interface.
- SAMSON will prompt you: do you want to embed or just link? Choose Embed.
- Alternatively, use Home > Embed files or Home > Embed folders.

The embedded files (scripts, images, even raw data) are now stored within the document itself. This means the document is portable and can be easily sent via email, uploaded to GitHub, or hosted on SAMSON Connect.
Running Embedded Scripts
Once a script is embedded in a SAMSON document, double-click it to open and edit it in the integrated Code Editor, which uses the Monaco editor (the same core as Visual Studio Code). You can then run it directly using the Run button or the Python Console.
This is particularly useful for:
- Research publishing: Attach analysis scripts to molecular models for reproducibility.
- Teaching: Provide lecture notes and interactive assignments in a single file.
- Collaboration: Share complete modeling and simulation workflows with colleagues, including notes, data, and scripts.
Use Cases: Streamlining Science and Education
Whether you’re creating a machine learning pipeline for protein-ligand interaction classification, or a tutorial for students on docking simulations, embedding allows everything to stay synchronized.
You control what gets embedded: processed data, raw measurements, scripts for visualization, or automation routines. This approach maintains consistency for busy teams and helps students stay focused on key learning goals rather than debugging environments.
Interoperability and Sharing
Embedded documents can be opened on any system running SAMSON, with all files pre-loaded in exactly the same structure. You can distribute them via email or platforms like GitHub, or share them on SAMSON Connect – Documents.
All embedded content stays within the .sbn file, so everything you intended—whether that’s a deep learning app, analysis routines, or interactive assignments—gets across with zero setup required on the other end.
To explore these features in more detail, visit the official scripting documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. To get started, download SAMSON at https://www.samson-connect.net.
