Submitting an official Workflow
This section shows the usage of the DatomaWorkflow module, exemplifying how to submit official workflows to Datoma’s infrastructure.
In this example, we submit an official workflow that executes RMSI and peakmatannotation:
We first create the
DatomaWorkflowobject, specifying theofficial_name.Next, we set the parameters of the job that we want to modify from the standard
rmsi2model (which is the key identifying ourRMSItask).Then, we set local files as the global input.
Finally, we submit the workflow to Datoma’s infrastructure and download the output files.
# Make the necessary imports
from datoma import DatomaWorkflow
# Create a DatomaWorkflow object
dw = DatomaWorkflow(official_name = 'rmsiannotation')
# Create a dictionary with parameters to modify from default values
params_dict = {'preprocessing:smoothing:enable': False,
'preprocessing:smoothing:kernelsize': 8,
'preprocessing:alignment:bilinear': True,
'preprocessing:alignment:maxShiftppm': 20}
# Set parameters of the job you want to modify
dw.set_params('rmsi2', params_dict)
# Create a dictionary with input data, specifying key and value(s)
global_input_dict = {"imaging_files":[{"file":"/path/to/file.ibd"},
{"file":"/path/to/file.imzML"}]}
# Set the global input of the workflow
dw.set_global_input(global_input_dict, preserve_name = True)
# Submit the workflow to Datoma's infrastructure, you can name it if you want
dw.submit(name = "rmsiannotation_execution")
# Check the status of the workflow, when it finishes, the output files will be downloaded
await dw.download(output_path="path/to/output/folder")
# Check the status of the workflow, when it finishes, the output files will be listed
print(await dw.list_outputs(regex=".*\.imzML"))
To see how to create unofficial DatomaWorkflow instances, refer to Submitting an unofficial workflow.
If you want to see a more complex usage of DatomaWorkflow, refer to Leveraging Datoma’s potential.