You could try it using the function fastHeight in phytools.

fastHeight(tree,sp1,sp1) +fastHeight(tree,sp2,sp2) - fastHeight(tree,sp1,sp2)

Have not tried it with a tree of this size!

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell
email: [email protected]
blog: http://blog.phytools.org
---
Sent from my Windows Phone
________________________________
From: Jonathan Greenberg<mailto:[email protected]>
Sent: �10/�2/�2015 6:14 PM
To: [email protected]<mailto:[email protected]>
Subject: [R-sig-phylo] Distance between two species from a

Folks:

Pardon the newbish question, I'm an outsider joining the world of
phylogenetic analysis.  Given a large newick tree e.g. from the new open
tree of life:

http://files.opentreeoflife.org/trees/v3subtrees/chloroplastida.tre.gz

(304959 tips)

I want to calculate a pairwise distance between a small subset of species.
The tricks I've seen so far using the ape package do no work on a tree of
that size:

MyTree <- read.tree("pathto/chloroplastida.tre")
pairwise_distance <- cophenetic(MyTree)

Error in double(nm * nm) : vector size cannot be NA
In addition: Warning message:
In nm * nm : NAs produced by integer overflow

 pairwise_distance <- cophenetic(MyTree)["Abies concolor","Pinus jeffreyi"]

Error in double(nm * nm) : vector size cannot be NA
In addition: Warning message:
In nm * nm : NAs produced by integer overflow

This is due to the matrix having more cells than allowed
by .Machine$integer.max

My question is thus: I want to determine either single species to single
species distances without having an algorithm attempt to calculate the
distance for all possible species (which is what ape is doing).  Is there a
package/trick to accomplish this?  Thanks!

--j

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

Reply via email to