[Bioperl-l] Bio::TreeIO: Problem rerooting with a leaf

Mark A. Jensen maj at fortinbras.us
Thu Feb 11 17:20:00 UTC 2010


Hi Ferdi-
I'm afraid I caused your trouble. The new reroot 
makes the the node you provide the root, rather than
creating a new (and arbitrary) node. Now, the 
user specifies that node, and so has more control.
Sometime one wants to take an existing polytomic
node an make it itself the root; now reroot does this
transparently. (It also fixes some other things, I think.)
Try this:

# put a midpoint node on the ancestral branch of the leaf:
# this is a new method...
$new_root = $leaf->create_node_on_branch(-fraction => 0.5);
# reroot 
$tree->reroot($new_root);

(this is what reroot actually did before, essentially secretly
changing the tree)--
HTH -MAJ

----- Original Message ----- 
From: "Ferdi" <ferdinand.marletaz at gmail.com>
To: <bioperl-l at bioperl.org>
Sent: Thursday, February 11, 2010 11:41 AM
Subject: [Bioperl-l] Bio::TreeIO: Problem rerooting with a leaf


> Hi-
> I am an enthusiastic user of Bio::TreeIO module, and I got some
> problems with it after a recent reinstall of bioperl on my new mac
> (10.6, previous was 10.5).  Particularly, when attempting to reroot
> ($tree->reroot($leaf))  a tree with a leaf node, it doesn't seem to
> consider ianymore t as an outgroup but as the root itself... For
> example, with the example provided on Howto bioperl page:
> (((A,B),(C,D)),E);
> what I get when reroot with A:
> ((B,((C,D),(E))))A;
> while I should get something like:
> (A,((E,(C,D)),B));
> with A considered as outgroup instead of the root node itself.
> Thanks for your help!
> Ferdi
> _______________________________________________
> 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