/tools/human_genome_variation/ldtools_wrapper.sh
Shell | 64 lines | 45 code | 10 blank | 9 comment | 3 complexity | 237e0dc5b05790d7fe3f403b88da395a MD5 | raw file
1#!/usr/bin/env bash
2#
3# Galaxy wrapper for Aakrosh Ratan's ldtools
4#
5
6set -e
7
8export PATH=$PATH:$(dirname $0)
9
10## pagetag options
11input=
12rsquare=0.64
13freq=0.00
14sample=###
15
16## senatag options
17excluded=###
18required=###
19output=
20
21until [ $# -eq 0 ]
22do
23 case $1 in
24 rsquare=*)
25 rsquare=${1#rsquare=}
26 ;;
27 freq=*)
28 freq=${1#freq=}
29 ;;
30 input=*)
31 input=${1#input=}
32 ;;
33 output=*)
34 output=${1#output=}
35 ;;
36 *)
37 if [ -z "$new_args" ]; then
38 new_args=$1
39 else
40 new_args="$new_args $1"
41 fi
42 ;;
43 esac
44
45 shift
46done
47
48## run pagetag
49pagetag.py --rsquare $rsquare --freq $freq $input snps.txt neighborhood.txt &> /dev/null
50if [ $? -ne 0 ]; then
51 echo "failed: pagetag.py --rsquare $rsquare --freq $freq $input snps.txt neighborhood.txt"
52 exit 1
53fi
54
55## run sentag
56senatag.py neighborhood.txt snps.txt > $output 2> /dev/null
57if [ $? -ne 0 ]; then
58 echo "failed: senatag.py neighborhood.txt snps.txt"
59 exit 1
60fi
61
62## cleanup
63rm -f snps.txt neighborhood.txt
64