Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-19 Thread Emmanuel Paradis

Hi Klaus,

I will add an option 'method' to this function so that its definition 
will be:


is.ultrametric(phy, tol = .Machine$double.eps^0.5, option = 1)

option = 1 => using the criterion you suggested below
option = 2 => using the current 'variance' criterion

And other criteria could be added.

What do you think?

Best,

Emmanuel

Le 17/08/2016 à 19:16, Klaus Schliep a écrit :

Hi Emmanuel,

it wasn't so much about the precision, but that it is not invariant
against linear transformation of the edge length.
At the moment the criterion inside is.ultrametric is the following:
var(xx[1:n])
where xx[1:n] is a vector with the tip-to-toot differences. And
is.ultrametric returns FALSE if the result of the expression larger than
tol.
What I suggest is doing something like this:
( max(xx[1:n]) - min(xx[1:n]) )  / max(xx[1:n])

Here is a small example:
set.seed(42)
tree <- read.tree(text=write.tree(rcoal(100), digits=4))
is.ultrametric(tree) # returns FALSE

And the 2 criteria are:
var(xx[1:n])
[1] 2.078812e-08
( max(xx[1:n]) - min(xx[1:n]) )  / max(xx[1:n])
[1] 0.0002541798

tree2 <- tree
tree2$edge.length[] = tree2$edge.length * 1000
is.ultrametric(tree2)

var(xx[1:n])
[1] 0.02078812
( max(xx[1:n]) - min(xx[1:n]) )  / max(xx[1:n])
[1] 0.0002541798

This is than at least invariant against transformation of the edge length.
You can possibly come up with other invariant criteria which may are
even more appropriate for this case.

Cheers,
Klaus





On Wed, Aug 17, 2016 at 3:04 AM, Emmanuel Paradis
> wrote:

Hi Klaus,

The default is: is.ultrametric(phy, tol = .Machine$double.eps^0.5).
According to ?.Machine this value does not depend on the machine
precision. On my laptop, it gives:

R> .Machine$double.eps^0.5
[1] 1.490116e-08

Best,

Emmanuel


Le 16/08/2016 à 18:15, Klaus Schliep a écrit :

We should consider to improve is.ultrametric to use as tolerance
a certain
number significant figures (e.g. 8-10 digits). This way tol
would only
depend on the tip-to-root distance and not a machine dependent
minimal
value. I find the use of significant figures suits really well as a
stopping criterion for example in my ML functions, especially as
it works
for small and large trees equally well.

write.tree has an option to define the number of digits, it will be
generally less than the internal representation and I suspect
one could
possible export with higher precision from other programs, but
will result
in larger file sizes which one has to put in consideration for
MCMC /
bootstrap tree files.
As a side note on the developer site of the r-project.org
 homepage (not
CRAN) is a link to this nice ancient paper (
http://www.validlab.com/goldberg/paper.pdf
)

Regards,
Klaus


PS: And Martin of course I am happy with Liam's solution as it uses
phangorn ;)

On Tue, Aug 16, 2016 at 10:22 AM, Joseph W. Brown
>
wrote:

That’s a good tip, but the issue here is that many packages use
is.ultrametric internally with a hard-coded (likely,
default) value of tol.
In this case, Martin simply cannot perform the analyses he
wants to run
because this option is inaccessible.

JWB

Joseph W. Brown
Post-doctoral Researcher, Smith Laboratory
University of Michigan
Department of Ecology & Evolutionary Biology
Room 2071, Kraus Natural Sciences Building
Ann Arbor MI 48109-1079
josep...@umich.edu 



On 16 Aug, 2016, at 10:15, Klaus Schliep
>
wrote:

Hello all,
this may come be surprising to many, but consulting the manual
?is.ultrametric can be helpful. Why not simply try e.g.
is.ultrametric(tree, tol=.01) 
So in this sense RTFM
Regards,
Klaus

On Aug 16, 2016 9:31 AM, "Martin Dohrmann"
>
wrote:


Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:

I agree that it is almost certainly numerical
precision, as rescaling

the tree fixes things:


is.ultrametric(phy);

[1] FALSE

fie <- phy;
fie$edge.length <- 

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-17 Thread Klaus Schliep
Hi Emmanuel,

it wasn't so much about the precision, but that it is not invariant against
linear transformation of the edge length.
At the moment the criterion inside is.ultrametric is the following:
var(xx[1:n])
where xx[1:n] is a vector with the tip-to-toot differences. And
is.ultrametric returns FALSE if the result of the expression larger than
tol.
What I suggest is doing something like this:
( max(xx[1:n]) - min(xx[1:n]) )  / max(xx[1:n])

Here is a small example:
set.seed(42)
tree <- read.tree(text=write.tree(rcoal(100), digits=4))
is.ultrametric(tree) # returns FALSE

And the 2 criteria are:
var(xx[1:n])
[1] 2.078812e-08
( max(xx[1:n]) - min(xx[1:n]) )  / max(xx[1:n])
[1] 0.0002541798

tree2 <- tree
tree2$edge.length[] = tree2$edge.length * 1000
is.ultrametric(tree2)

var(xx[1:n])
[1] 0.02078812
( max(xx[1:n]) - min(xx[1:n]) )  / max(xx[1:n])
[1] 0.0002541798

This is than at least invariant against transformation of the edge length.
You can possibly come up with other invariant criteria which may are even
more appropriate for this case.

Cheers,
Klaus





On Wed, Aug 17, 2016 at 3:04 AM, Emmanuel Paradis 
wrote:

> Hi Klaus,
>
> The default is: is.ultrametric(phy, tol = .Machine$double.eps^0.5).
> According to ?.Machine this value does not depend on the machine precision.
> On my laptop, it gives:
>
> R> .Machine$double.eps^0.5
> [1] 1.490116e-08
>
> Best,
>
> Emmanuel
>
>
> Le 16/08/2016 à 18:15, Klaus Schliep a écrit :
>
>> We should consider to improve is.ultrametric to use as tolerance a certain
>> number significant figures (e.g. 8-10 digits). This way tol would only
>> depend on the tip-to-root distance and not a machine dependent minimal
>> value. I find the use of significant figures suits really well as a
>> stopping criterion for example in my ML functions, especially as it works
>> for small and large trees equally well.
>>
>> write.tree has an option to define the number of digits, it will be
>> generally less than the internal representation and I suspect one could
>> possible export with higher precision from other programs, but will result
>> in larger file sizes which one has to put in consideration for MCMC /
>> bootstrap tree files.
>> As a side note on the developer site of the r-project.org homepage (not
>> CRAN) is a link to this nice ancient paper (
>> http://www.validlab.com/goldberg/paper.pdf)
>>
>> Regards,
>> Klaus
>>
>>
>> PS: And Martin of course I am happy with Liam's solution as it uses
>> phangorn ;)
>>
>> On Tue, Aug 16, 2016 at 10:22 AM, Joseph W. Brown 
>> wrote:
>>
>> That’s a good tip, but the issue here is that many packages use
>>> is.ultrametric internally with a hard-coded (likely, default) value of
>>> tol.
>>> In this case, Martin simply cannot perform the analyses he wants to run
>>> because this option is inaccessible.
>>>
>>> JWB
>>> 
>>> Joseph W. Brown
>>> Post-doctoral Researcher, Smith Laboratory
>>> University of Michigan
>>> Department of Ecology & Evolutionary Biology
>>> Room 2071, Kraus Natural Sciences Building
>>> Ann Arbor MI 48109-1079
>>> josep...@umich.edu
>>>
>>>
>>>
>>> On 16 Aug, 2016, at 10:15, Klaus Schliep 
>>> wrote:
>>>
>>> Hello all,
>>> this may come be surprising to many, but consulting the manual
>>> ?is.ultrametric can be helpful. Why not simply try e.g.
>>> is.ultrametric(tree, tol=.01) 
>>> So in this sense RTFM
>>> Regards,
>>> Klaus
>>>
>>> On Aug 16, 2016 9:31 AM, "Martin Dohrmann" <
>>> m.dohrm...@lrz.uni-muenchen.de>
>>> wrote:
>>>
>>>
 Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:

 I agree that it is almost certainly numerical precision, as rescaling
>
 the tree fixes things:

>
> is.ultrametric(phy);
>>
> [1] FALSE
>
>> fie <- phy;
>> fie$edge.length <- fie$edge.length * 0.1;
>> is.ultrametric(fie);
>>
> [1] TRUE
>
> I’ve also tested the ultrametricity(?) with a non-R program and the
>
 results are the same. So can we assume this is not a PhyloBayes issue,
 and
 rather an unavoidable problem with large, old trees? But the fact that
 MrBayes trees are ultrametric is confusing; does MrBayes use less
 precise
 edge lengths?

 Actually the MrBayes branch lengths appear to be MORE precise.

 Martin


>> On 16 Aug, 2016, at 08:53, Liam J. Revell 
>> wrote:
>>
>> Hi Martin.
>>
>> Since you are writing & reading trees to file, my guess is that it has
>>
> to do with numerical precision - that is, the rounding of your edge
 lengths
 when they are written to file.

>
>> Does your tree look ultrametric when plotted in R? If so, this is
>>
> probably the case.

>
>> My recommendation is that you use phangorn to compute the non-negative
>>
> least-squares edge lengths with the condition that 

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Joseph W. Brown
Comparing floating point numbers is (at least for me) pretty scary when you get 
down into it.

Here are some more accessible treatments (although Goldberg’s paper seems to be 
the definitive treatment on the subject):

What Every Programmer Should Know About Floating-Point Arithmetic: 
http://floating-point-gui.de

Comparing Floating Point Numbers, 2012 Edition: 
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

HTH.
JWB

Joseph W. Brown
Post-doctoral Researcher, Smith Laboratory
University of Michigan
Department of Ecology & Evolutionary Biology
Room 2071, Kraus Natural Sciences Building
Ann Arbor MI 48109-1079
josep...@umich.edu



> On 16 Aug, 2016, at 12:15, Klaus Schliep  wrote:
> 
> We should consider to improve is.ultrametric to use as tolerance a certain 
> number significant figures (e.g. 8-10 digits). This way tol would only depend 
> on the tip-to-root distance and not a machine dependent minimal value. I find 
> the use of significant figures suits really well as a stopping criterion for 
> example in my ML functions, especially as it works for small and large trees 
> equally well. 
> 
> write.tree has an option to define the number of digits, it will be generally 
> less than the internal representation and I suspect one could possible export 
> with higher precision from other programs, but will result in larger file 
> sizes which one has to put in consideration for MCMC / bootstrap tree files.  
>   
> As a side note on the developer site of the r-project.org 
>  homepage (not CRAN) is a link to this nice ancient 
> paper (http://www.validlab.com/goldberg/paper.pdf 
> )
> 
> Regards, 
> Klaus
> 
> 
> PS: And Martin of course I am happy with Liam's solution as it uses phangorn 
> ;)
> 
> On Tue, Aug 16, 2016 at 10:22 AM, Joseph W. Brown  > wrote:
> That’s a good tip, but the issue here is that many packages use 
> is.ultrametric internally with a hard-coded (likely, default) value of tol. 
> In this case, Martin simply cannot perform the analyses he wants to run 
> because this option is inaccessible.
> 
> JWB
> 
> Joseph W. Brown
> Post-doctoral Researcher, Smith Laboratory
> University of Michigan
> Department of Ecology & Evolutionary Biology
> Room 2071, Kraus Natural Sciences Building
> Ann Arbor MI 48109-1079
> josep...@umich.edu 
> 
> 
> 
>> On 16 Aug, 2016, at 10:15, Klaus Schliep > > wrote:
>> 
>> Hello all,
>> this may come be surprising to many, but consulting the manual 
>> ?is.ultrametric can be helpful. Why not simply try e.g. is.ultrametric(tree, 
>> tol=.01) 
>> So in this sense RTFM 
>> Regards,
>> Klaus
>> 
>> 
>> On Aug 16, 2016 9:31 AM, "Martin Dohrmann" > > wrote:
>> 
>> Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:
>> 
>> > I agree that it is almost certainly numerical precision, as rescaling the 
>> > tree fixes things:
>> >
>> > > is.ultrametric(phy);
>> > [1] FALSE
>> > > fie <- phy;
>> > > fie$edge.length <- fie$edge.length * 0.1;
>> > > is.ultrametric(fie);
>> > [1] TRUE
>> >
>> > I’ve also tested the ultrametricity(?) with a non-R program and the 
>> > results are the same. So can we assume this is not a PhyloBayes issue, and 
>> > rather an unavoidable problem with large, old trees? But the fact that 
>> > MrBayes trees are ultrametric is confusing; does MrBayes use less precise 
>> > edge lengths?
>> 
>> Actually the MrBayes branch lengths appear to be MORE precise.
>> 
>> Martin
>> 
>> >>
>> >> On 16 Aug, 2016, at 08:53, Liam J. Revell > >> > wrote:
>> >>
>> >> Hi Martin.
>> >>
>> >> Since you are writing & reading trees to file, my guess is that it has to 
>> >> do with numerical precision - that is, the rounding of your edge lengths 
>> >> when they are written to file.
>> >>
>> >> Does your tree look ultrametric when plotted in R? If so, this is 
>> >> probably the case.
>> >>
>> >> My recommendation is that you use phangorn to compute the non-negative 
>> >> least-squares edge lengths with the condition that the tree is 
>> >> ultrametric. This will give you the edge lengths that result in the 
>> >> distances between taxa with minimum sum of squared differences from the 
>> >> distances implied by your input tree, under the criterion that the 
>> >> resulting tree is ultrametric.
>> >>
>> >> To do this you need to merely run:
>> >>
>> >> library(phytools)
>> >> library(phangorn)
>> >> is.ultrametric(tree) ## fails
>> >> plotTree(tree,ftype="off") ## does my tree look ultrametric?
>> >> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
>> >> is.ultrametric(tree) ## should pass
>> >>

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Klaus Schliep
We should consider to improve is.ultrametric to use as tolerance a certain
number significant figures (e.g. 8-10 digits). This way tol would only
depend on the tip-to-root distance and not a machine dependent minimal
value. I find the use of significant figures suits really well as a
stopping criterion for example in my ML functions, especially as it works
for small and large trees equally well.

write.tree has an option to define the number of digits, it will be
generally less than the internal representation and I suspect one could
possible export with higher precision from other programs, but will result
in larger file sizes which one has to put in consideration for MCMC /
bootstrap tree files.
As a side note on the developer site of the r-project.org homepage (not
CRAN) is a link to this nice ancient paper (
http://www.validlab.com/goldberg/paper.pdf)

Regards,
Klaus


PS: And Martin of course I am happy with Liam's solution as it uses
phangorn ;)

On Tue, Aug 16, 2016 at 10:22 AM, Joseph W. Brown 
wrote:

> That’s a good tip, but the issue here is that many packages use
> is.ultrametric internally with a hard-coded (likely, default) value of tol.
> In this case, Martin simply cannot perform the analyses he wants to run
> because this option is inaccessible.
>
> JWB
> 
> Joseph W. Brown
> Post-doctoral Researcher, Smith Laboratory
> University of Michigan
> Department of Ecology & Evolutionary Biology
> Room 2071, Kraus Natural Sciences Building
> Ann Arbor MI 48109-1079
> josep...@umich.edu
>
>
>
> On 16 Aug, 2016, at 10:15, Klaus Schliep  wrote:
>
> Hello all,
> this may come be surprising to many, but consulting the manual
> ?is.ultrametric can be helpful. Why not simply try e.g.
> is.ultrametric(tree, tol=.01) 
> So in this sense RTFM
> Regards,
> Klaus
>
> On Aug 16, 2016 9:31 AM, "Martin Dohrmann" 
> wrote:
>
>>
>> Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:
>>
>> > I agree that it is almost certainly numerical precision, as rescaling
>> the tree fixes things:
>> >
>> > > is.ultrametric(phy);
>> > [1] FALSE
>> > > fie <- phy;
>> > > fie$edge.length <- fie$edge.length * 0.1;
>> > > is.ultrametric(fie);
>> > [1] TRUE
>> >
>> > I’ve also tested the ultrametricity(?) with a non-R program and the
>> results are the same. So can we assume this is not a PhyloBayes issue, and
>> rather an unavoidable problem with large, old trees? But the fact that
>> MrBayes trees are ultrametric is confusing; does MrBayes use less precise
>> edge lengths?
>>
>> Actually the MrBayes branch lengths appear to be MORE precise.
>>
>> Martin
>>
>> >>
>> >> On 16 Aug, 2016, at 08:53, Liam J. Revell  wrote:
>> >>
>> >> Hi Martin.
>> >>
>> >> Since you are writing & reading trees to file, my guess is that it has
>> to do with numerical precision - that is, the rounding of your edge lengths
>> when they are written to file.
>> >>
>> >> Does your tree look ultrametric when plotted in R? If so, this is
>> probably the case.
>> >>
>> >> My recommendation is that you use phangorn to compute the non-negative
>> least-squares edge lengths with the condition that the tree is ultrametric.
>> This will give you the edge lengths that result in the distances between
>> taxa with minimum sum of squared differences from the distances implied by
>> your input tree, under the criterion that the resulting tree is ultrametric.
>> >>
>> >> To do this you need to merely run:
>> >>
>> >> library(phytools)
>> >> library(phangorn)
>> >> is.ultrametric(tree) ## fails
>> >> plotTree(tree,ftype="off") ## does my tree look ultrametric?
>> >> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
>> >> is.ultrametric(tree) ## should pass
>> >>
>> >> Let us know if this works. All the best, Liam
>> >>
>> >> Liam J. Revell, Associate Professor of Biology
>> >> University of Massachusetts Boston
>> >> web: http://faculty.umb.edu/liam.revell/
>> >> email: liam.rev...@umb.edu
>> >> blog: http://blog.phytools.org
>> >>
>> >> On 8/16/2016 6:41 AM, Martin Dohrmann wrote:
>> >>> Hi,
>> >>> I want to do some diversification pattern analyses with various R
>> packages. I'm using a time-calibrated tree produced by PhyloBayes. Branch
>> lengths are in millions of years and all taxa are extant, so the tree
>> should be ultrametric. However, when I call "is.ultrametric", it returns
>> "FALSE".
>> >>>
>> >>> Has anybody encountered something like this? Any ideas about what's
>> going on/how to solve this?
>> >>>
>> >>> Some further information:
>> >>> I also tried other PhyloBayes time trees, with the same result. In
>> contrast, MrBayes time trees I tried for comparison are recognized as
>> ultrametric. Regarding my diversification analyses, TESS would not run,
>> telling me "The likelihood function is only defined for ultrametric
>> trees!". On the other hand, BAMMtools doesn't seem to have a problem with
>> my tree. I haven't 

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Martin Dohrmann
Actually I did play around with different tol values and I could get 
is.ultrametric to recognize my tree. But, exactly as Joseph says, this doesn't 
really help. Anyway, Liam's suggestion solved the problem.

Martin   

Am 16.08.2016 um 16:22 schrieb Joseph W. Brown:

> That�s a good tip, but the issue here is that many packages use 
> is.ultrametric internally with a hard-coded (likely, default) value of tol. 
> In this case, Martin simply cannot perform the analyses he wants to run 
> because this option is inaccessible.
> 
> JWB
> 
> Joseph W. Brown
> Post-doctoral Researcher, Smith Laboratory
> University of Michigan
> Department of Ecology & Evolutionary Biology
> Room 2071, Kraus Natural Sciences Building
> Ann Arbor MI 48109-1079
> josep...@umich.edu
> 
> 
> 
>> On 16 Aug, 2016, at 10:15, Klaus Schliep  wrote:
>> 
>> Hello all,
>> this may come be surprising to many, but consulting the manual 
>> ?is.ultrametric can be helpful. Why not simply try e.g. is.ultrametric(tree, 
>> tol=.01) 
>> So in this sense RTFM 
>> Regards,
>> Klaus
>> 
>> 
>> On Aug 16, 2016 9:31 AM, "Martin Dohrmann"  
>> wrote:
>> 
>> Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:
>> 
>> > I agree that it is almost certainly numerical precision, as rescaling the 
>> > tree fixes things:
>> >
>> > > is.ultrametric(phy);
>> > [1] FALSE
>> > > fie <- phy;
>> > > fie$edge.length <- fie$edge.length * 0.1;
>> > > is.ultrametric(fie);
>> > [1] TRUE
>> >
>> > I�ve also tested the ultrametricity(?) with a non-R program and the 
>> > results are the same. So can we assume this is not a PhyloBayes issue, and 
>> > rather an unavoidable problem with large, old trees? But the fact that 
>> > MrBayes trees are ultrametric is confusing; does MrBayes use less precise 
>> > edge lengths?
>> 
>> Actually the MrBayes branch lengths appear to be MORE precise.
>> 
>> Martin
>> 
>> >>
>> >> On 16 Aug, 2016, at 08:53, Liam J. Revell  wrote:
>> >>
>> >> Hi Martin.
>> >>
>> >> Since you are writing & reading trees to file, my guess is that it has to 
>> >> do with numerical precision - that is, the rounding of your edge lengths 
>> >> when they are written to file.
>> >>
>> >> Does your tree look ultrametric when plotted in R? If so, this is 
>> >> probably the case.
>> >>
>> >> My recommendation is that you use phangorn to compute the non-negative 
>> >> least-squares edge lengths with the condition that the tree is 
>> >> ultrametric. This will give you the edge lengths that result in the 
>> >> distances between taxa with minimum sum of squared differences from the 
>> >> distances implied by your input tree, under the criterion that the 
>> >> resulting tree is ultrametric.
>> >>
>> >> To do this you need to merely run:
>> >>
>> >> library(phytools)
>> >> library(phangorn)
>> >> is.ultrametric(tree) ## fails
>> >> plotTree(tree,ftype="off") ## does my tree look ultrametric?
>> >> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
>> >> is.ultrametric(tree) ## should pass
>> >>
>> >> Let us know if this works. All the best, Liam
>> >>
>> >> Liam J. Revell, Associate Professor of Biology
>> >> University of Massachusetts Boston
>> >> web: http://faculty.umb.edu/liam.revell/
>> >> email: liam.rev...@umb.edu
>> >> blog: http://blog.phytools.org
>> >>
>> >> On 8/16/2016 6:41 AM, Martin Dohrmann wrote:
>> >>> Hi,
>> >>> I want to do some diversification pattern analyses with various R 
>> >>> packages. I'm using a time-calibrated tree produced by PhyloBayes. 
>> >>> Branch lengths are in millions of years and all taxa are extant, so the 
>> >>> tree should be ultrametric. However, when I call "is.ultrametric", it 
>> >>> returns "FALSE".
>> >>>
>> >>> Has anybody encountered something like this? Any ideas about what's 
>> >>> going on/how to solve this?
>> >>>
>> >>> Some further information:
>> >>> I also tried other PhyloBayes time trees, with the same result. In 
>> >>> contrast, MrBayes time trees I tried for comparison are recognized as 
>> >>> ultrametric. Regarding my diversification analyses, TESS would not run, 
>> >>> telling me "The likelihood function is only defined for ultrametric 
>> >>> trees!". On the other hand, BAMMtools doesn't seem to have a problem 
>> >>> with my tree. I haven't tried other packages yet, but I suspect RPANDA, 
>> >>> TreePar etc. might also have issues if they don't recognize my tree as 
>> >>> ultrametric.
>> >>>
>> >>> I'd appreciate any help!
>> >>>
>> >>> Best wishes,
>> >>> Martin
>> >>>
>> >>> Dr. Martin Dohrmann
>> >>> Ludwig-Maximilians-University Munich
>> >>> Dept. of Earth & Environmental Sciences
>> >>> Palaeontology & Geobiology
>> >>> Molecular Geo- & Palaeobiology Lab
>> >>> Richard-Wagner-Str. 10
>> >>> 80333 Munich, Germany
>> >>> Phone: +49-(0)89-2180-6593
>> >>>
>> >>>
>> >>> [[alternative HTML version deleted]]
>> >>>
>> >>> ___

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Joseph W. Brown
That’s a good tip, but the issue here is that many packages use is.ultrametric 
internally with a hard-coded (likely, default) value of tol. In this case, 
Martin simply cannot perform the analyses he wants to run because this option 
is inaccessible.

JWB

Joseph W. Brown
Post-doctoral Researcher, Smith Laboratory
University of Michigan
Department of Ecology & Evolutionary Biology
Room 2071, Kraus Natural Sciences Building
Ann Arbor MI 48109-1079
josep...@umich.edu



> On 16 Aug, 2016, at 10:15, Klaus Schliep  wrote:
> 
> Hello all,
> this may come be surprising to many, but consulting the manual 
> ?is.ultrametric can be helpful. Why not simply try e.g. is.ultrametric(tree, 
> tol=.01) 
> So in this sense RTFM 
> Regards,
> Klaus
> 
> 
> On Aug 16, 2016 9:31 AM, "Martin Dohrmann"  > wrote:
> 
> Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:
> 
> > I agree that it is almost certainly numerical precision, as rescaling the 
> > tree fixes things:
> >
> > > is.ultrametric(phy);
> > [1] FALSE
> > > fie <- phy;
> > > fie$edge.length <- fie$edge.length * 0.1;
> > > is.ultrametric(fie);
> > [1] TRUE
> >
> > I’ve also tested the ultrametricity(?) with a non-R program and the results 
> > are the same. So can we assume this is not a PhyloBayes issue, and rather 
> > an unavoidable problem with large, old trees? But the fact that MrBayes 
> > trees are ultrametric is confusing; does MrBayes use less precise edge 
> > lengths?
> 
> Actually the MrBayes branch lengths appear to be MORE precise.
> 
> Martin
> 
> >>
> >> On 16 Aug, 2016, at 08:53, Liam J. Revell  >> > wrote:
> >>
> >> Hi Martin.
> >>
> >> Since you are writing & reading trees to file, my guess is that it has to 
> >> do with numerical precision - that is, the rounding of your edge lengths 
> >> when they are written to file.
> >>
> >> Does your tree look ultrametric when plotted in R? If so, this is probably 
> >> the case.
> >>
> >> My recommendation is that you use phangorn to compute the non-negative 
> >> least-squares edge lengths with the condition that the tree is 
> >> ultrametric. This will give you the edge lengths that result in the 
> >> distances between taxa with minimum sum of squared differences from the 
> >> distances implied by your input tree, under the criterion that the 
> >> resulting tree is ultrametric.
> >>
> >> To do this you need to merely run:
> >>
> >> library(phytools)
> >> library(phangorn)
> >> is.ultrametric(tree) ## fails
> >> plotTree(tree,ftype="off") ## does my tree look ultrametric?
> >> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
> >> is.ultrametric(tree) ## should pass
> >>
> >> Let us know if this works. All the best, Liam
> >>
> >> Liam J. Revell, Associate Professor of Biology
> >> University of Massachusetts Boston
> >> web: http://faculty.umb.edu/liam.revell/ 
> >> 
> >> email: liam.rev...@umb.edu 
> >> blog: http://blog.phytools.org 
> >>
> >> On 8/16/2016 6:41 AM, Martin Dohrmann wrote:
> >>> Hi,
> >>> I want to do some diversification pattern analyses with various R 
> >>> packages. I'm using a time-calibrated tree produced by PhyloBayes. Branch 
> >>> lengths are in millions of years and all taxa are extant, so the tree 
> >>> should be ultrametric. However, when I call "is.ultrametric", it returns 
> >>> "FALSE".
> >>>
> >>> Has anybody encountered something like this? Any ideas about what's going 
> >>> on/how to solve this?
> >>>
> >>> Some further information:
> >>> I also tried other PhyloBayes time trees, with the same result. In 
> >>> contrast, MrBayes time trees I tried for comparison are recognized as 
> >>> ultrametric. Regarding my diversification analyses, TESS would not run, 
> >>> telling me "The likelihood function is only defined for ultrametric 
> >>> trees!". On the other hand, BAMMtools doesn't seem to have a problem with 
> >>> my tree. I haven't tried other packages yet, but I suspect RPANDA, 
> >>> TreePar etc. might also have issues if they don't recognize my tree as 
> >>> ultrametric.
> >>>
> >>> I'd appreciate any help!
> >>>
> >>> Best wishes,
> >>> Martin
> >>>
> >>> Dr. Martin Dohrmann
> >>> Ludwig-Maximilians-University Munich
> >>> Dept. of Earth & Environmental Sciences
> >>> Palaeontology & Geobiology
> >>> Molecular Geo- & Palaeobiology Lab
> >>> Richard-Wagner-Str. 10
> >>> 80333 Munich, Germany
> >>> Phone: +49-(0)89-2180-6593 
> >>>
> >>>
> >>> [[alternative HTML version deleted]]
> >>>
> >>> ___
> >>> R-sig-phylo mailing list - R-sig-phylo@r-project.org 
> >>> 
> >>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo 
> >>> 

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Klaus Schliep
Hello all,
this may come be surprising to many, but consulting the manual
?is.ultrametric can be helpful. Why not simply try e.g.
is.ultrametric(tree, tol=.01) 
So in this sense RTFM
Regards,
Klaus

On Aug 16, 2016 9:31 AM, "Martin Dohrmann" 
wrote:

>
> Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:
>
> > I agree that it is almost certainly numerical precision, as rescaling
> the tree fixes things:
> >
> > > is.ultrametric(phy);
> > [1] FALSE
> > > fie <- phy;
> > > fie$edge.length <- fie$edge.length * 0.1;
> > > is.ultrametric(fie);
> > [1] TRUE
> >
> > I’ve also tested the ultrametricity(?) with a non-R program and the
> results are the same. So can we assume this is not a PhyloBayes issue, and
> rather an unavoidable problem with large, old trees? But the fact that
> MrBayes trees are ultrametric is confusing; does MrBayes use less precise
> edge lengths?
>
> Actually the MrBayes branch lengths appear to be MORE precise.
>
> Martin
>
> >>
> >> On 16 Aug, 2016, at 08:53, Liam J. Revell  wrote:
> >>
> >> Hi Martin.
> >>
> >> Since you are writing & reading trees to file, my guess is that it has
> to do with numerical precision - that is, the rounding of your edge lengths
> when they are written to file.
> >>
> >> Does your tree look ultrametric when plotted in R? If so, this is
> probably the case.
> >>
> >> My recommendation is that you use phangorn to compute the non-negative
> least-squares edge lengths with the condition that the tree is ultrametric.
> This will give you the edge lengths that result in the distances between
> taxa with minimum sum of squared differences from the distances implied by
> your input tree, under the criterion that the resulting tree is ultrametric.
> >>
> >> To do this you need to merely run:
> >>
> >> library(phytools)
> >> library(phangorn)
> >> is.ultrametric(tree) ## fails
> >> plotTree(tree,ftype="off") ## does my tree look ultrametric?
> >> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
> >> is.ultrametric(tree) ## should pass
> >>
> >> Let us know if this works. All the best, Liam
> >>
> >> Liam J. Revell, Associate Professor of Biology
> >> University of Massachusetts Boston
> >> web: http://faculty.umb.edu/liam.revell/
> >> email: liam.rev...@umb.edu
> >> blog: http://blog.phytools.org
> >>
> >> On 8/16/2016 6:41 AM, Martin Dohrmann wrote:
> >>> Hi,
> >>> I want to do some diversification pattern analyses with various R
> packages. I'm using a time-calibrated tree produced by PhyloBayes. Branch
> lengths are in millions of years and all taxa are extant, so the tree
> should be ultrametric. However, when I call "is.ultrametric", it returns
> "FALSE".
> >>>
> >>> Has anybody encountered something like this? Any ideas about what's
> going on/how to solve this?
> >>>
> >>> Some further information:
> >>> I also tried other PhyloBayes time trees, with the same result. In
> contrast, MrBayes time trees I tried for comparison are recognized as
> ultrametric. Regarding my diversification analyses, TESS would not run,
> telling me "The likelihood function is only defined for ultrametric
> trees!". On the other hand, BAMMtools doesn't seem to have a problem with
> my tree. I haven't tried other packages yet, but I suspect RPANDA, TreePar
> etc. might also have issues if they don't recognize my tree as ultrametric.
> >>>
> >>> I'd appreciate any help!
> >>>
> >>> Best wishes,
> >>> Martin
> >>>
> >>> Dr. Martin Dohrmann
> >>> Ludwig-Maximilians-University Munich
> >>> Dept. of Earth & Environmental Sciences
> >>> Palaeontology & Geobiology
> >>> Molecular Geo- & Palaeobiology Lab
> >>> Richard-Wagner-Str. 10
> >>> 80333 Munich, Germany
> >>> Phone: +49-(0)89-2180-6593
> >>>
> >>>
> >>> [[alternative HTML version deleted]]
> >>>
> >>> ___
> >>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> >>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> >>> Searchable archive at http://www.mail-archive.com/r-
> sig-ph...@r-project.org/
> >>>
> >>
> >> ___
> >> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> >> Searchable archive at http://www.mail-archive.com/r-
> sig-ph...@r-project.org/
> >
>
> Dr. Martin Dohrmann
> Ludwig-Maximilians-University Munich
> Dept. of Earth & Environmental Sciences
> Palaeontology & Geobiology
> Molecular Geo- & Palaeobiology Lab
> Richard-Wagner-Str. 10
> 80333 Munich, Germany
> Phone: +49-(0)89-2180-6593
>
>
> [[alternative HTML version deleted]]
>
>
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-
> sig-ph...@r-project.org/
>

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - 

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Martin Dohrmann

Am 16.08.2016 um 15:20 schrieb Joseph W. Brown:

> I agree that it is almost certainly numerical precision, as rescaling the 
> tree fixes things:
> 
> > is.ultrametric(phy);
> [1] FALSE
> > fie <- phy;
> > fie$edge.length <- fie$edge.length * 0.1;
> > is.ultrametric(fie);
> [1] TRUE
> 
> I�ve also tested the ultrametricity(?) with a non-R program and the results 
> are the same. So can we assume this is not a PhyloBayes issue, and rather an 
> unavoidable problem with large, old trees? But the fact that MrBayes trees 
> are ultrametric is confusing; does MrBayes use less precise edge lengths?

Actually the MrBayes branch lengths appear to be MORE precise.

Martin

>> 
>> On 16 Aug, 2016, at 08:53, Liam J. Revell  wrote:
>> 
>> Hi Martin.
>> 
>> Since you are writing & reading trees to file, my guess is that it has to do 
>> with numerical precision - that is, the rounding of your edge lengths when 
>> they are written to file.
>> 
>> Does your tree look ultrametric when plotted in R? If so, this is probably 
>> the case.
>> 
>> My recommendation is that you use phangorn to compute the non-negative 
>> least-squares edge lengths with the condition that the tree is ultrametric. 
>> This will give you the edge lengths that result in the distances between 
>> taxa with minimum sum of squared differences from the distances implied by 
>> your input tree, under the criterion that the resulting tree is ultrametric.
>> 
>> To do this you need to merely run:
>> 
>> library(phytools)
>> library(phangorn)
>> is.ultrametric(tree) ## fails
>> plotTree(tree,ftype="off") ## does my tree look ultrametric?
>> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
>> is.ultrametric(tree) ## should pass
>> 
>> Let us know if this works. All the best, Liam
>> 
>> Liam J. Revell, Associate Professor of Biology
>> University of Massachusetts Boston
>> web: http://faculty.umb.edu/liam.revell/
>> email: liam.rev...@umb.edu
>> blog: http://blog.phytools.org
>> 
>> On 8/16/2016 6:41 AM, Martin Dohrmann wrote:
>>> Hi,
>>> I want to do some diversification pattern analyses with various R packages. 
>>> I'm using a time-calibrated tree produced by PhyloBayes. Branch lengths are 
>>> in millions of years and all taxa are extant, so the tree should be 
>>> ultrametric. However, when I call "is.ultrametric", it returns "FALSE".
>>> 
>>> Has anybody encountered something like this? Any ideas about what's going 
>>> on/how to solve this?
>>> 
>>> Some further information:
>>> I also tried other PhyloBayes time trees, with the same result. In 
>>> contrast, MrBayes time trees I tried for comparison are recognized as 
>>> ultrametric. Regarding my diversification analyses, TESS would not run, 
>>> telling me "The likelihood function is only defined for ultrametric 
>>> trees!". On the other hand, BAMMtools doesn't seem to have a problem with 
>>> my tree. I haven't tried other packages yet, but I suspect RPANDA, TreePar 
>>> etc. might also have issues if they don't recognize my tree as ultrametric.
>>> 
>>> I'd appreciate any help!
>>> 
>>> Best wishes,
>>> Martin
>>> 
>>> Dr. Martin Dohrmann
>>> Ludwig-Maximilians-University Munich
>>> Dept. of Earth & Environmental Sciences
>>> Palaeontology & Geobiology
>>> Molecular Geo- & Palaeobiology Lab
>>> Richard-Wagner-Str. 10
>>> 80333 Munich, Germany
>>> Phone: +49-(0)89-2180-6593
>>> 
>>> 
>>> [[alternative HTML version deleted]]
>>> 
>>> ___
>>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>>> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
>>> 
>> 
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
> 

Dr. Martin Dohrmann
Ludwig-Maximilians-University Munich
Dept. of Earth & Environmental Sciences
Palaeontology & Geobiology
Molecular Geo- & Palaeobiology Lab
Richard-Wagner-Str. 10
80333 Munich, Germany
Phone: +49-(0)89-2180-6593


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Joseph W. Brown
I agree that it is almost certainly numerical precision, as rescaling the tree 
fixes things:

> is.ultrametric(phy);
[1] FALSE
> fie <- phy;
> fie$edge.length <- fie$edge.length * 0.1;
> is.ultrametric(fie);
[1] TRUE

I’ve also tested the ultrametricity(?) with a non-R program and the results are 
the same. So can we assume this is not a PhyloBayes issue, and rather an 
unavoidable problem with large, old trees? But the fact that MrBayes trees are 
ultrametric is confusing; does MrBayes use less precise edge lengths?

JWB

Joseph W. Brown
Post-doctoral Researcher, Smith Laboratory
University of Michigan
Department of Ecology & Evolutionary Biology
Room 2071, Kraus Natural Sciences Building
Ann Arbor MI 48109-1079
josep...@umich.edu



> On 16 Aug, 2016, at 08:53, Liam J. Revell  wrote:
> 
> Hi Martin.
> 
> Since you are writing & reading trees to file, my guess is that it has to do 
> with numerical precision - that is, the rounding of your edge lengths when 
> they are written to file.
> 
> Does your tree look ultrametric when plotted in R? If so, this is probably 
> the case.
> 
> My recommendation is that you use phangorn to compute the non-negative 
> least-squares edge lengths with the condition that the tree is ultrametric. 
> This will give you the edge lengths that result in the distances between taxa 
> with minimum sum of squared differences from the distances implied by your 
> input tree, under the criterion that the resulting tree is ultrametric.
> 
> To do this you need to merely run:
> 
> library(phytools)
> library(phangorn)
> is.ultrametric(tree) ## fails
> plotTree(tree,ftype="off") ## does my tree look ultrametric?
> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
> is.ultrametric(tree) ## should pass
> 
> Let us know if this works. All the best, Liam
> 
> Liam J. Revell, Associate Professor of Biology
> University of Massachusetts Boston
> web: http://faculty.umb.edu/liam.revell/
> email: liam.rev...@umb.edu
> blog: http://blog.phytools.org
> 
> On 8/16/2016 6:41 AM, Martin Dohrmann wrote:
>> Hi,
>> I want to do some diversification pattern analyses with various R packages. 
>> I'm using a time-calibrated tree produced by PhyloBayes. Branch lengths are 
>> in millions of years and all taxa are extant, so the tree should be 
>> ultrametric. However, when I call "is.ultrametric", it returns "FALSE".
>> 
>> Has anybody encountered something like this? Any ideas about what's going 
>> on/how to solve this?
>> 
>> Some further information:
>> I also tried other PhyloBayes time trees, with the same result. In contrast, 
>> MrBayes time trees I tried for comparison are recognized as ultrametric. 
>> Regarding my diversification analyses, TESS would not run, telling me "The 
>> likelihood function is only defined for ultrametric trees!". On the other 
>> hand, BAMMtools doesn't seem to have a problem with my tree. I haven't tried 
>> other packages yet, but I suspect RPANDA, TreePar etc. might also have 
>> issues if they don't recognize my tree as ultrametric.
>> 
>> I'd appreciate any help!
>> 
>> Best wishes,
>> Martin
>> 
>> Dr. Martin Dohrmann
>> Ludwig-Maximilians-University Munich
>> Dept. of Earth & Environmental Sciences
>> Palaeontology & Geobiology
>> Molecular Geo- & Palaeobiology Lab
>> Richard-Wagner-Str. 10
>> 80333 Munich, Germany
>> Phone: +49-(0)89-2180-6593
>> 
>> 
>>  [[alternative HTML version deleted]]
>> 
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
>> 
> 
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Martin Dohrmann
Thanks a lot, that did the trick! 

(the last line should read "is.ultrametric(nnls)" though)

Best wishes,
Martin

Am 16.08.2016 um 14:53 schrieb Liam J. Revell:

> Hi Martin.
> 
> Since you are writing & reading trees to file, my guess is that it has to do 
> with numerical precision - that is, the rounding of your edge lengths when 
> they are written to file.
> 
> Does your tree look ultrametric when plotted in R? If so, this is probably 
> the case.
> 
> My recommendation is that you use phangorn to compute the non-negative 
> least-squares edge lengths with the condition that the tree is ultrametric. 
> This will give you the edge lengths that result in the distances between taxa 
> with minimum sum of squared differences from the distances implied by your 
> input tree, under the criterion that the resulting tree is ultrametric.
> 
> To do this you need to merely run:
> 
> library(phytools)
> library(phangorn)
> is.ultrametric(tree) ## fails
> plotTree(tree,ftype="off") ## does my tree look ultrametric?
> nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
> is.ultrametric(tree) ## should pass
> 
> Let us know if this works. All the best, Liam
> 
> Liam J. Revell, Associate Professor of Biology
> University of Massachusetts Boston
> web: http://faculty.umb.edu/liam.revell/
> email: liam.rev...@umb.edu
> blog: http://blog.phytools.org
> 
> On 8/16/2016 6:41 AM, Martin Dohrmann wrote:
>> Hi,
>> I want to do some diversification pattern analyses with various R packages. 
>> I'm using a time-calibrated tree produced by PhyloBayes. Branch lengths are 
>> in millions of years and all taxa are extant, so the tree should be 
>> ultrametric. However, when I call "is.ultrametric", it returns "FALSE".
>> 
>> Has anybody encountered something like this? Any ideas about what's going 
>> on/how to solve this?
>> 
>> Some further information:
>> I also tried other PhyloBayes time trees, with the same result. In contrast, 
>> MrBayes time trees I tried for comparison are recognized as ultrametric. 
>> Regarding my diversification analyses, TESS would not run, telling me "The 
>> likelihood function is only defined for ultrametric trees!". On the other 
>> hand, BAMMtools doesn't seem to have a problem with my tree. I haven't tried 
>> other packages yet, but I suspect RPANDA, TreePar etc. might also have 
>> issues if they don't recognize my tree as ultrametric.
>> 
>> I'd appreciate any help!
>> 
>> Best wishes,
>> Martin
>> 
>> Dr. Martin Dohrmann
>> Ludwig-Maximilians-University Munich
>> Dept. of Earth & Environmental Sciences
>> Palaeontology & Geobiology
>> Molecular Geo- & Palaeobiology Lab
>> Richard-Wagner-Str. 10
>> 80333 Munich, Germany
>> Phone: +49-(0)89-2180-6593
>> 
>> 
>>  [[alternative HTML version deleted]]
>> 
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
>> 

Dr. Martin Dohrmann
Ludwig-Maximilians-University Munich
Dept. of Earth & Environmental Sciences
Palaeontology & Geobiology
Molecular Geo- & Palaeobiology Lab
Richard-Wagner-Str. 10
80333 Munich, Germany
Phone: +49-(0)89-2180-6593


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-16 Thread Liam J. Revell

Hi Martin.

Since you are writing & reading trees to file, my guess is that it has 
to do with numerical precision - that is, the rounding of your edge 
lengths when they are written to file.


Does your tree look ultrametric when plotted in R? If so, this is 
probably the case.


My recommendation is that you use phangorn to compute the non-negative 
least-squares edge lengths with the condition that the tree is 
ultrametric. This will give you the edge lengths that result in the 
distances between taxa with minimum sum of squared differences from the 
distances implied by your input tree, under the criterion that the 
resulting tree is ultrametric.


To do this you need to merely run:

library(phytools)
library(phangorn)
is.ultrametric(tree) ## fails
plotTree(tree,ftype="off") ## does my tree look ultrametric?
nnls<-nnls.tree(cophenetic(tree),tree,rooted=TRUE)
is.ultrametric(tree) ## should pass

Let us know if this works. All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 8/16/2016 6:41 AM, Martin Dohrmann wrote:

Hi,
I want to do some diversification pattern analyses with various R packages. I'm using a 
time-calibrated tree produced by PhyloBayes. Branch lengths are in millions of years and all taxa 
are extant, so the tree should be ultrametric. However, when I call "is.ultrametric", it 
returns "FALSE".

Has anybody encountered something like this? Any ideas about what's going 
on/how to solve this?

Some further information:
I also tried other PhyloBayes time trees, with the same result. In contrast, MrBayes time 
trees I tried for comparison are recognized as ultrametric. Regarding my diversification 
analyses, TESS would not run, telling me "The likelihood function is only defined 
for ultrametric trees!". On the other hand, BAMMtools doesn't seem to have a problem 
with my tree. I haven't tried other packages yet, but I suspect RPANDA, TreePar etc. 
might also have issues if they don't recognize my tree as ultrametric.

I'd appreciate any help!

Best wishes,
Martin

Dr. Martin Dohrmann
Ludwig-Maximilians-University Munich
Dept. of Earth & Environmental Sciences
Palaeontology & Geobiology
Molecular Geo- & Palaeobiology Lab
Richard-Wagner-Str. 10
80333 Munich, Germany
Phone: +49-(0)89-2180-6593


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/



___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/