A molecular model is easier to share when its workflow travels with it

A molecular project can be difficult to hand off for a simple reason: the structure is only part of the work. The steps that produced a result may live in a separate script, a researcher’s notes, or a folder of supporting files. When a colleague opens the model, they may not know which commands to run or which data belongs with it.

SAMSON documents can hold more than molecular models. They can also embed Python scripts, files, and folders, so a workflow’s materials can travel together in one document. That can make a project easier to review, teach, or continue on another computer.

Put the workflow beside the model

To add files or folders to a SAMSON document, drag and drop them into SAMSON and respond to the prompt, or use Home > Embed files or Home > Embed folders. The files are stored within the document, making it self-contained with respect to the materials you embed.

Dialog for embedding a file in a SAMSON document

This is useful when the context of a model matters as much as the coordinates. For example, a research handoff might include the model, a Python analysis script, and the data files the script uses. A teaching document might include a model alongside an exercise script and supporting materials. The point is not to turn every document into a software project; it is to keep the relevant pieces together when separation would make the work harder to understand.

Make the script accessible

Once a Python script is embedded, double-click it to open it in SAMSON’s Code Editor. The editor can modify text files and run Python files. You can also use the integrated Python Console for quick execution, or run a script from the editor using Run or its Run menu.

SAMSON Code Editor interface

SAMSON’s Python environment exposes the SAMSON Python API, which can be used to automate workflows and work with SAMSON functionality. The Code Editor also includes Python templates demonstrating API usage. If you need to create a script for a particular task, SAMSON AI’s /script command can draft Python code based on a request; treat generated code as a starting point and inspect it before relying on it.

A practical handoff checklist

  • Include the files someone needs to understand the task. Embed the relevant script and supporting data or folders, rather than sending a document with no explanation of its companion files.
  • Make the next action obvious. Use a clear script filename and, where helpful, include a short note in the document describing what the script is for.
  • Open and run the script from the document. Double-click an embedded script to open it in the Code Editor, then use the editor or Python Console to execute it.
  • Check package requirements. SAMSON provides a Python Package Manager under Python Console > Edit > Manage packages…. Embedding a script does not itself install the third-party Python packages it may require, so make package requirements clear to the recipient.
  • Test the handoff. Before sharing, reopen the document and check that the embedded materials are present and that the script can be opened. This catches avoidable confusion before it reaches a colleague or student.

Embedded files and folders can make a document easier to transfer and share. SAMSON documents can be distributed by email, GitHub, or SAMSON Connect Documents. Recipients can open the document and access its embedded materials; their ability to run a particular workflow may still depend on the software environment and required packages.

To learn more about the Python Console, package management, the Code Editor, and embedding scripts and apps, visit the SAMSON Scripting documentation.

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

Comments are closed.