[Bioperl-l] HOWTO:Trees module

Victoria Lyn Uhlhorn vuhlhorn at ramapo.edu
Wed Mar 12 18:51:50 UTC 2008


The following script:

#!/usr/bin/perl -w

use CGI ':standard';
use Bio::Perl;
use Bio::Align::ProteinStatistics;
use Bio::Tree::DistanceFactory;
use Bio::TreeIO;

print header;

print start_html(-bgcolor=>"pink", -title=>('Phylogenetic Tree'), -style=>{-
src=>$style}, -class=>Ltitle), p(), 'Tree';

print start_form, hr;

my $alnio= Bio::AlignIO->new(-file => '/Users/glitterchix4u/Sites/CGI-
bin/HepatitisSerineProt.clustalw',
                             -format => 'clustalw');
my $profactory = Bio::Tree::DistanceFactory->new(-mnethod => 'NJ');
my $stats = Bio::Align::ProteinStatistics->new;
my $treeout = Bio::TreeIO->new(-format => 'newick');

my $tree;
while(my $aln = $alnio->next_aln)
{
	my $mat = $stats->distance(-method => 'Kimura',
	                           -align => $aln);
	$tree = $profactory->make_tree($mat);
	$treeout->write_tree($tree);
}

#$treeout->print_tree($tree);
print "Tree is: ", $tree->size;

print end_form;
print end_html;

How do I print the tree?  I'm having a hard time printing the tree out.



More information about the Bioperl-l mailing list