Batching models (shell)

################################################################################

#!/bin/bash

#List subjects.

SUBJECTS=”flu002 flu003 flu008 flu009 flu010 flu011 flu012 flu013 flu014 flu016 flu017 grm017″

#List onset file names.

PPIFILES=”ppi_reg_2 ppi_reg_3 ppi_reg_4 ppi_reg_5 ppi_reg_6 ppi_reg_7 ppi_reg_8″

for PPIFILE in $PPIFILES ; do

for SUBJECT in $SUBJECTS ; do

#change to the directories you want to run the analysis in.

cd /net/osx1927/chb/users/cbenjamin/gaabdata/data/fluency2/${SUBJECT}/

#Copy the template model (fsf) file into the current directory (in this case two first level models are copied across)

cp /net/osx1927/chb/users/cbenjamin/gaabdata/data/fluency2/b_templates/desppi*.fsf /net/osx1927/chb/users/cbenjamin/gaabdata/data/fluency2/${SUBJECT}/

#display date and time

date -u

#In the model files, replace the existing subject number; regressor file and output folder name to those for the current model.

sed -i “s/flu010/${SUBJECT}/g” *.fsf

sed -i “s/ppi_reg_1/${PPIFILE}/g” *.fsf

sed -i “s/ppiout/${PPIFILE}/g” *.fsf

#run the two models

feat desppi1.fsf

feat desppi2.fsf

done

done

Leave a comment