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
RevLine 
[1724]1#!/bin/bash -x
[2200]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#
[1743]13# expects input data in "infile"
[2200]14# output data is written to "outtree"
15#
16# ------------------------------------------------------------
[1684]17
[1724]18COUNT=$1
19TREEPROG=$2
[2200]20shift
21shift
22# additional arguments are pushed to arb_echo
[1684]23
[2200]24RANDOMSEED1=$(($RANDOM|1)) # a odd number
25RANDOMSEED2=$(($RANDOM|1)) # a odd number
26
[1724]27echo "-consense $COUNT" >arb_read_tree_args
[1684]28
[2200]29# arb_echo $RANDOMSEED r $COUNT y | seqboot
30arb_echo r "$COUNT" y $RANDOMSEED1 | seqboot
[1684]31
[1724]32if [ \! -f outfile ] ; then
33    echo "Error in seqboot: 'outfile' not generated"
34else
35    mv -f outfile infile
[2200]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
[1724]44    fi
[1684]45
[2200]46    if [ "$TREED" = 0 ]; then
47        echo "treeprogram '$TREEPROG' is unknown by arb_bootstrap"
[1724]48    else
[2200]49        if [ \! -f outtree ] ; then
50            echo "Error running $TREEPROG: 'outtree' not generated"
[1724]51        else
[2200]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
[1684]60
[2200]61                if [ \! -f outtree ] ; then
62                    echo "Error running consense: 'outtree' not generated"
[1724]63                fi
64            fi
65        fi
66    fi
67fi
Note: See TracBrowser for help on using the repository browser.