-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun
More file actions
executable file
·38 lines (32 loc) · 1013 Bytes
/
run
File metadata and controls
executable file
·38 lines (32 loc) · 1013 Bytes
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
#!/bin/bash
#SBATCH -J spacetop-fmriprep
#SBATCH -o logs/%a.log
#SBATCH -t 16:00:00
#SBATCH -p normal
#SBATCH -N 1 -n 1
#SBATCH -A A2CPS
PS4='+ $(date) '
set -uex
ROOT="${SLURM_SUBMIT_DIR}"
IMAGE=code/containers/fmriprep_25_1_4.sif
SOURCEDATA="${ROOT}"/sourcedata
RAWDATA="${SOURCEDATA}"/raw
if ((SLURM_ARRAY_TASK_ID > 116)); then
printf "The Slurm array ID is too high. There are only 117 participants [IDs: 0-116].\n" >&2
exit 1
fi
mapfile -t subs < <(find "${RAWDATA}" -mindepth 1 -maxdepth 1 -type d -name "sub-*" | sort | grep -oP "(?<=sub-)[0-9]+")
participant_label="${subs[${SLURM_ARRAY_TASK_ID}]}"
apptainer run \
--bind "${ROOT}" \
--env TEMPLATEFLOW_HOME="${SOURCEDATA}"/templateflow \
${IMAGE} \
--fs-license "${ROOT}"/code/license \
--participant-label "${participant_label}" \
--skip-bids-validation \
--ignore slicetiming \
--dummy-scans 6 \
--cifti-output 91k \
--mem 100000 \
-w ${SCRATCH}/work \
sourcedata/raw "${ROOT}" participant