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

View of /FigKernelScripts/insert_into_a_tree.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (as text) (annotate)
Sat Jan 6 17:39:41 2007 UTC (13 years, 5 months ago) by overbeek
Branch: MAIN
Changes since 1.3: +9 -11 lines
make sure tree insertion code is all committed

########################################################################


use FIG;
use InsertIntoTree;
use strict;

use gjoseqlib;
use gjonewicklib;

my $usage = "usage: insert_into_a_tree [-c CheckPointFile] [-a Alpha] Alignment Tree [TreeProg] > new.tree\n";

my $check_point = undef;
my $alpha       = undef;
while ($ARGV[0] =~ /^-/)
{
    $_ = shift @ARGV;
    if ($_ =~ s/^-a//)    { $alpha = ($_ || shift @ARGV) }
    elsif ($_ =~ s/^-c//) { $check_point = ($_ || shift @ARGV) }
    else                  { die "Error: invalid flag $_\n$usage" }
}

my($aliF,$treeF);
(
 ($aliF  = shift @ARGV) &&
 ($treeF = shift @ARGV)
)
    || die $usage;

my $tree_prog = (@ARGV > 0) ? $ARGV[0] : undef;

my $ali  = &gjoseqlib::read_fasta($aliF);
my $tree = &gjonewicklib::parse_newick_tree_str(join("",`cat $treeF`));

my $new_tree = &InsertIntoTree::update_old_tree_using_new_ali( align => $ali,
                                                               tree => $tree,
                                                               tree_prog => $tree_prog,
                                                               check_point => $check_point,
							       alpha => $alpha
                                                             );
&gjonewicklib::writeNewickTree($new_tree);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3