Configuring the workflow¶
In this tutorial, we’ll see how to configure the workflow to change the parameters of bioinformatics tools. We’ll configure it before starting a new run, and then make adjustments at runtime.
Editing the user config¶
Go to the workflow source directory. It should be at ~/cylc-src/bioreactor-workflow.
Inside, you’ll find rose-suite.conf, which is a global configuration file for the user:
[template variables]
# Fraction of max(TIC). Only scans above it will be kept by binneR.
cfg__tic_threshold=0.50
# Tolerance (ppm) for metabolite identification.
cfg__ppm_tol=10
# ...
Actually, you may find a tolerance of 10 ppm to be a bit too high. Open the file in a text editor,
and reduce the value of rose-suite.conf[template variables]cfg__ppm_tol to 1.
- cfg__ppm_tol=10
+ cfg__ppm_tol=1
Additional input data configuration¶
Back to the root of the source directory, you may notice config/. This directory contains
additional input data that can be provided by the user, most notably the table compounds_db.csv
which holds the list of metabolites for annotations.
Let’s add deoxycytidine to it:
227mcitrate;bigg_226;mCitrate;C7H710O7;910.5129;[M-H];-1;0.3;13c-glucose;;
228thiamine;;Thiamine;C12H17N4OS;266.11958;[M+H];1;0.3;thiamine;;
229+ dcytidine;bigg_227;dCytidine;C9H12N2O5;241.01824;[M-H];-1;0.3;13c-glucose;;
Now, if there is a signal near 241.01824 m/z, it will be annotated as dcytidine.
Processing data with the modified configuration¶
Now, let’s start a new run of the workflow. This time, we’re gonna use the composed command cylc vip (Validate, Install and Play) which both creates the run and starts it. Additionally, we’ll choose a custom name for our run:
$ cylc vip bioreactor-workflow --run-name=config-tutorial
cylc validate ~/cylc-src/bioreactor-workflow
Valid for cylc-8.2.4
cylc install ~/cylc-src/bioreactor-workflow
INSTALLED bioreactor-workflow/config-tutorial from ~/cylc-src/bioreactor-workflow
cylc play bioreactor-workflow/config-tutorial
2024-06-18T10:12:14+02:00 INFO - Extracting job.sh to ~/cylc-run/bioreactor-workflow/config-tutorial/.service/etc/job.sh
bioreactor-workflow/config-tutorial: your-computer.local PID=44662
Warning
run1/ in ~/cylc-run/bioreactor-workflow/
from the previous tutorial.~/cylc-run/bioreactor-workflow/ has to be cleaned beforehand.Make sure this workflow run has the updated configuration:
$ cylc config bioreactor-workflow/config-tutorial | grep 'ppm_tol ='
ppm_tol = 1
We’re gonna analyse the same raw data we used during the tutorial. As before,
copy std_30sec_CarboAmmo_10mM_01.raw into the raws/ subfolder of the run directory.
You can monitor that the file is correctly processed using the TUI.
Once it’s done, go look at std_30sec_CarboAmmo_10mM_01.matches.csv located in
./share/cycle/1/dataflow/. If you look at the values in the delta_ppm column, you’ll see
that they all in the ]-1,1[ interval.
Maybe a tolerance of 1 ppm was a bit too stringent. We’re probably getting a lot of false-negatives.
We’re gonna change the configuration while bioreactor-workflow/config-tutorial is still running.
Changing the config at runtime¶
Reinstalling the source and its config¶
Edit back rose-suite.conf from the source directory.
- cfg__ppm_tol=1
+ cfg__ppm_tol=5
Then, you can broadcast the change you made in the source to the config-tutorial run using the cylc vr composed command:
$ cylc vr --yes bioreactor-workflow/config-tutorial
cylc validate --against-source bioreactor-workflow/config-test
Valid for cylc-8.2.4
cylc reinstall bioreactor-workflow/config-test
REINSTALLED bioreactor-workflow/config-test from /Users/elliotfontaine/Documents/github/RTMet/cylc-src/bioreactor-workflow
Successfully reinstalled.
cylc reload bioreactor-workflow/config-test
Done
And verify it has been correctly updated:
$ cylc config bioreactor-workflow/config-tutorial | grep 'ppm_tol ='
ppm_tol = 5
Note
You can also use the reinstall-reload button inside the context menu of the TUI.
Reloading the run config file¶
In the run directory, locate the copy of rose-suite.conf. Ignoring
the fact that the config options are disordered, find the annotation tolerance and change its value.
- cfg__ppm_tol=5
+ cfg__ppm_tol=20
Now, reload the configuration and check that the config is correctly updated:
$ cylc reload bioreactor-workflow/config-tutorial
Done
$ cylc config bioreactor-workflow/config-tutorial | grep 'ppm_tol ='
ppm_tol = 20
Note
You can also use the reload button inside the context menu of the TUI.
This will propagate to any new annotation task, but it won’t redo the one for
std_30sec_CarboAmmo_10mM_01.raw.
This edit only applies to the config-tutorial run, any new run installed will copy the config file in the source directory.