[Bioperl-l] Modules in Bio:Tree

Jason Stajich jason at bioperl.org
Wed May 5 22:45:41 UTC 2010


Please use the mailing list for questions.

The nodes are objects not strings you print - as it shows in 
http://bioperl.org/wiki/HOWTO:Trees#Example_Code
you access information from them with the object methods like 'id'
so
  print $leaf->id, "\n"
would probably accomplish what you are looking for right now.

-jason
Sudeep Mehrotra wrote, On 5/5/10 1:11 PM:
> Hello Jason,
> I am using the Bio:Tree modules to get a list of all the leaves in 
> their respective clusters. I looked at the examples and followed the 
> functions of various modules but I am not able to get the desired result.
>
> My input looks as follows:
> ((((Candidatus_Korarchaeum)Korarchaeota,((((Cenarchaeum_symbiosum)Cenarchaeum)Cenarchaeaceae)Cenarchaeales,((((Nitrosopumilus_maritimus)Nitrosopumilus)Nitrosopumilaceae)Nitrosopumilales)marine_archaeal_group_1)Thaumarchaeota,(((((Archaeoglobus_fulgidus)Archaeoglobus)Archaeoglobaceae)Archaeoglobales)Archaeoglobi, 
>
> and so on....
>
> Code is like this:
>         $input = new Bio::TreeIO(-file =>"$file1",-format => "newick");
>              $tree = $input->next_tree;
>         @leaves = $tree->get_leaf_nodes();
>         foreach $leaf (@leaves)
>         {
>                 print "$leaf\n";
>         }
> The ouput I get is:
> Bio::Tree::Node=HASH(0xa783e0)
> Bio::Tree::Node=HASH(0xa78710)
> Bio::Tree::Node=HASH(0xa78ab0)
>
> Not sure what I am doing wrong.
>
> Objective is to get a cluster of all the leaves.
>
> Thanks 



More information about the Bioperl-l mailing list