forked from mvdoc/identity-decoding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_sl_bwsbj_singularity.sh
executable file
·62 lines (51 loc) · 1.26 KB
/
run_sl_bwsbj_singularity.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
60
61
62
#!/bin/bash -ex
IMGNAME="neurodocker.img"
BASEDIR=/idata/DBIC/castello/famface_angles
IMG=$BASEDIR/singularity/$IMGNAME
FMRIPREPDIR=$BASEDIR/derivatives103-budapest/fmriprep
FSDIR=$BASEDIR/derivatives103-budapest/freesurfer
GLMDIR=$BASEDIR/derivatives103-budapest/glm-blockrun-hpal-nosmooth
PYTHONWRAP="$BASEDIR"/scripts/python27
NCORES=16
programname=$0
function usage {
echo "usage: $programname target task hemi [deconvolve|remlfit] [permute]"
exit 1
}
if [ -z "$1" ]; then
usage
fi
TARG=$1
TASK=$2
HEMI=$3
DECON=$4
PERMUTE=$5
if [ $HEMI == L ]; then
H=lh
else
H=rh
fi
if [ -z "$DECON" ]; then
DECON=deconvolve
fi
OUTDIR=$BASEDIR/derivatives/slclfbwsbj-blockrun-"$DECON"-hpalsid000005fsaverage6
INPUT="$GLMDIR"/sub-*/sub-*_task-"$TASK"_space-hpalsid000005fsaverage6_hemi-"$HEMI"_"$DECON"-block.niml.dset
OUTPUT="$OUTDIR"/bwsbj_task-"$TASK"_space-hpalsid000005fsaverage6_hemi-"$HEMI"_target-"$TARG"_sl
if [ ! -z $PERMUTE ]; then
printf -v P "%03d" $PERMUTE
OUTPUT="$OUTPUT"_"$P"ip
CMD="--permute $PERMUTE"
fi
OUTPUT="$OUTPUT".niml.dset
CMD="$BASEDIR/scripts/02mvpa/run_sl_bwsbj.py \
-i $INPUT \
-t $TARG \
-o $OUTPUT \
-n $NCORES \
$CMD"
singularity run \
-B /idata \
-B /dartfs-hpc \
-e \
"$IMG" \
"$PYTHONWRAP" "$CMD"