-
Notifications
You must be signed in to change notification settings - Fork 1
/
print_experiments.sh
executable file
·60 lines (45 loc) · 2.67 KB
/
print_experiments.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
set -e
set -u
NTHREAD=1
MAX_JOBS=8
PROJECT_DIR=/mnt/lustre/mathdugre/mri-bottleneck
SIF_DIR=/mnt/lustre/mathdugre/containers
# Datatset preparation
cat << EOF
########################
# Datatset preparation #
########################
EOF
DATA_DIR=${PROJECT_DIR}/datasets/ds004513
DATALAD_URL="https://github.com/OpenNeuroDatasets/ds004513.git"
echo "datalad install -gr -J\$(nproc) --source ${DATALAD_URL} ${DATA_DIR}"
## Convert symlink to hardlink to prevent issue with preprocessing
echo "find ${DATA_DIR} -type l -exec bash -c 'ln -f \$(readlink -m \$0) \$0' {} \;"
N_SUBJECTS=$(find ${DATA_DIR} -maxdepth 1 -name "sub-*" | wc -l )
# Pipeline profiling
# PROJECT_DIR=${PROJECT_DIR}/test
cat << EOF
######################
# Pipeline profiling #
######################
EOF
## Anatomical MRI preprocessing
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/ants/brainExtraction.sh $SIF_DIR/ants-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/ants/brainExtraction-fp.sh $SIF_DIR/ants-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/fsl/fast.sh $SIF_DIR/fsl-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/ants/registrationSyN.sh $SIF_DIR/ants-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/ants/registrationSyN-fp.sh $SIF_DIR/ants-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/freesurfer/reconall.sh $SIF_DIR/freesurfer-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
## BOLD preprecessing
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/fsl/mcflirt.sh $SIF_DIR/fsl-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/fsl/flirt.sh $SIF_DIR/fsl-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
# AFNI 3dTshift
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/afni/3dTshift.sh $SIF_DIR/afni-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
# TODO
# FreeSurfer bbregister (?h.white)
# FSL MELODIC
## fMRIPrep workflow
echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/fmriprep/full.sh $SIF_DIR/fmriprep-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}
## dMRIPrep workflow
#echo sbatch --array=1-${N_SUBJECTS}%${MAX_JOBS} --cpus-per-task=${NTHREAD} sbatch/dmriprep/full.sh $SIF_DIR/dmriprep-debug.simg -d ${DATA_DIR} -p ${PROJECT_DIR}