A molecular modeling task often starts simply: adjust a structure, repeat a set of operations, inspect the result, and record what you did. The trouble begins when the same sequence has to be repeated across many structures—or revisited weeks later. Manual repetition takes time, and small differences in how a task is carried out can make workflows harder to reproduce.
Python scripting in SAMSON offers a way to approach that problem. Instead of treating every task as a fresh sequence of clicks, you can use the integrated Python environment to run scripts and manage packages. For workflows that should travel with a project, SAMSON also supports embedding scripts or apps in documents. These options help connect automation to the molecular work itself, rather than leaving important steps scattered across notes and remembered procedures.
Start with a task you already repeat
Automation is most useful when it addresses a clear, recurring need. Pick one task that you perform regularly and describe it in plain language before writing any code. What is the starting point? Which steps do you repeat? What result tells you the task is complete? This small bit of planning makes it easier to decide whether a script would help and gives you a reference for checking its output.
Keep the first goal narrow. A single repeated operation is easier to understand and verify than an attempt to automate an entire modeling process at once. Once the small workflow is useful, you can consider whether it should become part of a larger sequence.
Make reproducibility part of the workflow
A script can make a procedure easier to repeat, but a useful workflow also needs to be understandable later. Record the purpose of the script, the inputs it expects, and the output or change you expect to see. If another person—or your future self—opens the project, this context can help explain why the script is there and when it should be used.
Document-embedded scripts or apps are especially relevant when the procedure belongs with a particular document. Keeping the workflow and its molecular context together can make it easier to share or revisit the work. It also gives collaborators a clearer starting point than a detached instruction such as “run the steps we used last time.”
Know when you need an extension
Not every need calls for custom development. If you want to add capabilities to SAMSON, first explore whether an existing extension fits. The extension path is also where developers can learn about the SDK and how extensions are distributed. In other words, scripting and extensions address related but different needs: use scripting to automate or package a workflow, and explore extensions when you want to add broader capabilities or understand development and distribution.
This distinction can save time. If your goal is simply to repeat a procedure, begin with scripting rather than assuming you need to build an extension. If your goal is to install new capabilities or investigate the SDK, go directly to the extension documentation.
A practical route through the documentation
- Start with Scripting for Python automation, package management, running scripts, and document-embedded workflows.
- Continue with Extending SAMSON if you want to manage extensions or explore the SDK and extension development path.
After setting up a repeatable workflow, the next step may be to apply it in modeling or analysis, or to share the scripted document with collaborators. Choose the path that matches the work you are doing; you do not need to study extension development if built-in capabilities already meet your needs.
For the complete overview and links to the related guides, see Automate and extend.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
