PageRenderTime 38ms CodeModel.GetById 9ms app.highlight 24ms RepoModel.GetById 2ms app.codeStats 0ms

/tools/rgenetics/rgtest_one_tool.sh

https://bitbucket.org/cistrome/cistrome-harvard/
Shell | 224 lines | 164 code | 17 blank | 43 comment | 2 complexity | b55f7e270dbd3a6cc42ca9952bb07e12 MD5 | raw file
  1#!/bin/sh
  2# script to generate all functional test outputs for each rgenetics tool
  3# could be run at installation to ensure all dependencies are in place?
  4case $# in 0) echo "USAGE: ${0##*/} TooltoTest galaxyRoot outRoot"; exit 1;;
  5           [1-2]*) echo "Need ToolToTest and paths for galaxyRoot outRoot as parameters"; exit 2;;
  6           [5-10]*) echo "Too many arguments - ToolToTest and paths for galaxyRoot outRoot as parameters"; exit 2;;
  7           *)
  8esac
  9GALAXYROOT=$2
 10OUTROOT=$3
 11echo "using $GALAXYROOT"
 12# change this as needed for your local install
 13INPATH="${GALAXYROOT}/test-data"
 14JARPATH="${GALAXYROOT}/tool-data/shared/jars"
 15TOOLPATH="${GALAXYROOT}/tools/rgenetics"
 16OROOT="${OUTROOT}/test-data/rgtestouts"
 17NORMALOROOT="${OUTROOT}/test-data"
 18case "$1" in
 19'rgManQQ')
 20
 21TOOL="rgManQQ"
 22NPRE=${TOOL}test1
 23OUTPATH="$OROOT/$TOOL"
 24rm -rf $OUTPATH/*
 25CL="python $TOOLPATH/$TOOL.py "$INPATH/smallwgaP.xls" $NPRE ${OUTPATH}/${NPRE}.html $OUTPATH 1 2 7 0"
 26# rgManQQ.py '$input_file' "$name" '$out_html' '$out_html.files_path' '$chrom_col' '$offset_col' 
 27# '$pval_col'
 28#python /opt/galaxy/tools/rgenetics/rgManQQ.py /opt/galaxy/test-data/smallwgaP.xls rgManQQtest1 
 29#/opt/galaxy/test-data/rgtestouts/rgManQQ/rgManQQtest1.html /opt/galaxy/test-data/rgtestouts/rgManQQ 1 2 5,7 
 30echo "Testing $TOOL using $CL"
 31python $TOOLPATH/$TOOL.py "$INPATH/smallwgaP.xls" $NPRE ${OUTPATH}/${NPRE}.html $OUTPATH 1 2 7 0
 32;;
 33
 34'rgfakePhe')
 35TOOL="rgfakePhe"
 36NPRE=${TOOL}test1
 37OUTPATH="$OROOT/$TOOL"
 38rm -rf $OUTPATH/*
 39PSSCRIPT="$OUTPATH/script_file"
 40echo "{'pN':'normtest','pT':'rnorm','pP':\"{'Mean':'100', 'SD':'10'}\"}" > $PSSCRIPT
 41echo "{'pN':'cattest','pT':'cat','pP':\"{'values':'red,green,blue'}\"}" >> $PSSCRIPT
 42echo "{'pN':'uniftest','pT':'$f.series.phetype','pP':\"{'low':'1','hi':'100'}\"}" >> $PSSCRIPT
 43echo "{'pN':'gammatest','pT':'rgamma','pP':\"{'Alpha':'1', 'Beta':'0.1'}\"}" >> $PSSCRIPT
 44echo "{'pN':'poissontest','pT':'poisson','pP':\"{'lamb':'1.0',}\"}" >> $PSSCRIPT
 45echo "{'pN':'exptest','pT':'exponential','pP':\"{'Mean':'100.0',}\"}" >> $PSSCRIPT
 46echo "{'pN':'weibtest','pT':'weibull','pP':\"{'Alpha':'1.0', 'Beta':'0.1'}\"}" >> $PSSCRIPT
 47echo "now doing $TOOL"
 48python $TOOLPATH/$TOOL.py ${INPATH}/tinywga $NPRE $NPRE.pphe $OUTPATH $PSSCRIPT
 49#   <command interpreter="python">rgfakePhe.py '$infile1.extra_files_path/$infile1.metadata.base_name'
 50#   "$title1" '$ppheout' '$ppheout.files_path' '$script_file'
 51#
 52;;
 53'rgQC')
 54
 55TOOL="rgQC"
 56NPRE=${TOOL}test1
 57echo "now doing $TOOL"
 58OUTPATH="$OROOT/$TOOL"
 59rm -rf $OUTPATH/*
 60CMD="python $TOOLPATH/$TOOL.py -i $INPATH/tinywga -o $NPRE -s ${OUTPATH}/${NPRE}.html -p $OUTPATH"
 61echo "doing $CMD"
 62$CMD
 63# rgQC.py -i '$input_file.extra_files_path/$input_file.metadata.base_name' -o "$out_prefix" 
 64# -s '$html_file' -p '$html_file.files_path' 
 65#
 66;;
 67
 68'rgGRR')
 69TOOL="rgGRR"
 70NPRE=${TOOL}test1
 71echo "now doing $TOOL"
 72OUTPATH="$OROOT/$TOOL"
 73rm -rf $OUTPATH/*
 74cmd="$TOOLPATH/$TOOL.py "$INPATH/tinywga" "tinywga" $OUTPATH/${NPRE}.html $OUTPATH "$NPRE" '100' '6' 'true'"
 75echo "Doing $cmd"
 76python $TOOLPATH/$TOOL.py "$INPATH/tinywga" "tinywga" $OUTPATH/${NPRE}.html $OUTPATH "$NPRE" '100' '6' 
 77# rgGRR.py $i.extra_files_path/$i.metadata.base_name "$i.metadata.base_name"
 78#'$out_file1' '$out_file1.files_path' "$title"  '$n' '$Z' 
 79;;
 80'rgLDIndep')
 81TOOL="rgLDIndep"
 82NPRE=${TOOL}test1
 83OUTPATH="$OROOT/$TOOL"
 84rm -rf $OUTPATH/*
 85python $TOOLPATH/$TOOL.py "$INPATH" "tinywga" "$NPRE" 1 1 0 0 1 1 $OUTPATH/${NPRE}.pbed $OUTPATH 10000 5000 0.1 
 86#rgLDIndep.py '$input_file.extra_files_path' '$input_file.metadata.base_name' '$title' '$mind'
 87# '$geno' '$hwe' '$maf' '$mef' '$mei' '$out_file1'
 88#'$out_file1.files_path'  '$window' '$step' '$r2' 
 89;;
 90
 91'rgPedSub')
 92TOOL="rgPedSub"
 93NPRE=${TOOL}test1
 94OUTPATH="$OROOT/$TOOL"
 95rm -rf $OUTPATH/*
 96PSSCRIPT="$OUTPATH/pedsub.script"
 97echo "title~~~~$NPRE" > $PSSCRIPT
 98echo "output1~~~~${OUTPATH}/${NPRE}.lped" >> $PSSCRIPT
 99echo "outformat~~~~lped" >> $PSSCRIPT
100echo "basename~~~~tinywga" >> $PSSCRIPT
101echo "inped~~~~$INPATH/tinywga" >> $PSSCRIPT
102echo "outdir~~~~$OUTPATH" >> $PSSCRIPT
103echo "region~~~~" >> $PSSCRIPT
104echo "relfilter~~~~all" >> $PSSCRIPT
105echo "rslist~~~~rs2283802Xrs2267000Xrs16997606Xrs4820537Xrs3788347Xrs756632Xrs4820539Xrs2283804Xrs2267006Xrs4822363X" >> $PSSCRIPT
106echo "now doing $TOOL"
107python $TOOLPATH/$TOOL.py $PSSCRIPT
108rm -rf $PSSCRIPT
109;;
110
111'rgfakePhe')
112
113TOOL="rgfakePhe"
114NPRE=${TOOL}test1
115OUTPATH="$OROOT/$TOOL"
116rm -rf $OUTPATH/*
117PSSCRIPT="$OUTPATH/script_file"
118echo "{'pN':'normtest','pT':'rnorm','pP':\"{'Mean':'100', 'SD':'10'}\"}" > $PSSCRIPT
119echo "{'pN':'cattest','pT':'cat','pP':\"{'values':'red,green,blue'}\"}" >> $PSSCRIPT
120echo "{'pN':'uniftest','pT':'$f.series.phetype','pP':\"{'low':'1','hi':'100'}\"}" >> $PSSCRIPT
121echo "{'pN':'gammatest','pT':'rgamma','pP':\"{'Alpha':'1', 'Beta':'0.1'}\"}" >> $PSSCRIPT
122echo "{'pN':'poissontest','pT':'poisson','pP':\"{'lamb':'1.0',}\"}" >> $PSSCRIPT
123echo "{'pN':'exptest','pT':'exponential','pP':\"{'Mean':'100.0',}\"}" >> $PSSCRIPT
124echo "{'pN':'weibtest','pT':'weibull','pP':\"{'Alpha':'1.0', 'Beta':'0.1'}\"}" >> $PSSCRIPT
125echo "now doing $TOOL"
126python $TOOLPATH/$TOOL.py $PSSCRIPT
127;;
128
129'rgClean')
130TOOL="rgClean"
131NPRE=${TOOL}test1
132OUTPATH="$OROOT/$TOOL"
133rm -rf $OUTPATH/*
134python $TOOLPATH/$TOOL.py $INPATH "tinywga" "$NPRE" 1 1 0 0 1 1 $OUTPATH/${NPRE}.pbed $OUTPATH 0 0 0 0
135# rgClean.py '$input_file.extra_files_path' '$input_file.metadata.base_name' '$title' '$mind'
136#        '$geno' '$hwe' '$maf' '$mef' '$mei' '$out_file1' '$out_file1.files_path'
137#        '${GALAXY_DATA_INDEX_DIR}/rg/bin/plink' '$relfilter' '$afffilter' '$sexfilter' '$fixaff'
138#
139;;
140
141'rgEigPCA')
142
143TOOL="rgEigPCA"
144NPRE=${TOOL}test1
145OUTPATH="$OROOT/$TOOL"
146rm -rf $OUTPATH/*
147python $TOOLPATH/$TOOL.py "$INPATH/tinywga" "$NPRE" ${OUTPATH}/${NPRE}.html $OUTPATH 4 2 2 2 $OUTPATH/rgEigPCAtest1.txt
148#    rgEigPCA.py "$i.extra_files_path/$i.metadata.base_name" "$title" "$out_file1"
149#    "$out_file1.files_path" "$k" "$m" "$t" "$s" "$pca" 
150#
151;;
152
153'rgfakePed')
154TOOL="rgfakePed"
155NPRE=${TOOL}test1
156OUTPATH="$OROOT/$TOOL"
157rm -rf $OUTPATH/*
158echo "now doing $TOOL"
159python $TOOLPATH/$TOOL.py --title "$NPRE" -o $OUTPATH/${NPRE}.lped -p $OUTPATH -c "20" -n "40" -s "10" -w "0" -v "0" -l "pbed" -d "T" -m "0" -M "0"
160#rgfakePed.py --title '$title1' 
161#  -o '$out_file1' -p '$out_file1.extra_files_path' -c '$ncases' -n '$ntotal'
162#  -s '$nsnp'  -w '$lowmaf' -v '$missingValue' -l '$outFormat'
163#  -d '$mafdist' -m '$missingRate' -M '$mendelRate'
164;;
165
166'rgHaploView')
167
168TOOL="rgHaploView"
169NPRE=${TOOL}test1
170OUTPATH="$OROOT/$TOOL"
171rm -rf $OUTPATH/*
172CL="python $TOOLPATH/$TOOL.py ''  'rs2283802 rs2267000 rs16997606 rs4820537 rs3788347 rs756632 rs4820539 rs2283804 rs2267006 rs4822363' '$NPRE' $OUTPATH/${NPRE}.html  '$INPATH' 'tinywga' 0.0 200000 'RSQ' 'lo' '2048' '$OUTPATH' 'noinfo' '0.8' 'YRI' $JARPATH/haploview.jar"
173echo "Testing $TOOL using $CL"
174python $TOOLPATH/$TOOL.py ""  "rs2283802 rs2267000 rs16997606 rs4820537 rs3788347 rs756632 rs4820539 rs2283804 rs2267006 rs4822363" \
175"$NPRE" $OUTPATH/${NPRE}.html  "$INPATH" "tinywga" 0.0 200000 "RSQ" "lo" "2048" "$OUTPATH" "noinfo" "0.8" "YRI" $JARPATH/haploview.jar
176#  rgHaploView.py "$ucsc_region" "$rslist" "$title" "$output1"  
177#  "$lhistIn.extra_files_path" "$lhistIn.metadata.base_name"
178#  "$minmaf" "$maxdist" "$ldtype" "$hires" "$memsize" "$output1.files_path" 
179#  "$infoTrack" "$tagr2" "$hmpanel" ${GALAXY_DATA_INDEX_DIR}/rg/bin/haploview.jar
180# note these statistical tools do NOT generate composite outputs
181;;
182
183'rgGLM')
184TOOL="rgGLM"
185NPRE=${TOOL}test1
186OUTPATH=$NORMALOROOT
187python $TOOLPATH/$TOOL.py "$INPATH/tinywga" $INPATH/tinywga "$NPRE" "c1" "" $OUTPATH/${NPRE}_GLM.xls \
188$OUTPATH/${NPRE}_GLM_log.txt "tinywga" "" "" "" 1 1 0 0 $OUTPATH/${NPRE}_GLM_topTable.gff 
189##        rgGLM.py '$i.extra_files_path/$i.metadata.base_name' '$phef.extra_files_path/$phef.metadata.base_name'
190##        "$title1" '$predvar' '$covar' '$out_file1' '$logf' '$dbkey' '$i.metadata.base_name'
191##        '$inter' '$cond' '$gender' '$mind' '$geno' '$maf' '$logistic' '$gffout'
192;;
193
194'rgTDT')
195TOOL="rgTDT"
196NPRE=${TOOL}test1
197OUTPATH=$NORMALOROOT
198python $TOOLPATH/$TOOL.py -i "$INPATH/tinywga"  -o "$NPRE" -r $OUTPATH/${NPRE}_TDT.xls \
199-l $OUTPATH/${NPRE}_TDT_log.txt -g $OUTPATH/${NPRE}_TDT_topTable.gff
200##        rgTDT.py -i '$infile.extra_files_path/$infile.metadata.base_name' -o '$title'
201##        -r '$out_file1' -l '$logf' -x '${GALAXY_DATA_INDEX_DIR}/rg/bin/plink'
202##        -g '$gffout'
203;;
204
205'rgCaCo')
206TOOL="rgCaCo"
207NPRE=${TOOL}test1
208OUTPATH=$NORMALOROOT
209echo "now doing $TOOL"
210python $TOOLPATH/rgCaCo.py $INPATH/tinywga "$NPRE" $OUTPATH/${NPRE}_CaCo.xls $OUTPATH/${NPRE}_CaCo_log.txt $OUTPATH $OUTPATH/${NPRE}_CaCo_topTable.gff
211# rgCaCo.py '$i.extra_files_path/$i.metadata.base_name' "$name"  '$out_file1' '$logf' '$logf.files_path' '$gffout'
212;;
213
214'rgQQ')
215TOOL="rgQQ"
216echo "now doing $TOOL"
217NPRE=${TOOL}test1
218OUTPATH=$NORMALOROOT
219CL="python $TOOLPATH/$TOOL.py "$INPATH/tinywga.pphe" "$NPRE" 1 3 $OUTPATH/$NPRE.pdf 8 10 "false" 1 $OUTPATH"
220echo "running $TOOL using $CL"
221python $TOOLPATH/$TOOL.py "$INPATH/tinywga.pphe" "$NPRE" 1 3 $OUTPATH/$NPRE.pdf 8 10 "false" 1 $OUTPATH
222# rgQQ.py "$input1" "$name" $sample "$cols" $allqq $height $width $log $allqq.id $__new_file_path__ 
223;;
224esac