summaryLDna: Summerises LD clusters

View source: R/summaryLDna.r

summaryLDnaR Documentation

Summerises LD clusters

Description

Creates a data frame with summary information of LD clusters extracted by function extractBranches

Usage

summaryLDna(ldna, clusters, LDmat)

Arguments

ldna

Output from LDnaRaw

clusters

Output from extractBranches

LDmat

a matrix of pairwise LD values used for LDnaRaw

Value

Returns a data frame with each row corresponding to a cluster, in decreasing order with respect to highest LD threshold value at which they are present. Column "Merge.at" specfies the LD threshold for cluster merger. "Median.LD" gives the median LD of all pairwise values between loci in a cluster, and "MAD.LD" gives their unscaled median absolute deviation.

Author(s)

Petri Kemppainen petrikemppainen2@gmail.com

See Also

extractBranches, LDnaRaw and plotLDnetwork

Examples

# Simple upper diagonal LD matrix
LDmat <- structure(c(NA, 0.84, 0.64, 0.24, 0.2, 0.16, 0.44, 0.44, NA, NA, 0.8, 0.28, 0.4, 0.36, 0.36, 0.24, NA, NA, NA, 0.48, 0.32, 0.2, 0.36, 0.2, NA, NA, NA, NA, 0.76, 0.56, 0.6, 0.2, NA, NA, NA, NA, NA, 0.72, 0.68, 0.24, NA, NA, NA, NA, NA, NA, 0.44, 0.24, NA, NA, NA, NA, NA, NA, NA, 0.2, NA, NA, NA, NA, NA, NA, NA, NA), .Dim = c(8L, 8L), .Dimnames = list(c("L1", "L2", "L3", "L4", "L5", "L6", "L7", "L8"), c("L1", "L2", "L3", "L4", "L5", "L6", "L7", "L8")))
# Produce neccesary data for LDna
ldna <- LDnaRaw(LDmat)
# Extract clusters and plot graphs, for this small example min.edges is set to zero such that each tip clade corresponds to an individual locus
clusters <- extractBranches(ldna, min.edges=0,merge.min = 0.6)
summary <- summaryLDna(ldna, clusters, LDmat)
summary
## example with baimaii data set
data(LDna)
ldna <- LDnaRaw(r2.baimaii_subs)
clusters <- extractBranches(ldna, min.edges=20,merge.min = 0.6)
summary <- summaryLDna(ldna, clusters, r2.baimaii_subs)
summary

petrikemppainen/LDna documentation built on April 14, 2024, 6:37 p.m.