[Bioperl-l] Reroot Tree ?

Jason Stajich jason.stajich at duke.edu
Fri Jun 3 10:31:57 EDT 2005


Of course it looks at leaves - those can be the only labeled nodes in  
the tree sometimes.

So your problem is getting a node by name not in the re-root itself?

See the test in t/Tree.t as to how it is often used but basically

my ($node) = $tree->find_node(-id => 'node1');

You can also do it this way:
my @nodes = grep { $_->id eq 'node1' } $tree->get_nodes;


I did update the re-root code since bioperl 1.4 so you may also want  
to grab all the latest modules in Bio/Tree and Bio/TreeIO directory  
out of CVS.


--jason


On May 30, 2005, at 7:36 AM, Ferdinand Marlétaz wrote:

> Hi,
>
> Well, I'm trying to reroot a population of Tree and I don't manage  
> to do it !  In fact, the function reroot asks $node and I'd like to  
> reroot with a specific taxa of my tree, so I ignore the node name  
> on which I must reroot ? I've tried find_node but it doesn't seem  
> to work (I don't thing it looks leaves).
>  So, what should I do ?
>
>
> Thanks
>
> Ferdi
>
> _____________________________
> Ferdinand Marlétaz
> Evolution et phylogénie des métazoaires
> UMR 6540 DIMAR
> Rue Batterie des Lions
> 13007 MARSEILLE
> Tel. 33 (0)4 91 04 16 54
> Port. 33 (0)6 30 35 58 49
> Mail. Ferdinand.Marletaz at ens- 
> lyon.fr_______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/





More information about the Bioperl-l mailing list