annotate idrPlotWrapper.sh @ 20:6f6a9fbe264e draft default tip

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