Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- #SBATCH --ntasks=1
- #SBATCH --mem-per-cpu=10000
- #SBATCH --partition=pascalnodes
- #SBATCH --time=12:00:00
- #SBATCH --mail-type=FAIL
- #SBATCH --mail-user=snolin@uab.edu
- #SBATCH --job-name=FNstoV1tprob_%A_%a
- #SBATCH --gres=gpu:1
- #SBATCH --array=0-785%36
- #SBATCH --out=/data/scratch/snolin/HCP_jobs/prob/FNstoV1tproblog_%A_%a.txt
- #This scripts run FSL probtrackx from newcentral region of V1 to the Yeo parcellation of the frontoparietal network (net6), the mid-peripheral region of V1 to the cingulo opercular network (net4), and the far-peripheral region of V1 to the default mode network (net7).
- #location of job scripts and logs
- jobs=/data/scratch/snolin/HCP_jobs/prob
- #set location for output of probtrackx paths
- outp=/data/project/vislab/a/HCP_diff_Sara/FNstoV1tprob
- #set location for where target lists will go
- targ=$outp/targlists
- mkdir $targ
- #set location for where V1 segment labels exist
- lab=/data/project/vislab/a/HCP_diff_Sara/subjects_reconall_postcheckcopy
- #set location for where bedpostX directories are located
- bed=/data/project/vislab/raw/HCP_900sub/HCP_diff_unzip_preproc
- #location of participants you want to pull
- diff=/data/project/vislab/a/HCP_diff_Sara/subjects_reconall_postcheck
- FILES=(`ls -1 $diff`)
- patient=${FILES[$SLURM_ARRAY_TASK_ID]}
- #rename output file
- ln $jobs/FNstoV1tproblog_${SLURM_ARRAY_JOB_ID}_${SLURM_ARRAY_TASK_ID}.txt $jobs/FNstoV1tproblog$patient.txt
- for task in FP:newcentral:4 FP:mid:4 FP:newfar:4 CO:newcentral:6 CO:mid:6 CO:newfar:6 DMN:newcentral:7 DMN:mid:7 DMN:newfar:7
- do
- #parse task
- network=`echo $task | cut -d: -f1`
- V1=`echo $task | cut -d: -f2`
- netnum=`echo $task | cut -d: -f3`
- ##network to V1###
- #if [ -f $outp/${network}to${V1}/$patient/fdt_paths.nii.gz ]; then echo "${network}to${V1} has completed"
- #else
- #create folder structure
- cd $outp
- mkdir ${network}to${V1}
- cd ${network}to${V1}
- mkdir $patient
- #create target list
- cd $targ
- touch targets${network}to${V1}_$patient.txt
- echo "$lab/$patient/mri/${V1}V1_diffROI.nii" > targets${network}to${V1}_$patient.txt
- #Probtrackx run on network to ${V1} V1
- /share/apps/rc/software/FSL/5.0.9-centos6_64/bin/probtrackx2_gpu -x $lab/$patient/mri/net${netnum}_diffROI.nii -V 1 -l --onewaycondition -c 0.2 -S 2000 --steplength=0.5 -P 10000 --fibthresh=0.01 --distthresh=0.0 --sampvox=0.0 --forcedir --opd -s $bed/$patient/T1w/Diffusion.bedpostX/merged -m $bed/$patient/T1w/Diffusion.bedpostX/nodif_brain_mask --dir=$outp/${network}to${V1}/$patient --targetmasks=$targ/targets${network}to${V1}_$patient.txt --os2t
- #fi
- done
- rm $jobs/FNstoV1tproblog_${SLURM_ARRAY_JOB_ID}_${SLURM_ARRAY_TASK_ID}.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement