-
Notifications
You must be signed in to change notification settings - Fork 0
/
func_cohort_maker.sh
32 lines (28 loc) · 1.43 KB
/
func_cohort_maker.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
#!/bin/bash
#
#generate xcpEngine cohorts for a new subject
#
# func_cohort_maker.sh {subject} {session} {fresh file? yes/no}
#
subject=$1
sesname=$2
fresh=$3
#If you wish to run a dataset for a participant for the first time or multiple participants individually to benefit the cluster nodes, set the fresh argument to yes
if [ $fresh == "yes" ];
then
echo "Generating new cohort_func file for xcpEngine"
echo "id0,img" > cohort_func_${subject}_${sesname}.csv
echo "${subject},derivatives/fmriprep/${subject}/${sesname}/func/${subject}_${sesname}_task-rest_dir-PA_run-1_space-MNI152NLin2009cAsym_res-1_desc-preproc_bold.nii.gz" >> cohort_func_${subject}_${sesname}.csv
elif [ $fresh == "no" ];
then
echo "Adding to cohort_func file for group processing in xcpEngine"
echo "If you are not interested in generating group-level outputs, consider running each subject with a fresh cohort_func.csv"
if [ -f "cohort_func.csv" ];
then
echo "${subject},derivatives/fmriprep/${subject}/${sesname}/func/${subject}_${sesname}_task-rest_dir-PA_run-1_space-MNI152NLin2009cAsym_res-1_desc-preproc_bold.nii.gz" >> cohort_func_${subject}_${sesname}.csv
else
echo "id0,img" > cohort_fun_c${subject}_${sesname}.csv
echo "${subject},derivatives/fmriprep/${subject}/${sesname}/func/${subject}_${sesname}_task-rest_dir-PA_run-1_space-MNI152NLin2009cAsym_res-1_desc-preproc_bold.nii.gz" >> cohort_func_${subject}_${sesname}.csv
fi
fi
chmod 777 cohort_func.csv