pdist.p {iCAMP} | R Documentation |
Pairwise phylogenetic distance matrix from small tree
Description
Calculates between-species phylogenetic distance matrix from a tree. only deal with relatively small dataset.
Usage
pdist.p(tree, nworker = 4, memory.G = 50, silent = FALSE, time.count = FALSE)
Arguments
tree |
phylogenetic tree, an object of class "phylo". |
nworker |
for parallel computing the tree paths. a positive integer (in which case that number of copies is run on localhost). default is 4, means 4 threads will be run. |
memory.G |
numeric, to set the memory size as you need, so that calculation of large tree will not be limited by physical memory. unit is Gb. default is 50Gb |
silent |
logic, whether to show messages. Default is FALSE, thus all messages will be showed. |
time.count |
logic, whether to count calculation time, default is FALSE. |
Details
The cophenetic distance between each pair of taxa is calculated (Sokal and Rohlf 1962). Modified from the function "cophenetic" in package "ape" (Paradis & Schliep 2018), this function can calculate pairwise distance from phylogenetic tree quickly by parallel computing. If the tree has too many tips (taxa), please use another function pdist.big designed for large datasets.
Value
Output is a data.frame object, a square matrix of pairwise phylogenetic distances. Row names are the same as column names, indicating taxa IDs.
Note
Version 1: 2021.9.24
Author(s)
Daliang Ning
References
Sokal, R. R. & Rohlf, F. J.. (1962). The comparison of dendrograms by objective methods. Taxon, 11:33-40
Paradis, E. & Schliep, K. (2018). ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R. Bioinformatics 35: 526-528.
See Also
Examples
data("example.data")
tree=example.data$tree
nworker=2 # parallel computing thread number
pd=pdist.p(tree = tree, nworker = nworker)