source: trunk/SH/arb_bootstrap

Last change on this file was 2200, checked in by westram, 21 years ago
  • fixes for phylip 3.6
  • works now with protpars, proml and dnapars
  • 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# ------------------------------------------------------------
3# (C) 2003 Lehrstuhl fuer Mikrobiologie TU Muenchen
4# Coded by Ralf Westram
5# ------------------------------------------------------------
6#
7# usage: arb_bootstrap count treeprog [keys for treeprog]
8#
9# 'count'                  is the number of generated trees
10# 'treeprog'               calculates the trees (e.g. dnapars, protpars)
11# 'keys for treeprog'      is arb_echo'ed to stdin of 'treeprog'
12#
13# expects input data in "infile"
14# output data is written to "outtree"
15#
16# ------------------------------------------------------------
17
18COUNT=$1
19TREEPROG=$2
20shift
21shift
22# additional arguments are pushed to arb_echo
23
24RANDOMSEED1=$(($RANDOM|1)) # a odd number
25RANDOMSEED2=$(($RANDOM|1)) # a odd number
26
27echo "-consense $COUNT" >arb_read_tree_args
28
29# arb_echo $RANDOMSEED r $COUNT y | seqboot
30arb_echo r "$COUNT" y $RANDOMSEED1 | seqboot
31
32if [ \! -f outfile ] ; then
33    echo "Error in seqboot: 'outfile' not generated"
34else
35    mv -f outfile infile
36    TREED=0
37    if [ \( "$TREEPROG" = "dnapars" \) -o \
38         \( "$TREEPROG" = "protpars" \) -o \
39         \( "$TREEPROG" = "proml" \) \
40         ]; then
41        arb_echo m d $COUNT $RANDOMSEED2 1 $* y | $TREEPROG
42        # $TREEPROG
43        TREED=1
44    fi
45
46    if [ "$TREED" = 0 ]; then
47        echo "treeprogram '$TREEPROG' is unknown by arb_bootstrap"
48    else
49        if [ \! -f outtree ] ; then
50            echo "Error running $TREEPROG: 'outtree' not generated"
51        else
52            if [ \! -s outtree ] ; then
53                echo "Error running $TREEPROG: 'outtree' is empty"
54                rm outtree
55            else
56                mv -f outtree intree
57                rm outfile
58                arb_echo y | consense
59                #consense
60
61                if [ \! -f outtree ] ; then
62                    echo "Error running consense: 'outtree' not generated"
63                fi
64            fi
65        fi
66    fi
67fi
Note: See TracBrowser for help on using the repository browser.