Hi David & Brian,
Yes, I'll put this function in the next release.
Cheers,
Emmanuel
Le 15/06/2015 18:27, David Bapst a écrit :
Whoops, I meant a 'function in ape?'
-Dave
On Mon, Jun 15, 2015 at 10:26 AM, David Bapst wrote:
Hi Brian,
I was already aware of the read.tree(write.tree()) fix,
Hi David.
I'm not sure about this, but changing to:
tree<-read.newick(text=write.tree(tree))
tree<-collapse.singles(tree)
may work. I believe that write.tree will write trees with singletons &
read.newick in phytools should be able to read them.
All the best, Liam
Liam J. Revell, Assistant
Whoops, I meant a 'function in ape?'
-Dave
On Mon, Jun 15, 2015 at 10:26 AM, David Bapst wrote:
> Hi Brian,
>
> I was already aware of the read.tree(write.tree()) fix, however I've
> run into (corner?) cases where a particular sorting of edges or
> whatever can lead to a loss of tip taxa using th
Hi Brian,
I was already aware of the read.tree(write.tree()) fix, however I've
run into (corner?) cases where a particular sorting of edges or
whatever can lead to a loss of tip taxa using the
read.tree(write.tree()) approach; plus, read.tree(write.tree()) gets
completely flabbergasted by singleto
A kludgy solution to achieve Dave's original use case of fixing
not-quite-right phylo objects is to do:
phy <- read.tree(text=write.tree(phy))
It converts the tree to Newick and reads it back in.
It's not as good a solution as using a validator (great addition, Emanuel!)
to find and fix the gene
Hi David,
collapse.singles() seems to work correctly if the "phylo" object is
correctly conformed. Some features of this class may seem annoying (and
Klaus and I alredy discussed about this), but these help for other
things. As a reminder the class "phylo" is defined here:
http://ape-package
Hi Klaus (and others),
Ah, I see! The real bug then appears to be in collapse.singles, as it
does not reorder the ID numbers in $edge. Here's a quick function to
return the root ID:
getRootID<-function(tree){
uniqueNode<-unique(tree$edge[,1])
whichRoot<-sapply(uniqueNode,function(x)
Hi David,
I found the bug. Somehow ape assumes on the one hand that the root is
number of tips + 1.
On the other hand the root of an phylo object is the node which is in
tree$edge[,1], but not in tree$edge[,2],
this is the case even in an unrooted tree. This annoys me for a long time.
The root of
Hello all,
As those of you who directly manipulate the guts of phylo objects in
your code (or construct new phylo objects whole cloth from
un-phylo-like data structures) have probably experienced, it is
sometimes easy to create $edge matrices that aren't accepted by ape
functions (I often use plot