Biodock Platform Script Guidelines
Overview
This guide provides instructions for running scripts on the Biodock platform via the new "Scripts" tab. Follow these steps to ensure your script functions correctly within the platform's environment.
1. Convert the Notebook to a Python Script
Convert your Jupyter notebook (.ipynb
) to a single Python script (.py
). Ensure that all necessary code and dependencies are included in the script file.
2. Handling Input Paths for Images and JSON Files
Biodock handles file management before invoking your script. All images and GeoJSON files will exist in the same filesystem as your script, so you do not need to download anything manually.
Modify your script to accept file paths via command-line arguments:
3. Writing Output Files
All output files should be written to the output_dir
. Any file in this directory will be automatically uploaded to the cloud and made accessible to the user.
Example:
4. Handling Matplotlib Plots
Replace all plt.show()
calls with plt.savefig()
to ensure that plots are saved instead of being displayed interactively. Save the files in output_dir
.
Example:
5. Remove Unnecessary Imports
Remove any imports related to Google Cloud or Google Colab, as these are not needed within the Biodock platform environment.
6. Specify Dependencies in requirements.txt
requirements.txt
Create a requirements.txt
file listing all the dependencies required for your script. Before execution, Biodock will create a new Python environment and install these dependencies.
Example requirements.txt
:
7. Uploading and Running Your Script
Once your script and requirements.txt
file are ready, follow these steps:
Place the
.py
file andrequirements.txt
in a single folder.On the Biodock platform, navigate to the Scripts tab.
Click Upload Script > Browse Folders and upload your script folder.
Once uploaded, go to the Runs sub-tab.
Click Run Script and specify the script and analysis job.
After execution, download the results, including:
Script outputs
Console output (print statements)
Error messages (if any)
Following these guidelines ensures that your script runs efficiently on the Biodock platform. If you have any questions, contact Biodock support for further assistance.
Last updated