[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.2 - (download) (as text) (annotate)
Fri Dec 15 00:46:54 2006 UTC (13 years, 6 months ago) by overbeek
Branch: MAIN
Changes since 1.1: +21 -2 lines
add checkpoints to insertion into trees

#!/usr/bin/env /Volumes/seagate/FIGdisk/env/mac/bin/perl

BEGIN {
    @INC = qw(
              /Volumes/seagate/FIGdisk/dist/releases/ross/mac/lib
              /Volumes/seagate/FIGdisk/dist/releases/ross/mac/lib/FigKernelPackages
              /Volumes/seagate/FIGdisk/dist/ross/mac/lib
              /Volumes/seagate/FIGdisk/dist/ross/mac/lib/FigKernelPackages
              /Volumes/seagate/FIGdisk/env/mac/lib/perl5/5.8.7/darwin-2level
              /Volumes/seagate/FIGdisk/env/mac/lib/perl5/5.8.7
              /Volumes/seagate/FIGdisk/env/mac/lib/perl5/site_perl/5.8.7/darwin-2level
              /Volumes/seagate/FIGdisk/env/mac/lib/perl5/site_perl/5.8.7
              /Volumes/seagate/FIGdisk/env/mac/lib/perl5/site_perl
              .
              /Volumes/seagate/FIGdisk/config
 
);
}
use Data::Dumper;
use Carp;
use FIG_Config;
$ENV{'BLASTMAT'} = "/Volumes/seagate/FIGdisk/BLASTMAT";
$ENV{'FIG_HOME'} = "/Volumes/seagate/FIGdisk";
# end of tool_hdr
########################################################################


use FIG;
use InsertIntoTree;
use strict;

use gjoseqlib;
use gjonewicklib;

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

my $check_point = undef;
while ($ARGV[0] =~ /^-/)
{
    my $flag = shift @ARGV;
    if ( $flag =~ /^-c/ )
    {
	$check_point = shift @ARGV;
    }
    else
    {
        die "Error: invalid flag $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
                                                             );
&gjonewicklib::writeNewickTree($new_tree);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3