Discussion:
[R-sig-phylo] grafting chronograms onto backbone phylogeny
Chris Law
2018-04-26 21:07:44 UTC
Permalink
Hi all,

I am trying to graft 3 chronograms onto a family level backbone. Does
anybody have any suggestions on what is the best way to do this? Or is
going through the tree files in textwrangler the only way to do this.

Thanks!


*Chris Law​ **|*
* ​*PhD Student
*|*
* ​*University of California, Santa Cruz



Coastal Biology Building

130 McAllister Way
Santa Cruz, CA 95060
***@ucsc.edu *|* research.pbsci.ucsc.edu/eeb/cjlaw/
Small Mammal Research in the Forest Internship
<http://research.pbsci.ucsc.edu/envs/smurf>

[[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.org/
Brian O'Meara
2018-04-26 21:19:48 UTC
Permalink
Look at congruify.phylo in geiger (and the associated paper: Eastman JM, LJ
Harmon, and DC Tank. 2013. Congruification: support for time scaling large
phylogenetic trees. Methods in Ecology and Evolution).

You could also look into SDM in ape (converting trees [not data] to
distance matrices, first): relevant paper Criscuolo, A., Berry, V.,
Douzery, E. J. P. , and Gascuel, O. (2006) SDM: A fast distance-based
approach for (super)tree building in phylogenomics. Systematic Biology, 55,
740–755.

Best,
Brian

_______________________________________________________________________
Brian O'Meara, http://www.brianomeara.info, especially Calendar
<http://brianomeara.info/calendars/omeara/>, CV
<http://brianomeara.info/cv/>, and Feedback
<http://brianomeara.info/teaching/feedback/>

Associate Professor, Dept. of Ecology & Evolutionary Biology, UT Knoxville
Associate Head, Dept. of Ecology & Evolutionary Biology, UT Knoxville
Associate Director for Postdoctoral Activities, National Institute for
Mathematical & Biological Synthesis <http://www.nimbios.org> (NIMBioS)
Post by Chris Law
Hi all,
I am trying to graft 3 chronograms onto a family level backbone. Does
anybody have any suggestions on what is the best way to do this? Or is
going through the tree files in textwrangler the only way to do this.
Thanks!
*Chris Law​ **|*
* ​*PhD Student
*|*
* ​*University of California, Santa Cruz

Coastal Biology Building

130 McAllister Way
Santa Cruz, CA 95060
Small Mammal Research in the Forest Internship
<http://research.pbsci.ucsc.edu/envs/smurf>
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-
[[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.org/
Liam J. Revell
2018-04-26 22:31:19 UTC
Permalink
If your case is simple - like you have a tree with tips labeled by
genus, and each species label from each subtree to be bound has tip
labels in the format Genus_species, this could be done using bind.tree
in ape.

For instance:

library(phytools)
## here's your backbone
backbone<-read.tree(text="((A:2.0,B:2.0):1,C:3.0);")
plotTree(backbone)

## here are your subtrees
A<-read.tree(text="(A_sp1:1.0,A_sp2:1.0);")
B<-read.tree(text="(B_sp1:1.5,B_sp2:1.5);")
C<-read.tree(text="((C_sp1:0.5,C_sp2:0.5):0.5,C_sp3:1.0);")
subtrees<-c(A,B,C)

for(i in 1:length(subtrees)){
genus<-strsplit(subtrees[[i]]$tip.label[[1]],"_")[[1]][1]
h<-max(nodeHeights(subtrees[[i]]))
tip<-which(backbone$tip.label==genus)
backbone$edge.length[which(backbone$edge[,2]==tip)]<-
backbone$edge.length[which(backbone$edge[,2]==tip)]-h
backbone<-bind.tree(backbone,subtrees[[i]],where=tip)
}

plotTree(backbone)

Something like that.

(Of course you could also modify this so that you just manually identify
the tips to bind to. Given the small size of your problem this is
probably what you want.)

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
& Profesor Asociado, Programa de Biología
Universidad del Rosario
web: http://faculty.umb.edu/liam.revell/
Post by Brian O'Meara
Look at congruify.phylo in geiger (and the associated paper: Eastman
JM, LJ Harmon, and DC Tank. 2013. Congruification: support for time
scaling large phylogenetic trees. Methods in Ecology and Evolution).
You could also look into SDM in ape (converting trees [not data] to
distance matrices, first): relevant paper Criscuolo, A., Berry, V.,
Douzery, E. J. P. , and Gascuel, O. (2006) SDM: A fast
distance-based approach for (super)tree building in phylogenomics.
Systematic Biology, 55, 740–755.
Best, Brian
_______________________________________________________________________
Brian O'Meara, http://www.brianomeara.info, especially Calendar
Post by Brian O'Meara
<http://brianomeara.info/calendars/omeara/>, CV
<http://brianomeara.info/cv/>, and Feedback
<http://brianomeara.info/teaching/feedback/>
Associate Professor, Dept. of Ecology & Evolutionary Biology, UT
Knoxville Associate Head, Dept. of Ecology & Evolutionary Biology, UT
Knoxville Associate Director for Postdoctoral Activities, National
Institute for Mathematical & Biological Synthesis
<http://www.nimbios.org> (NIMBioS)
Post by Chris Law
Hi all,
I am trying to graft 3 chronograms onto a family level backbone.
Does anybody have any suggestions on what is the best way to do
this? Or is going through the tree files in textwrangler the only
way to do this.
Thanks!
*Chris Law​ **|* * ​*PhD Student *|* * ​*University of California,
Santa Cruz ​
Coastal Biology Building ​ 130 McAllister Way Santa Cruz, CA 95060
Research in the Forest Internship
<http://research.pbsci.ucsc.edu/envs/smurf>
[[alternative HTML version deleted]]
_______________________________________________ R-sig-phylo mailing
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable
[[alternative HTML version deleted]]
_______________________________________________ R-sig-phylo mailing
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive
_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.org/
Chris Law
2018-04-27 16:37:45 UTC
Permalink
Thanks for the suggestions!

*Chris Law​ **|*
* ​*PhD Student
*|*
* ​*University of California, Santa Cruz



Coastal Biology Building

130 McAllister Way
Santa Cruz, CA 95060
***@ucsc.edu *|* research.pbsci.ucsc.edu/eeb/cjlaw/
Small Mammal Research in the Forest Internship
<http://research.pbsci.ucsc.edu/envs/smurf>
Post by Liam J. Revell
If your case is simple - like you have a tree with tips labeled by
genus, and each species label from each subtree to be bound has tip
labels in the format Genus_species, this could be done using bind.tree
in ape.
library(phytools)
## here's your backbone
backbone<-read.tree(text="((A:2.0,B:2.0):1,C:3.0);")
plotTree(backbone)
## here are your subtrees
A<-read.tree(text="(A_sp1:1.0,A_sp2:1.0);")
B<-read.tree(text="(B_sp1:1.5,B_sp2:1.5);")
C<-read.tree(text="((C_sp1:0.5,C_sp2:0.5):0.5,C_sp3:1.0);")
subtrees<-c(A,B,C)
for(i in 1:length(subtrees)){
genus<-strsplit(subtrees[[i]]$tip.label[[1]],"_")[[1]][1]
h<-max(nodeHeights(subtrees[[i]]))
tip<-which(backbone$tip.label==genus)
backbone$edge.length[which(backbone$edge[,2]==tip)]<-
backbone$edge.length[which(backbone$edge[,2]==tip)]-h
backbone<-bind.tree(backbone,subtrees[[i]],where=tip)
}
plotTree(backbone)
Something like that.
(Of course you could also modify this so that you just manually identify
the tips to bind to. Given the small size of your problem this is probably
what you want.)
All the best, Liam
Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
& Profesor Asociado, Programa de Biología
Universidad del Rosario
web: http://faculty.umb.edu/liam.revell/
Post by Brian O'Meara
Look at congruify.phylo in geiger (and the associated paper: Eastman
JM, LJ Harmon, and DC Tank. 2013. Congruification: support for time
scaling large phylogenetic trees. Methods in Ecology and Evolution).
You could also look into SDM in ape (converting trees [not data] to
distance matrices, first): relevant paper Criscuolo, A., Berry, V.,
Douzery, E. J. P. , and Gascuel, O. (2006) SDM: A fast
distance-based approach for (super)tree building in phylogenomics.
Systematic Biology, 55, 740–755.
Best, Brian
_______________________________________________________________________
Brian O'Meara, http://www.brianomeara.info, especially Calendar
<http://brianomeara.info/calendars/omeara/>, CV <
http://brianomeara.info/cv/>, and Feedback <http://brianomeara.info/teach
ing/feedback/>
Associate Professor, Dept. of Ecology & Evolutionary Biology, UT
Knoxville Associate Head, Dept. of Ecology & Evolutionary Biology, UT
Knoxville Associate Director for Postdoctoral Activities, National
Institute for Mathematical & Biological Synthesis
<http://www.nimbios.org> (NIMBioS)
Hi all,
Post by Chris Law
I am trying to graft 3 chronograms onto a family level backbone.
Does anybody have any suggestions on what is the best way to do
this? Or is going through the tree files in textwrangler the only
way to do this.
Thanks!
*Chris Law​ **|* * ​*PhD Student *|* * ​*University of California,
Santa Cruz ​
Coastal Biology Building ​ 130 McAllister Way Santa Cruz, CA 95060
Research in the Forest Internship <http://research.pbsci.ucsc.ed
u/envs/smurf>
[[alternative HTML version deleted]]
_______________________________________________ R-sig-phylo mailing
istinfo/r-sig-phylo Searchable
[[alternative HTML version deleted]]
_______________________________________________ R-sig-phylo mailing
istinfo/r-sig-phylo Searchable archive
[[alternative HTML version deleted]]

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