Mercurial > repos > modencode-dcc > idr_package
comparison idrPlotWrapper.sh @ 13:1a1f369b4baf draft
Uploaded
| author | modencode-dcc |
|---|---|
| date | Mon, 21 Jan 2013 10:57:59 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 12:5be09cb9a7ed | 13:1a1f369b4baf |
|---|---|
| 1 #!/bin/bash | |
| 2 | |
| 3 # idrPlotWrapper.sh | |
| 4 # OICR: Kar Ming Chu | |
| 5 # July 2012 | |
| 6 | |
| 7 # BASH wrapper for batch-consistency-plot.r (part of the IDR package) | |
| 8 # For use with Galaxy | |
| 9 | |
| 10 # Usage of batch-consistency-plot.r: Rscript batch-consistency-plot-merged.r [npairs] [output.dir] [input.file.prefix 1, 2, 3 ...] | |
| 11 # npairs - will be a constant, since Galaxy requires explicit control over input and output files | |
| 12 | |
| 13 # Usage of THIS SCRIPT: ./idrPlotWrapper.sh em uri outputfile | |
| 14 # em - em.sav file provided by Galaxy | |
| 15 # uri - uri.sav file provided by Galaxy | |
| 16 # outputfile - output file name specified by Galaxy | |
| 17 | |
| 18 main() { | |
| 19 EM="${1}" # absolute file path to em.sav file, provided by Galaxy | |
| 20 URI="${2}" # absolute file parth to uri.sav file, provided by Galaxy | |
| 21 OUTFILE="${3}" # name of desired output file | |
| 22 script_path="${4}" | |
| 23 | |
| 24 cp "${EM}" ./idrPlot-em.sav # cp to this directory and rename so they can be found by idrPlot | |
| 25 cp "${URI}" ./idrPlot-uri.sav | |
| 26 | |
| 27 Rscript "$script_path/batch-consistency-plot.r" "$script_path" 1 ./idrPlot idrPlot | |
| 28 | |
| 29 # convert post script to pdf file | |
| 30 ps2pdf ./idrPlot-plot.ps ./idrPlot-plot.pdf | |
| 31 | |
| 32 # rename to output file name | |
| 33 mv ./idrPlot-plot.pdf "${OUTFILE}" | |
| 34 | |
| 35 # clean up | |
| 36 rm idrPlot-em.sav | |
| 37 rm idrPlot-uri.sav | |
| 38 } | |
| 39 | |
| 40 main "${@}" |
