root/galaxy-central/tools/human_genome_variation/BEAM2_wrapper.sh

リビジョン 2, 1.3 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

  • 属性 svn:executable の設定値 *
行番号 
1#!/usr/bin/env bash
2#
3# Galaxy wrapper for Yu Zhang's BEAM2 adds two new options
4#  significance=foo    renames significance.txt to foo after BEAM2 is run
5#  posterior=bar       renames posterior.txt    to bar after BEAM2 is run
6#
7
8set -e
9
10export PATH=$PATH:$(dirname $0)
11
12## options
13significance=
14posterior=
15new_args=
16map=
17ped=
18
19TFILE="/tmp/BEAM2.$$.tmp"
20
21## separate significance and posterior arguments from arguments to BEAM2
22until [ $# -eq 0 ]
23do
24  case $1 in
25    significance=*)
26      significance=${1#significance=}
27      ;;
28    posterior=*)
29      posterior=${1#posterior=}
30      ;;
31    map=*)
32      map=${1#map=}
33      ;;
34    ped=*)
35      ped=${1#ped=}
36      ;;
37    *)
38      if [ -z "$new_args" ]; then
39        new_args=$1
40      else
41        new_args="$new_args $1"
42      fi
43      ;;
44  esac
45
46  shift
47done
48
49## convert input for use with BEAM2
50lped_to_geno.pl $map $ped > $TFILE
51if [ $? -ne 0 ]; then
52  echo "failed: lped_to_geno.pl $map $ped > $TFILE"
53  exit 1
54fi
55
56## run BEAM2
57BEAM2 $TFILE $new_args 1>/dev/null
58if [ $? -ne 0 ]; then
59  echo "failed: BEAM2 $TFILE $new_args"
60  exit 1
61fi
62
63mergeSnps.pl significance.txt $TFILE
64if [ $? -ne 0 ]; then
65  echo "failed: mergeSnps.pl significance.txt $TFILE"
66  exit 1
67fi
68
69## move output files
70mv significance.txt $significance
71mv posterior.txt $posterior
72
73## cleanup
74rm -f $TFILE
75
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。