For molecular modelers who regularly write or experiment with small scripts to automate tasks or test algorithms, dealing with external script runners can be inconvenient. Switching between your molecular design environment and a text editor or terminal can break your workflow and slow you down.
If you’re using SAMSON, things can be simpler. SAMSON includes a built-in Code Editor that allows you to open, edit, and even execute .py Python scripts directly—without leaving the platform.
Why This Matters
Imagine wanting to analyze atomic distances across a series of conformations or automate part of your molecule-building process. Having to export the data, process it separately in Python, and re-import results is time-consuming and error-prone. With the streamlined support for Python scripts in SAMSON, you can work directly in the same environment where your molecular models live.
Working with Python in SAMSON
Save your Python script with a .py extension, and SAMSON will recognize it immediately. You can:
- Open it for inspection or modification
- Edit it in the internal Code Editor
- Save changes just like any other text file
- Execute the script directly from within SAMSON
This simple support for script execution opens the door to faster prototyping of analysis tools, automation of repetitive tasks, and development of custom features.
And It Gets Better
SAMSON scripting isn’t just limited to casual use. Because the environment supports full integration with the SAMSON’s API, you can interact with the molecular models programmatically—select atoms, apply transformations, fetch trajectories, and more.
When Is This Useful?
- If you regularly extract information like distances, angles, or torsions from structures
- If you’re building custom visualization workflows
- If you’re experimenting with machine learning models for molecule prediction and need to pre-process structures
- If you’re teaching scripting or computational chemistry classes and want students to have a single platform
Having everything available within one platform really simplifies how quickly you can test an idea.
What’s Supported?
According to the documentation:
.pyfiles are fully supported- You can read, edit, save, and most importantly, execute them inside SAMSON
To learn more and get started using Python scripting within SAMSON, visit the full documentation: https://documentation.samson-connect.net/users/latest/supported-formats/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
