File: iterate_rates

package info (click to toggle)
fastdnaml 1.2.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 576 kB
  • ctags: 384
  • sloc: ansic: 3,927; sh: 549; makefile: 22
file content (43 lines) | stat: -rw-r--r-- 1,333 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/sh
#
#  iterate_rates  file_name_root  program_options  [cycles]

if test $# -lt 2; then
    echo "Usage: iterate_rates  file_name_root  [cycles]";
    exit
fi

root0="$1"
if   test -f "${root0}.phylip"; then suf=phylip
elit test -f "${root0}.phy";    then suf=phy
else
    echo "Could not find sequence file ${root0}.phy[lip]"
    exit
fi

root=`echo "$root0" | sed 's&^.*/\([^/][^/]*\)$&\1&'`

if test $# -gt 2; then cycles=$3; else cycles=0; fi

tree1=`ls -1 ${root}_*.tree | tail -1`
if test -z "$tree1"; then
    transition 2 < ${root}.$suf | treefile | quickadd | global 0 0 | fastDNAml >/dev/null
    mv `ls -t treefile.*|head -1`  "${root}.dummy_tree"
    usertree  "${root}.dummy_tree" < ${root0}.$suf | n_categories 35 | treefile | DNAml_rates > /dev/null
    mv `ls -t treefile.*|head -1`
    v0=0;
    v1=1;
else
    v0=`echo "$tree1" | sed 's/^.*_\([0-9][0-9]*)\.tree$/\1/'`
    v1=`expr $v0 + 1`
fi

if test ! -f ${root}_${v0}.$suf; then ln -s ${root}.$suf ${root}_${v0}.$suf; fi

usertree  $tree1 < ${root}_${v0}.$suf | n_categories 35 | treefile | frequencies | DNAml_rates > ${root}_${v0}.rates

mv  weight_rate.*  ${root}_${v0}.wr

if test ! -f ${root}_${v1}.$suf; then ln -s ${root}.$suf ${root}_${v1}.$suf; fi

fastDNAml_loop -m 20 ${root}_${v1}.$suf 3 "frequencies | weights_categories ${root}_${v0}.wr"