annotate parsewig.sh @ 33:91a4092971bc draft default tip

Uploaded
author eiriche
date Mon, 03 Dec 2012 03:10:42 -0500
parents 35cfb51eb545
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
1 #!/bin/bash
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
2 #
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
3 # Galaxy wrapper for WIG parser
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
4 # Written by Eugen Eirich @ Institute of Molecular Biology Mainz
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
5 #
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
6
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
7 set -e
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
8
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
9
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
10 #get parameters
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
11
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
12 until [ $# -eq 0 ]
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
13 do
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
14 case $1 in
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
15 input=*)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
16 input=${1#input=}
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
17 ;;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
18 extract=*)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
19 extract=${1#extract=}
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
20 ;;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
21 context=*)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
22 context=${1#context=}
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
23 ;;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
24 depth=*)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
25 depth="cutoff=${1#depth=}"
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
26 ;;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
27 cov_out=*)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
28 cov_out=${1#cov_out=}
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
29 ;;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
30 meth_out=*)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
31 meth_out=${1#meth_out=}
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
32 ;;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
33 esac
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
34 shift
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
35 done
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
36
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
37 case $extract in
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
38 c)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
39 output="-cov_out=$cov_out";;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
40 m)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
41 output="-meth_out=$meth_out";;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
42 b)
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
43 output="-meth_out=$meth_out -cov_out=$cov_out";;
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
44 esac
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
45
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
46 if [ "$context" != "" ]
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
47 then
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
48 context="-context=$context"
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
49 fi
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
50
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
51 cd "$(dirname ${BASH_SOURCE[0]})"
35cfb51eb545 Uploaded
eiriche
parents:
diff changeset
52 perl wig_extractor.pl -e $extract $context $output $input 2>&1>/dev/null