Skip to content

flex_wrapper

Ekarin Eric Pongpipat edited this page Sep 12, 2024 · 4 revisions

flex_wrapper

Function that loops over a set of scripts and set of ids.

You have to create a scripts text file and an IDs text file.

Example

code/scripts.txt

pipeline-1/step-1.sh
pipeline-1/step-2.sh
pipeline-2/step-1.sh
pipeline-2/step-2.sh

A new line for each script

code/ids.csv

study,sub,ses
ds001,001,01
ds001,001,02
ds001,002,01
ds001,002,02
ds001,003,01
ds001,003,02

A new for each ID

usage

You can run all of the scripts for each subject

flex_wrapper --in-scripts code/scripts.txt --in-ids code/ids.csv --scripts-idx all --ids-idx all

You can also run a subset of either the scripts or IDs by indexing the row to run, respectively

flex_wrapper --in-scripts code/scripts.txt --in-ids code/ids.csv --scripts-idx 1:2 --ids-idx 1,5

You can also use parallel engines

flex_wrapper --in-scripts code/scripts.txt --in-ids code/ids.csv --scripts-idx all --ids-idx all --pe slurm
Clone this wiki locally