Dear Shinichi and List,

you could try to re-estimate ultrametric trees given the topology of the
(rooted) non-ultrametric trees and the original molecular data.

Here is a small example using either a distance based approach or maximum
likelihood (ML):

# load some data
library(phangorn)
data(Laurasiatherian)
dm <- dist.ml(Laurasiatherian)

treeNJ <- midpoint(nj(dm))
# let the neighbor joining tree the one we want to make ultrametric

# we can do with distance based methods (non-negative least-squares)
# reusing the distance matrix we computed above
treeUltra <- nnls.phylo(treeNJ, dm, rooted=TRUE)

# and we can optimize the ultrametric tree using ML
fit <- pml(treeUltra, Laurasiatherian, k=4)
# here it is important to provide the ultrametric tree
fit <- optim.pml(fit, optRooted=TRUE, model="GTR", optGamma=TRUE)

# if you like you can make tree rearrangements
fit2 <- optim.pml(fit, optRooted=TRUE, model="GTR", optGamma=TRUE,
rearrangement = "NNI")

par(mar = c(1,1,4,1))
par(mfrow = c(2, 2))
plot(treeNJ, main = "Original tree")
plot(treeUltra, main = "Ultrametric (distance)")
plot(fit, main = "Ultrametric (ML)")
plot(fit2, main = "Ultrametric (ML + NNI)")

Just a warning, the optimization of the ultrametric ML function is much
slower than the non-ultrametric one (a reason why non-ultrametric
optimization is so popular) and less well tested.

Cheers,
Klaus


On Mon, Oct 31, 2016 at 9:46 PM, Giulio V. Dalla Riva <gv...@uclive.ac.nz>
wrote:

> My 2cents on this.
>
>
> TL;DR: there *may* be good information in the non ultrametric tree, which
> we may *not* want to throw away lightheartedly.
>
> Long version: A phylogenetic model variance-covariance matrix is not, in
> general, the same thing of the pairwise phylogenetic distance matrix. They
> are proportional only in the case the rate of phenotypic evolution is
> constant across the tree (e.g., a Brownian Motion with one regime). In that
> case the "time available for phenotypic evolution" is, indeed, a predictor
> of the expected variance (and covariance) of a trait. But that is not
> always the case.
>
>
> And, indeed, "a model allowing for variation in rate of trait evolution"
> *does* correspond to a transformation of the "original" (time calibrated,
> ultrametric) phylogenetic tree into a tree, in general non ultrametric,
> where the length of the branches correspond to the expected amount of
> evolution. i.e., a model of punctuated evolution on the original tree
> corresponds to a Brownian Motion on a rescaled tree where each (inner or
> pendant) branch has the same length.
>
>
> A timed tree from molecular data may, actually, highlight how certain
> lineages evolved under a different mutation/selection regime to other
> branches. And the power to detect accelerated/slowed evolutionary rate may
> be higher from molecular data than from phenotypic data, so throwing that
> information away forcing the tree to be ultrametric may not be the best
> strategy. For example, there may be some particular trait that exhibit a
> different pattern from the overall evolutionary rate of the set of species
> we are looking at (e.g., a very labile trait evolving fast on some lineages
> where evolution is slow, or vice versa).
>
>
> I think there's a question there that need to be addressed: why were the
> trees non ultrametric at the first place?
>
>
> Giulio Valentino Dalla Riva
>
> Beaty Biodiversity Research Centre
> University of British Columbia
> Vancouver, Canada
> ________________________________
> From: R-sig-phylo <r-sig-phylo-boun...@r-project.org> on behalf of
> Alejandro Gonzalez Voyer <alejandro.gonza...@iecologia.unam.mx>
> Sent: October 31, 2016 12:56:02 PM
> To: Emmanuel Paradis
> Cc: R-phylo Mailing-list; Shinichi Nakagawa
> Subject: Re: [R-sig-phylo] Making ultrametric trees
>
> Hi,
>
> >> Note that vcv(nonultrametric_tree, cor=TRUE) is different from
> >> vcv(chronoMPL(nonultrametric_tree), cor = TRUE), which is relates to my
> >> previous question (which one is preferred?)
> >
> > It (mainly) depends whether you want to assume a "clock-like" evolution
> for the traits you are studying.
>
> Assuming that Sinichi is working with contemporaneous species, the
> assumption of comparative analyses is that the time available for
> phenotypic evolution (the off diagonal element of the VCV matrix) is the
> same for all species. The rate of phenotypic evolution may of course differ
> among species, but I think that this is not the same as allowing the
> expected change in the traits to depend on the branch lengths of a
> non-ultrametric tree, as would be the case in vcv(nonultrametric_tree,
> cor=TRUE). In such a case, a model allowing for variation in rate of trait
> evolution in conjunction with an ultrametric tree would be more
> appropriate. Of course, as pointed out by Brian, estimating divergence
> times is no piece of cake and there may be uncertainty associated with that
> step of phylogeny estimation as well.
>
> Cheers
>
> Alejandro
>
> _______________________________________________
> Dr Alejandro Gonzalez Voyer
> Newton Advanced Fellow
> Investigador Asociado C
>
> Laboratorio de Conducta Animal
> Instituto de Ecología
> Circuito Exterior S/N
> Ciudad Universitaria
> Universidad Nacional Autónoma de México
> México, D.F.
> 04510
> México
>
> Tel: +52 55 5622 9044
> E-mail: alejandro.gonza...@iecologia.unam.mx
>
> Lab website: www.alejandrogonzalezvoyer.com<http://www.
> alejandrogonzalezvoyer.com>
>
> > El 31/10/2016, a las 1:30 p.m., Emmanuel Paradis <
> emmanuel.para...@ird.fr> escribió:
> >
> > Le 30/10/2016 à 03:09, Shinichi Nakagawa a écrit :
> >> Dear Emmanuel and Alejandro
> >>
> >> Many thanks for your replies.
> >>
> >> Emmanuel, I understand what you said if I use vcv(nonultrametric_tree,
> >> cor=FALSE) in a phylogenetic comparative method (PCM). But if I use
> >> vcv(nonultrametric_tree, cor=TRUE), isn't this the same as assuming a
> >> ultrametric tree? I may be missing something here?
> >
> > No, this is not necessarily the same thing since the off-diagonal
> elements of the matrices may be different depending on how branch lenghts
> are changed by chronoMPL (or other procedures you might use to make the
> tree ultrametric).
> >
> >> Note that vcv(nonultrametric_tree, cor=TRUE) is different from
> >> vcv(chronoMPL(nonultrametric_tree), cor = TRUE), which is relates to my
> >> previous question (which one is preferred?)
> >
> > It (mainly) depends whether you want to assume a "clock-like" evolution
> for the traits you are studying.
> >
> > Cheers,
> >
> > Emmanuel
> >
> >> Many thanks
> >>
> >> Shinichi
> >>
> >> On Sun, Oct 30, 2016 at 9:53 AM, Alejandro Gonzlaez Voyer
> >> <alejandro.gonza...@iecologia.unam.mx
> >> <mailto:alejandro.gonza...@iecologia.unam.mx>> wrote:
> >>
> >>    Hi,
> >>
> >>    I would venture in adding that with an additive tree the differences
> >>    in evol rates among species are determined by the genes used to
> >>    estimate the tree, given differences in substitution rates among
> >>    genes. I do think its important to bear in mind.
> >>
> >>    Cheers
> >>
> >>    Alejandro
> >>
> >>    Alejandro Gonzalez Voyer
> >>    Instituto de Ecologia
> >>    UNAM
> >>
> >>
> >>
> >>
> >>    > On Oct 29, 2016, at 2:45 PM, Emmanuel Paradis
> >>    <emmanuel.para...@ird.fr <mailto:emmanuel.para...@ird.fr>> wrote:
> >>    >
> >>    > Sure they are different. I forgot to mention that.
> >>    >
> >>    > In comparative analyses, the expected quantity of trait change (=
> >>    the variance in the VCV matrix) is given by the product of the rate
> >>    of evolution of the trait with branch length. So using a
> >>    non-ultrametric tree is a way to assume different rates of evolution
> >>    for each branch. With an ultrametric tree, you somehow assume a
> >>    "clock-like" trait evolution (i.e., the quantity of change from the
> >>    root of the tree to the tips is the same).
> >>    >
> >>    > BTW, the first command you give below should be (misplaced right
> >>    parenthesis):
> >>    >
> >>    > vcv(chronoMPL(nonultrametric_tree), cor = TRUE)
> >>    >
> >>    > Best,
> >>    >
> >>    > Emmanuel
> >>    >
> >>    >> Le 29/10/2016 à 13:12, Shinichi Nakagawa a écrit :
> >>    >> Dear  Emmanuel
> >>    >>
> >>    >> Many thanks for your swift reply.
> >>    >>
> >>    >> If we get a correlation matrix, via chronoMPL [i.e.
> >>    >> vcv(chronoMPL(nonultrametric_tree,cor=T))], this correlation
> >>    matrix is
> >>    >> different from a correlation matrix obtained directly from vcv
> [i.e.
> >>    >> vcv(nonultrametric_tree, cor=T)].
> >>    >>
> >>    >> Could you enlighten me about differences and why chronoMPL method
> >>    might
> >>    >> be preferred?
> >>    >>
> >>    >> Best wishes and thanks in advance.
> >>    >>
> >>    >> Shinichi
> >>    >>
> >>    >> On Sat, Oct 29, 2016 at 8:50 PM, Emmanuel Paradis
> >>    >> <emmanuel.para...@ird.fr <mailto:emmanuel.para...@ird.fr>
> >>    <mailto:emmanuel.para...@ird.fr <mailto:emmanuel.para...@ird.fr>>>
> >>    wrote:
> >>    >>
> >>    >>    Dear Shinichi,
> >>    >>
> >>    >>    A fast solution is provided by the function chronoMPL in ape;
> >>    it does
> >>    >>    not require calibration points (see the references in the help
> >>    page of
> >>    >>    this function for the assumptions). The function chronos (also
> >>    in ape)
> >>    >>    is another possibility but it needs at least one calibration
> point
> >>    >>    (though this can be fixed to unity at the root).
> >>    >>
> >>    >>    Note that a correlation matrix can be calculated from a
> >>    non-ultrametric
> >>    >>    tree: see the function vcv.
> >>    >>
> >>    >>    Best,
> >>    >>
> >>    >>    Emmanuel
> >>    >>
> >>    >>    Le 29/10/2016 à 05:26, Shinichi Nakagawa a écrit :
> >>    >>    > Dear List
> >>    >>    >
> >>    >>    > We would like make several non-ultrametic trees (based on
> >>    >>    molecular data;
> >>    >>    > downloaded from treeBASE) into ultrametric trees using R.
> Could
> >>    >>    you advice
> >>    >>    > us what is the best and the most general way of doing this
> >>    please?
> >>    >>    >
> >>    >>    > We would like to use resultant ultrametric trees in
> >>    phyologenetic
> >>    >>    > comparative analysis (by turning into correlation matrices).
> >>    >>    >
> >>    >>    > Best wishes,
> >>    >>    >
> >>    >>    > Shinichi Nakagawa
> >>    >>    >
> >>    >>    >       [[alternative HTML version deleted]]
> >>    >>    >
> >>    >>    > _______________________________________________
> >>    >>    > R-sig-phylo mailing list - R-sig-phylo@r-project.org
> >>    <mailto:R-sig-phylo@r-project.org>
> >>    >>    <mailto:R-sig-phylo@r-project.org
> >>    <mailto:R-sig-phylo@r-project.org>>
> >>    >>    > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> >>    <https://stat.ethz.ch/mailman/listinfo/r-sig-phylo>
> >>    >>    <https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> >>    <https://stat.ethz.ch/mailman/listinfo/r-sig-phylo>>
> >>    >>    > Searchable archive at
> >>    >>    http://www.mail-archive.com/r-sig-phylo@r-project.org/
> >>    <http://www.mail-archive.com/r-sig-phylo@r-project.org/>
> >>    >>    <http://www.mail-archive.com/r-sig-phylo@r-project.org/
> >>    <http://www.mail-archive.com/r-sig-phylo@r-project.org/>>
> >>    >>    >
> >>    >>    >
> >>    >>    > Pour nous remonter une erreur de filtrage, veuillez vous
> rendre
> >>    >>    ici : http://f.security-mail.net/301dITcFgNy
> >>    <http://f.security-mail.net/301dITcFgNy>
> >>    >>    <http://f.security-mail.net/301dITcFgNy
> >>    <http://f.security-mail.net/301dITcFgNy>>
> >>    >>    >
> >>    >>    >
> >>    >>
> >>    >>
> >>    >>
> >>    >>
> >>    >
> >>    > _______________________________________________
> >>    > R-sig-phylo mailing list - R-sig-phylo@r-project.org
> >>    <mailto:R-sig-phylo@r-project.org>
> >>    > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> >>    <https://stat.ethz.ch/mailman/listinfo/r-sig-phylo>
> >>    > Searchable archive at
> >>    http://www.mail-archive.com/r-sig-phylo@r-project.org/
> >>    <http://www.mail-archive.com/r-sig-phylo@r-project.org/>
> >>
> >>    _______________________________________________
> >>    R-sig-phylo mailing list - R-sig-phylo@r-project.org
> >>    <mailto:R-sig-phylo@r-project.org>
> >>    https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> >>    <https://stat.ethz.ch/mailman/listinfo/r-sig-phylo>
> >>    Searchable archive at
> >>    http://www.mail-archive.com/r-sig-phylo@r-project.org/
> >>    <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-ph...@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-ph...@r-project.org/
>



-- 
Klaus Schliep
Postdoctoral Fellow
Revell Lab, University of Massachusetts Boston
http://www.phangorn.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/

Reply via email to