[Bio] / FigKernelScripts / insert_into_a_tree.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/insert_into_a_tree.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (view) (download) (as text)

1 : overbeek 1.4 ########################################################################
2 : overbeek 1.1
3 : overbeek 1.2
4 : overbeek 1.1 use FIG;
5 :     use InsertIntoTree;
6 :     use strict;
7 :    
8 :     use gjoseqlib;
9 :     use gjonewicklib;
10 :    
11 : overbeek 1.4 my $usage = "usage: insert_into_a_tree [-c CheckPointFile] [-a Alpha] Alignment Tree [TreeProg] > new.tree\n";
12 : overbeek 1.2
13 :     my $check_point = undef;
14 : overbeek 1.4 my $alpha = undef;
15 : overbeek 1.2 while ($ARGV[0] =~ /^-/)
16 :     {
17 : overbeek 1.4 $_ = shift @ARGV;
18 :     if ($_ =~ s/^-a//) { $alpha = ($_ || shift @ARGV) }
19 :     elsif ($_ =~ s/^-c//) { $check_point = ($_ || shift @ARGV) }
20 :     else { die "Error: invalid flag $_\n$usage" }
21 : overbeek 1.2 }
22 : overbeek 1.1
23 :     my($aliF,$treeF);
24 :     (
25 :     ($aliF = shift @ARGV) &&
26 :     ($treeF = shift @ARGV)
27 :     )
28 :     || die $usage;
29 :    
30 :     my $tree_prog = (@ARGV > 0) ? $ARGV[0] : undef;
31 :    
32 :     my $ali = &gjoseqlib::read_fasta($aliF);
33 :     my $tree = &gjonewicklib::parse_newick_tree_str(join("",`cat $treeF`));
34 :    
35 : overbeek 1.5 my ($new_tree,$lnlik) = &InsertIntoTree::update_old_tree_using_new_ali( align => $ali,
36 :     tree => $tree,
37 :     tree_prog => $tree_prog,
38 :     check_point => $check_point,
39 :     alpha => $alpha
40 :     );
41 :     print "Ln Likelihood = $lnlik\n//\n";
42 : overbeek 1.1 &gjonewicklib::writeNewickTree($new_tree);
43 : overbeek 1.5 print "///\n";
44 : overbeek 1.1

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3