annotate idrPlotWrapper.sh @ 4:bdd073e7ad8b draft

Uploaded
author modencode-dcc
date Thu, 17 Jan 2013 15:45:33 -0500
parents c6bfb8bcff93
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
1 #!/bin/bash
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
2
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
3 # idrPlotWrapper.sh
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
4 # OICR: Kar Ming Chu
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
5 # July 2012
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
6
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
7 # BASH wrapper for batch-consistency-plot.r (part of the IDR package)
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
8 # For use with Galaxy
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
9
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
10 # Usage of batch-consistency-plot.r: Rscript batch-consistency-plot-merged.r [npairs] [output.dir] [input.file.prefix 1, 2, 3 ...]
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
11 # npairs - will be a constant, since Galaxy requires explicit control over input and output files
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
12
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
13 # Usage of THIS SCRIPT: ./idrPlotWrapper.sh em uri outputfile
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
14 # em - em.sav file provided by Galaxy
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
15 # uri - uri.sav file provided by Galaxy
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
16 # outputfile - output file name specified by Galaxy
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
17
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
18 main() {
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
19 EM="${1}" # absolute file path to em.sav file, provided by Galaxy
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
20 URI="${2}" # absolute file parth to uri.sav file, provided by Galaxy
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
21 OUTFILE="${3}" # name of desired output file
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
22
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
23 cp "${EM}" ./idrPlot-em.sav # cp to this directory and rename so they can be found by idrPlot
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
24 cp "${URI}" ./idrPlot-uri.sav
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
25
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
26 Rscript /mnt/galaxyTools/galaxy-central/tools/modENCODE_DCC_tools/idr/batch-consistency-plot.r 1 ./idrPlot idrPlot
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
27
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
28 # convert post script to pdf file
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
29 ps2pdf ./idrPlot-plot.ps ./idrPlot-plot.pdf
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
30
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
31 # rename to output file name
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
32 mv ./idrPlot-plot.pdf "${OUTFILE}"
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
33
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
34 # clean up
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
35 rm idrPlot-em.sav
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
36 rm idrPlot-uri.sav
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
37 }
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
38
c6bfb8bcff93 Uploaded
modencode-dcc
parents:
diff changeset
39 main "${@}"