#!/bin/csh -ef # set usage="runTests -before|-after -outDirDepth n" # # Test script. Output is to large to save expected. Run this before # make changes with the -before option, make changes, then run with the # -after option. -outDirDepth n will run tests with this option # set phase="" set outDirDepth=0 set faOpts="" while ($#argv > 0) set opt=$argv[1] shift switch ($opt) case -before: set phase=before breaksw case -after: set phase=after breaksw case -outDirDepth: set outDirDepth=$argv[1] set faOpts=($faOpts -outDirDepth=$outDirDepth) shift breaksw default: echo "invalid option: $opt" > /dev/stderr echo $usage >/dev/stderr exit 1 endsw end if ("$phase" == "") then echo "must specify -before or -after" >/dev/stderr exit 1 endif set beforeDir=output/before/l$outDirDepth set phaseOut=output/$phase/l$outDirDepth set inDir=output/input if ($phase == "before") then if (-d $phaseOut) then echo "output directory exists, remove of specify a different option: " $phaseOut > /dev/stderr exit 1 endif else if ($phase == "after") then if (! -d $beforeDir) then echo "before directory doesn't exist: $beforeDir" >/dev/stderr exit 1 endif # remote after directory rm -rf $phaseOut endif mkdir -p $inDir # change if files disapear set inMrnaFa=/cluster/data/hg16/bed/celeraMrna/celeraMrna.fa set inChrFa=/cluster/data/hg16/22/chr22.fa set mrnaFa=$inDir/mrna.fa set chrFa=$inDir/chr.fa if ($phase == "before") then mkdir -p $inDir head -10000 $inMrnaFa >$mrnaFa head -20000 $inChrFa >$chrFa endif set echo mkdir -p $phaseOut/sequence faSplit $faOpts sequence $mrnaFa 100 $phaseOut/sequence/foo mkdir -p $phaseOut/base faSplit $faOpts base $chrFa 10 $phaseOut/base/foo mkdir -p $phaseOut/size faSplit $faOpts size $mrnaFa 2000 $phaseOut/size/foo mkdir -p $phaseOut/sizeOne faSplit -oneFile size $mrnaFa 2000 $phaseOut/sizeOne/foo mkdir -p $phaseOut/about faSplit $faOpts about $mrnaFa 2000 $phaseOut/about/foo mkdir -p $phaseOut/byname faSplit $faOpts byname $mrnaFa $phaseOut/byname/foo mkdir -p $phaseOut/gap faSplit $faOpts gap $chrFa 200 $phaseOut/gap/foo if ($phase == "after") then diff -r $beforeDir $phaseOut endif