rdistMatrix: Rank-based distances between haplotypes in a given partition

Description Usage Arguments Details Value Examples

View source: R/rdistMatrix.R

Description

This function computes the pairwise distances between haplotypes (tips) of the dendrogram based on the ranking of the nested partitions in the dendrogram. See the details.

Usage

1
rdistMatrix(dend, sep = "-")

Arguments

dend

A list of nodes that represents the nested partition of haplotypes.

sep

A character string separator for concatenating haplotype labels in the dendrogram if they are undistingushable in the window around the focal SNV. See the arguments in reconstructPP.

Details

We code the distance between two haplotypes of a dendrogram as the number of inner nodes that seperate the haplotypes plus one. That is, we assign the distance between two internal neighbouring nodes as one, and the distance between an internal node and its neighbouring tip as one. To illustrate, consider the following figure of a dendrogram. In the figure, the distance between the haplotypes 2931 and 454 is 3; the distance between other haplotypes are given in the table below.

Figure: treedist.png

Figure: trtable.png

Value

A matrix of pairwise distances between haplotypes.

Examples

1
2
3
data(ex_hapMat_data)
rdend <- reconstructPP(hapMat = ex_hapMat_data, focalSNV = 2, minWindow = 1, sep = "-" )
rdistMatrix(rdend)

perfectphyloR documentation built on March 8, 2021, 9:06 a.m.