annotate tools/human_genome_variation/ldtools_wrapper.sh @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 #!/usr/bin/env bash
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 #
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 # Galaxy wrapper for Aakrosh Ratan's ldtools
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 #
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 set -e
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 export PATH=$PATH:$(dirname $0)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 ## pagetag options
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 input=
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 rsquare=0.64
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 freq=0.00
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14 sample=###
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 ## senatag options
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 excluded=###
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 required=###
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 output=
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 until [ $# -eq 0 ]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 do
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 case $1 in
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24 rsquare=*)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 rsquare=${1#rsquare=}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26 ;;
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27 freq=*)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28 freq=${1#freq=}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29 ;;
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30 input=*)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 input=${1#input=}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32 ;;
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 output=*)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 output=${1#output=}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35 ;;
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 *)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 if [ -z "$new_args" ]; then
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 new_args=$1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39 else
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 new_args="$new_args $1"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
41 fi
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
42 ;;
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
43 esac
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
44
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
45 shift
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
46 done
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
47
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
48 ## run pagetag
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
49 pagetag.py --rsquare $rsquare --freq $freq $input snps.txt neighborhood.txt &> /dev/null
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
50 if [ $? -ne 0 ]; then
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
51 echo "failed: pagetag.py --rsquare $rsquare --freq $freq $input snps.txt neighborhood.txt"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
52 exit 1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
53 fi
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
54
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
55 ## run sentag
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
56 senatag.py neighborhood.txt snps.txt > $output 2> /dev/null
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
57 if [ $? -ne 0 ]; then
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
58 echo "failed: senatag.py neighborhood.txt snps.txt"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
59 exit 1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
60 fi
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
61
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
62 ## cleanup
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
63 rm -f snps.txt neighborhood.txt
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
64