source: trunk/SH/arb_proml

Last change on this file was 11626, checked in by westram, 11 years ago
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1#!/bin/bash -x
2
3BOOTSTRAP=$1 ; shift
4MODEL=$1 ; shift
5REPORT=$1 ; shift
6ANALYSIS=$1 ; shift
7RANDOMIZE=$1 ; shift
8REARRANGE=$1 ; shift
9RATE_VARIATION=$1 ; shift
10VARIATION_COEFF=$1 ; shift
11HMM_RATES=$1 ; shift
12INV_FRACTION=$1 ; shift
13INTERACTIVE=$1 ; shift
14
15if [ -z "$INTERACTIVE" ]; then
16    echo "Usage: arb_proml bootstrap aachangemodel viewreport analysis randomize rearrange rate_variation variation_coeff hmm_rates inv_fraction interactive"
17else
18    FLAGS=""
19    ADD_PARA=""
20
21    if [ "$MODEL" = "PAM" ]; then
22        FLAGS="$FLAGS p"
23    fi
24    if [ "$ANALYSIS" = "fine" ]; then
25        FLAGS="$FLAGS s"
26    fi
27    if [ "$RANDOMIZE" = "1" ]; then
28        RANDOMSEED=$(($RANDOM|1)) # a odd number
29        FLAGS="$FLAGS j $RANDOMSEED 1"
30    fi
31    if [ "$REARRANGE" = "1" ]; then
32        FLAGS="$FLAGS g"
33    fi
34
35    case $RATE_VARIATION in
36        0) ;;
37        1) FLAGS="$FLAGS r"
38           ADD_PARA="$ADD_PARA $VARIATION_COEFF $HMM_RATES"
39           ;;
40        2) FLAGS="$FLAGS r r"
41           ADD_PARA="$ADD_PARA $VARIATION_COEFF $HMM_RATES $INV_FRACTION"
42           ;;
43        *) arb_message "Illegal value for 'rate_variation'"
44           exit 1
45           ;;
46    esac
47
48    if [ "$BOOTSTRAP" = "0" ]; then
49        if [ "$INTERACTIVE" = "0" ]; then
50            arb_echo $FLAGS y $ADD_PARA | proml
51        else
52            (arb_echo $FLAGS ; cat - ) | ( proml ; echo "Press RETURN to continue.." )
53        fi
54        #proml
55        echo >arb_read_tree_args
56        WHAT=proml
57    else
58        arb_bootstrap $BOOTSTRAP proml $FLAGS
59        WHAT=arb_bootstrap/proml/consense
60    fi
61
62    if [ -f outfile ]; then
63        if [ -s outfile ]; then
64            if [ "$REPORT" = "1" ]; then
65                arb_textedit outfile &
66            fi
67        else
68            arb_message "$WHAT: Error: generated 'outfile' is empty"
69            false
70        fi
71    else
72        arb_message "$WHAT: Error: 'outfile' has not been generated"
73        false
74    fi
75fi
Note: See TracBrowser for help on using the repository browser.