Re: [R-sig-phylo] getBtimes vs. branching.times

2016-01-12 Thread Dan Rabosky

Dear Lev-

I don't think branching.times can compute these for non-ultrametric trees.

You can do this with package BAMMtools, but you need a "hidden" internal 
function. You can access it as 

"BAMMtools:::NU.branching.times"
 
It returns branching times relative to the most recently-occurring tip in the 
tree. It's a R-based recursion that is a little slower that the ape function, 
so it's not recommended as a replacement for branching.times if you have an 
ultrametric tree.

I'm not actively maintaining laser, but getBtimes returns the output of 
branching.times after sorting the times and stripping out the node names (this 
was useful for something many years ago!). If you plot sort(getBtimes(x)) and 
sort(branching.times(x)) they should be identical.

~Dan Rabosky



On Jan 12, 2016, at 7:37 PM, Yampolsky, Lev  wrote:

> Dear Colleagues,
> 
> Does anyone know what is the difference between ape�s  branching.times() and 
> laser�s getBtimes()?
> And why they may be giving rather different results, particularly for 
> internal branches? (From an ultrametric tree created by
> chronotree <- chronos(tree, lambda = 1, model = "correlated", quiet = FALSE, 
> calibration = makeChronosCalib(tree), control = chronos.control())
> 
> Thank you very much in advance for your help!
> 
> PS. A related but less important question: I am curious how does 
> branching.times() calculate branching times from a non-ultrametric tree?
> 
> --
> Lev Yampolsky
> 
> Professor
> Department of Biological Sciences
> East Tennessee State University
> Box 70703
> Johnson City TN 37614-1710
> Cell 423-676-7489
> Office/lab 423-439-4359
> Fax423-439-5958
> 
> ___
> 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/

_
Dan Rabosky
Assistant Professor & Curator of Herpetology
Museum of Zoology &
Department of Ecology and Evolutionary Biology
University of Michigan
Ann Arbor, MI 48109-1079 USA

drabo...@umich.edu
http://www-personal.umich.edu/~drabosky
http://www.lsa.umich.edu/ummz/



[[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] extract parent-child from newick

2016-01-12 Thread Yampolsky, Lev
A very simple question: I have a tree with all tips and nodes labeled and I 
want parent-child pairs from it. Looking at tree$edge does not quite help, 
because these parent and child pairs are labeled by the internal index, not IDs 
from the newick file. Looking at tree$tip.label and tree$node.label does not 
help, because these two vectors index tips and nodes separately, so these 
indexes do not correspond to those in tree$edge.

Should be very very obvious how to do it!

Thanks!

--
Lev Yampolsky

Professor
Department of Biological Sciences
East Tennessee State University
Box 70703
Johnson City TN 37614-1710
Cell 423-676-7489
Office/lab 423-439-4359
Fax423-439-5958

___
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] extract parent-child from newick

2016-01-12 Thread Klaus Schliep
Dear Lev,

I hope this little example explains it:

tree <- read.tree(text = "((t3:1,t2:1)b:1,t1:2)a;")
par(mfrow = c(1,2))
plot(tree, show.node.label=TRUE)
plot(tree, show.tip.label=FALSE)
nodelabels()
tiplabels()
tree$tip.label
tree$node.label

The tree$tip.label correspond to 1 to the number of tip labels and
tree$node.label to (number of tip labels +1) to (number of nodes) in the
tree$edge matrix.

Regards,
Klaus

On Tue, Jan 12, 2016 at 7:54 PM, Yampolsky, Lev 
wrote:

> A very simple question: I have a tree with all tips and nodes labeled and
> I want parent-child pairs from it. Looking at tree$edge does not quite
> help, because these parent and child pairs are labeled by the internal
> index, not IDs from the newick file. Looking at tree$tip.label and
> tree$node.label does not help, because these two vectors index tips and
> nodes separately, so these indexes do not correspond to those in tree$edge.
>
> Should be very very obvious how to do it!
>
> Thanks!
>
> --
> Lev Yampolsky
>
> Professor
> Department of Biological Sciences
> East Tennessee State University
> Box 70703
> Johnson City TN 37614-1710
> Cell 423-676-7489
> Office/lab 423-439-4359
> Fax423-439-5958
>
> ___
> 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/
>



-- 
Klaus Schliep
Postdoctoral Fellow
Revell Lab, University of Massachusetts Boston

[[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] getBtimes vs. branching.times

2016-01-12 Thread Yampolsky, Lev
Dear Colleagues,

Does anyone know what is the difference between ape’s  branching.times() and 
laser’s getBtimes()?
And why they may be giving rather different results, particularly for internal 
branches? (From an ultrametric tree created by
chronotree <- chronos(tree, lambda = 1, model = "correlated", quiet = FALSE, 
calibration = makeChronosCalib(tree), control = chronos.control())

Thank you very much in advance for your help!

PS. A related but less important question: I am curious how does 
branching.times() calculate branching times from a non-ultrametric tree?

--
Lev Yampolsky

Professor
Department of Biological Sciences
East Tennessee State University
Box 70703
Johnson City TN 37614-1710
Cell 423-676-7489
Office/lab 423-439-4359
Fax423-439-5958

___
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/