This shows you the differences between two versions of the page.
biac:cluster:examples:featlevel1 [2014/08/04 16:03] 127.0.0.1 external edit |
biac:cluster:examples:featlevel1 [2023/02/23 18:43] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== FEAT Level 1 Example Cluster Scripts ====== | ||
- | These example scripts will allow you to run all of the FEAT level one analyses (intra-subject run-by-run) in parallel on the cluster. | ||
- | As with previous FSL scripts, the 1st level template fsf file must first be created using the FEAT GUI and saved with keywords replacing any fields that are subject dependent. | ||
- | |||
- | ===== qsub_feat_level1 ===== | ||
- | Example usage: | ||
- | < | ||
- | [user@head ~]$ ./ | ||
- | |||
- | Or, if the file has been set (using the " | ||
- | [user@head ~]$ qsub_feat_level1 99999 | ||
- | </ | ||
- | |||
- | Copy and edit code below: | ||
- | <code bash> | ||
- | #!/bin/bash | ||
- | # First input is exam number | ||
- | |||
- | SUBJ=$1 | ||
- | |||
- | # Loop through the runs submitting a job to grid engine for each run | ||
- | for i in 01 02 03 04 05 06 07 08 | ||
- | do | ||
- | |||
- | # Call qsub_feat_level1_onerun | ||
- | # Creates an fsf file and runs feat on that fsf file for one run | ||
- | # Two input arguments: | ||
- | qsub -v EXPERIMENT=Dummy.01 qsub_feat_level1_onerun $SUBJ run${i} | ||
- | |||
- | done | ||
- | </ | ||
- | |||
- | ===== qsub_feat_level1_onerun ===== | ||
- | Example usage: | ||
- | < | ||
- | |||
- | Copy and edit code below: | ||
- | <code bash> | ||
- | #!/bin/sh | ||
- | |||
- | # This is a BIAC template script for jobs on the cluster | ||
- | # You have to provide the Experiment on command line | ||
- | # when you submit the job the cluster. | ||
- | # | ||
- | # > qsub -v EXPERIMENT=Dummy.01 | ||
- | # | ||
- | # There are 2 USER sections | ||
- | # 1. USER DIRECTIVE: If you want mail notifications when | ||
- | # your job is completed or fails you need to set the | ||
- | # | ||
- | # | ||
- | # 2. USER SCRIPT: Add the user script in this section. | ||
- | # | ||
- | # | ||
- | # eg: $EXPERIMENT/ | ||
- | # By default all terminal output is routed to the " Analysis " | ||
- | # | ||
- | # To change this path, set the OUTDIR variable in this section | ||
- | # to another location under your experiment folder | ||
- | # eg: OUTDIR=$EXPERIMENT/ | ||
- | # By default on successful completion the job will return 0 | ||
- | # If you need to set another return code, set the RETURNCODE | ||
- | # | ||
- | # | ||
- | # eg: RETURNCODE=110 | ||
- | # | ||
- | # | ||
- | # The remaining sections are setup related and don't require | ||
- | # modifications for most scripts. They are critical for access | ||
- | # to your data | ||
- | |||
- | # --- BEGIN GLOBAL DIRECTIVE -- | ||
- | #$ -S /bin/sh | ||
- | #$ -o $HOME/ | ||
- | #$ -e $HOME/ | ||
- | #$ -m ea | ||
- | # -- END GLOBAL DIRECTIVE -- | ||
- | |||
- | # -- BEGIN PRE-USER -- | ||
- | #Name of experiment whose data you want to access | ||
- | EXPERIMENT=${EXPERIMENT:?" | ||
- | |||
- | source / | ||
- | |||
- | EXPERIMENT=`biacmount $EXPERIMENT` | ||
- | EXPERIMENT=${EXPERIMENT:?" | ||
- | |||
- | if [ $EXPERIMENT = " | ||
- | then | ||
- | exit 32 | ||
- | else | ||
- | #Timestamp | ||
- | echo " | ||
- | # -- END PRE-USER -- | ||
- | # ********************************************************** | ||
- | |||
- | # -- BEGIN USER DIRECTIVE -- | ||
- | # Send notifications to the following address | ||
- | #$ -M user@somewhere.edu | ||
- | |||
- | # -- END USER DIRECTIVE -- | ||
- | |||
- | # -- BEGIN USER SCRIPT -- | ||
- | # User script goes here | ||
- | |||
- | #Need to input EXPERIMENT, SUBJ and RUN NAME | ||
- | #Example qsub -v EXPERIMENT=Dummy.01 qsub_feat_level1_onerun 99999 run01 | ||
- | SUBJ=$1 | ||
- | RUN=$2 | ||
- | |||
- | #Set the directories | ||
- | FUNCDIR=$EXPERIMENT/ | ||
- | BEHAVDIR=$EXPERIMENT/ | ||
- | ANAT=$EXPERIMENT/ | ||
- | TEMPLATEDIR=$EXPERIMENT/ | ||
- | OUTDIR=$EXPERIMENT/ | ||
- | |||
- | #Set some variables | ||
- | OUTPUT=$OUTDIR/ | ||
- | DATA=$FUNCDIR/ | ||
- | ORIENT=$FUNCDIR/ | ||
- | |||
- | TARG=$BEHAVDIR/ | ||
- | NEUT=$BEHAVDIR/ | ||
- | SCARY=$BEHAVDIR/ | ||
- | |||
- | mkdir -p $OUTDIR | ||
- | cd $TEMPLATEDIR | ||
- | |||
- | #Makes the fsf file using the template | ||
- | for i in ' | ||
- | sed -e ' | ||
- | -e ' | ||
- | -e ' | ||
- | -e ' | ||
- | -e ' | ||
- | -e ' | ||
- | -e ' | ||
- | -e ' | ||
- | done | ||
- | |||
- | #Run feat analysis | ||
- | feat ${OUTDIR}/ | ||
- | |||
- | |||
- | |||
- | # -- END USER SCRIPT -- # | ||
- | |||
- | # ********************************************************** | ||
- | # -- BEGIN POST-USER -- | ||
- | echo " | ||
- | OUTDIR=${OUTDIR: | ||
- | mv $HOME/ | ||
- | RETURNCODE=${RETURNCODE: | ||
- | exit $RETURNCODE | ||
- | fi | ||
- | # -- END POST USER-- | ||
- | |||
- | </ |