distNodes: Finding distance between nodes and tips

Description Usage Arguments Value Author(s) Examples

View source: R/distNodes.R

Description

The function computes the distance between pairs of nodes, pairs of tips, or between nodes and tips. The distance is meant as both patristic distance and the number of nodes intervening between the pair.

Usage

1
distNodes(tree,node=NULL,clus=0.5)

Arguments

tree

a phylogenetic tree. The tree needs not to be ultrametric and fully dichotomous.

node

either a single node/tip or a pair of nodes/tips.

clus

the proportion of clusters to be used in parallel computing. To run the single-threaded version of distNodes set clus = 0.

Value

If node is specified, the function returns a data frame with distances between the focal node/tip and the other nodes/tips on the tree (or for the selected pair only). Otherwise, the function returns a matrix containing the number of nodes intervening between each pair of nodes and tips.

Author(s)

Pasquale Raia, Silvia Castiglione, Carmela Serio, Alessandro Mondanaro, Marina Melchionna, Mirko Di Febbraro, Antonio Profico, Francesco Carotenuto

Examples

1
2
3
4
5
6
7
8
9
data("DataApes")
DataApes$Tstage->Tstage

cc<- 2/parallel::detectCores()
distNodes(tree=Tstage,clus=cc)
distNodes(tree=Tstage,node=64,clus=cc)
distNodes(tree=Tstage,node="Tro_2",clus=cc)
distNodes(tree=Tstage,node=c(64,48),clus=cc)
distNodes(tree=Tstage,node=c(64,"Tro_2"),clus=cc)

pasraia/RRphylo documentation built on Aug. 6, 2021, 9:42 p.m.