comparison idrPlotWrapper.sh @ 1:c6bfb8bcff93 draft

Uploaded
author modencode-dcc
date Thu, 17 Jan 2013 15:44:53 -0500
parents
children
comparison
equal deleted inserted replaced
0:369b8aa2f7bd 1:c6bfb8bcff93
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
23 cp "${EM}" ./idrPlot-em.sav # cp to this directory and rename so they can be found by idrPlot
24 cp "${URI}" ./idrPlot-uri.sav
25
26 Rscript /mnt/galaxyTools/galaxy-central/tools/modENCODE_DCC_tools/idr/batch-consistency-plot.r 1 ./idrPlot idrPlot
27
28 # convert post script to pdf file
29 ps2pdf ./idrPlot-plot.ps ./idrPlot-plot.pdf
30
31 # rename to output file name
32 mv ./idrPlot-plot.pdf "${OUTFILE}"
33
34 # clean up
35 rm idrPlot-em.sav
36 rm idrPlot-uri.sav
37 }
38
39 main "${@}"