[Bioperl-l] problem parsing a newick format

Mark A. Jensen maj at fortinbras.us
Wed Feb 11 21:24:13 EST 2009


C- I think you maybe want

 my $input = new Bio::TreeIO(-file =>"nexusCytochrome7R.newick",
                            -format => "newick");

and not

> my $input = new Bio::TreeIO(-fh =>"nexusCytochrome7R.newick",
>                            -format => "newick");

?

Mark

----- Original Message ----- 
From: "Chrysanthi A." <chrysain at gmail.com>
To: "BioPerl List" <bioperl-l at lists.open-bio.org>
Sent: Wednesday, February 11, 2009 9:13 PM
Subject: [Bioperl-l] problem parsing a newick format


> Is the code below correct?? Why it does not print anything???
> use strict;
> 
> use Bio::TreeIO;
> 
> 
> my $input = new Bio::TreeIO(-fh =>"nexusCytochrome7R.newick",
>                            -format => "newick");
> 
> while(my $tree = $input->next_tree){
>    for my $node(grep{!$_->is_Leaf}$tree->get_nodes){
> next if !$node->ancestor;
> print "Node:", $node->id, "length:", $node->branch_length, " ";
> for my $child($node->get_Descendents){
>    print "child:", $child->id, "", $child->branch_length, " ";
> }
>    print "\n";
>    }
> }
> 
> Any ideas? I want to read a tree and mainly get the duplication events.
> Could someone help me?
> 
> Thanks a lot,
> 
> Chrysanthi
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
>


More information about the Bioperl-l mailing list