Debian Codegraph @

scripts/iterate_rates

raw ◀ ▶
1 Debian patch touch this file
  • corrects extra spaces, a typo causing a syntax error, and adds a
    Author
    unknown
    Forwarded
    No fastDNAml is not maintained upstream anymore.
•1 #!/bin/sh
2 #
3 # iterate_rates file_name_root program_options [cycles]
4
•5 PATH=/usr/lib/fastdnaml/bin:${PATH}
6
7 if test $# -lt 2; then
8 echo "Usage: iterate_rates file_name_root [cycles]";
9 exit
10 fi
11
12 root0="$1"
13 if test -f "${root0}.phylip"; then suf=phylip
•14 elif test -f "${root0}.phy"; then suf=phy
15 else
16 echo "Could not find sequence file ${root0}.phy[lip]"
17 exit
18 fi
19
20 root=`echo "$root0" | sed 's&^.*/\([^/][^/]*\)$&\1&'`
21
22 if test $# -gt 2; then cycles=$3; else cycles=0; fi
23
24 tree1=`ls -1 ${root}_*.tree | tail -1`
25 if test -z "$tree1"; then
26 transition 2 < ${root}.$suf | treefile | quickadd | global 0 0 | fastDNAml >/dev/null
27 mv `ls -t treefile.*|head -1` "${root}.dummy_tree"
28 usertree "${root}.dummy_tree" < ${root0}.$suf | n_categories 35 | treefile | DNAml_rates > /dev/null
29 mv `ls -t treefile.*|head -1`
30 v0=0;
31 v1=1;
32 else
33 v0=`echo "$tree1" | sed 's/^.*_\([0-9][0-9]*)\.tree$/\1/'`
34 v1=`expr $v0 + 1`
35 fi
36
37 if test ! -f ${root}_${v0}.$suf; then ln -s ${root}.$suf ${root}_${v0}.$suf; fi
38
39 usertree $tree1 < ${root}_${v0}.$suf | n_categories 35 | treefile | frequencies | DNAml_rates > ${root}_${v0}.rates
40
41 mv weight_rate.* ${root}_${v0}.wr
42
43 if test ! -f ${root}_${v1}.$suf; then ln -s ${root}.$suf ${root}_${v1}.$suf; fi
44
45 fastDNAml_loop -m 20 ${root}_${v1}.$suf 3 "frequencies | weights_categories ${root}_${v0}.wr"