source: tags/arb-6.0/SH/arb_protpars

Last change on this file was 11626, checked in by westram, 10 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.2 KB
Line 
1#!/bin/bash -x
2
3if [ -z "$6" ]; then
4    echo "Usage: arb_protpars bootstrap geneticcode viewreport randomize threshold_pars interactive"
5else
6    BOOTSTRAP=$1
7    CODE=$2
8    REPORT=$3
9    RANDOMIZE=$4
10    THRESHOLD_PARS=$5
11    INTERACTIVE=$6
12
13    FLAGS="c $CODE"
14
15    if [ "$RANDOMIZE" = "1" ]; then
16        RANDOMSEED=$(($RANDOM|1)) # a odd number
17        FLAGS="$FLAGS j $RANDOMSEED 1"
18    fi
19
20    if [ \! "$THRESHOLD_PARS" = "0" ]; then
21        FLAGS="$FLAGS t $THRESHOLD_PARS"
22    fi
23
24    if [ "$BOOTSTRAP" = "0" ]; then
25        if [ "$INTERACTIVE" = "0" ]; then
26            arb_echo $FLAGS y | protpars
27        else
28            (arb_echo $FLAGS ; cat -) | ( protpars ; echo "Press RETURN to continue.." )
29        fi
30        echo >arb_read_tree_args
31        WHAT=protpars
32    else
33        arb_bootstrap $BOOTSTRAP protpars $FLAGS
34        WHAT=arb_bootstrap/protpars/consense
35    fi
36
37    if [ -f outfile ]; then
38        if [ -s outfile ]; then
39            if [ "$REPORT" = "1" ]; then
40                arb_textedit outfile &
41            fi
42        else
43            arb_message "$WHAT: Error: generated 'outfile' is empty"
44            false
45        fi
46    else
47        arb_message "$WHAT: Error: 'outfile' has not been generated"
48        false
49    fi
50fi
Note: See TracBrowser for help on using the repository browser.