Make the model travel with the method

A molecular model is often only part of a research workflow. The analysis script may be in one folder, input data in another, and the steps needed to reproduce a result remembered by the person who ran it. When a colleague opens the model weeks later—or on another computer—those missing pieces can turn a useful handoff into a reconstruction exercise.

SAMSON documents can help keep related materials together. Alongside molecular models, a document can embed Python scripts and other files or folders. That makes it possible to share not only a structure, but also the scripts, data, notes, and supporting materials needed to understand how you worked with it.

Build a useful handoff

Start by collecting the materials that explain or reproduce the work: the model, relevant input files, Python scripts, and concise notes about what each script does. In SAMSON, drag files or folders into the application and choose whether to embed them, or use Home > Embed files or Home > Embed folders.

Dialog for embedding a file in a SAMSON document

Embedded files and folders are stored within the document, so the document can be transferred and shared as a self-contained package of project materials. This is particularly useful when the script depends on a local input file: keeping both together makes the relationship easier to inspect and reduces the chance that the file gets left behind.

Make the script understandable

A script is more useful to someone else when its purpose and expected inputs are clear. Add comments or a short accompanying note describing what it is intended to do, which files it uses, and what a successful run should produce. These are practical documentation habits, not special SAMSON requirements—and they can save a collaborator from having to infer your intent from code alone.

To inspect or edit an embedded Python script, double-click it to open it in the Code Editor. The editor supports Python scripts and can run them; you can also use the integrated Python Console for quick execution. Both provide access to the SAMSON Python API, which lets scripts work with SAMSON functionality.

SAMSON Code Editor interface

Pay attention to Python packages

Embedding a script does not automatically mean that every Python package it uses is available on another computer. SAMSON’s Python Package Manager can install and uninstall packages through pip. If your script relies on packages beyond the integrated environment, note their names—and, where relevant, the versions you used—so a recipient can check or install them. The Package Manager accepts version specifications such as foo==1.2.0.

For a package you are actively developing, SAMSON also supports local installation in editable/develop mode. That mode points Python to the package’s source files, so code changes can be reflected without reinstalling. It is useful during development, but it is not a substitute for including the package’s source or explaining how the recipient should obtain it. The documentation also notes that editable installations may not load on the next launch on some macOS installations.

Share the document, not just the instructions

Once the model and supporting files are together, share the SAMSON document through a channel that suits your project, such as email, GitHub, or SAMSON Connect Documents. A colleague or student can open the document, inspect its contents, and open an embedded script in the Code Editor. This approach can support research handoffs, teaching exercises, and analysis workflows attached to molecular models.

Before sending it, make a quick checklist: Are the necessary inputs embedded? Is the script’s purpose clear? Have you identified any Python package dependencies? Can another person tell what to run and what to expect? A few minutes spent on those details can make a shared molecular workflow substantially easier to reuse.

For more on the Python environment, package management, the Code Editor, and embedding files, see the SAMSON scripting documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.