Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page will show examples of different job submissions. Please refer to official Artemis documentation on job submission if you wish to understand the basics and explanation of the commands.

Submitting a job on a single subject

Example of running recon-all on FreeSurfer on a single subject (FTD001).

  1. Save the following script as a .pbs script. (e.g. reconall.pbs)

Code Block
#!/bin/bash -v
#PBS -P NeuroBMC
#PBS -N FreeSurfer_reconall
#PBS -l select=1:ncpus=4:mem=16GB
#PBS -l walltime=24:00:00
#PBS -q defaultQ

$PBS_O_WORKDIR

module load freesurfer/7.1.0
module load mrtrix3/3.0.1

cd /scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched

export SUBJECTS_DIR=/scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched

mrconvert /path/to/dicom/FTD001 /path/to/niftii/FTD001.nii -strides -1,2,3

recon-all -sd /scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched -subjid FTD001 -i /path/to/niftii/FTD001.nii -all

2. Run on Artemis by using qsub in the terminal

Code Block
qsub reconall.pbs

Submitting a job on multiple subjects (in parallel)

Example of running a recon-all script on FreeSurfer across multiple subjects.

  1. Set up your folders so every subject has the same folder structure.

  2. Create a .pbs file, replacing the subject (e.g. FTD001) with ${sub}

Code Block
#!/bin/bash -v
#PBS -P NeuroBMC
#PBS -N FreeSurfer_reconall
#PBS -l select=1:ncpus=4:mem=16GB
#PBS -l walltime=24:00:00
#PBS -q defaultQ

$PBS_O_WORKDIR

module load freesurfer/7.1.0
module load mrtrix3/3.0.1

cd /scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched

export SUBJECTS_DIR=/scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched

mrconvert /scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched/DICOM/${sub} /scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched/niftii/${sub}_T1w.nii -strides -1,2,3

recon-all -sd /scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched -subjid ${sub} -i /scratch/NeuroBMC/Cheng/DWI_mrtrix_longitudinal/Matched/niftii/${sub}_T1w.nii -all

3. Go to Artemis on terminal and specific what your subjects are (e.g. by labelling ‘list’).

Code Block
list='FTD001 FTD002 FTD0025 FTD802 FTD1011 FTD1200'

Tip: Instead of typing each subject itself, you can do this easily by copying and pasting from the ‘ls’ command, if you list a folder with all your subjects inside.

4. Submit the jobs via a ‘for loop’ in the Artemis terminal:

Code Block
for i in $list ; do qsub -v sub=$i reconall.pbs ; done