extractBranches: Extracts LD clusters for linkage disequilibrium network...

View source: R/extractBranches.R

extractBranchesR Documentation

Extracts LD clusters for linkage disequilibrium network analysis (LDna).

Description

Finds clusters of highly correlated loci (LD-clusters) by considering each branch in single-linkage clustering trees as a separate LD-cluster. The single-linkage can be plotted with the brances representing LD-clusters indicated.

Usage

extractBranches(
  ldna,
  min.edges = 200,
  merge.min = 0.8,
  plot.tree = TRUE,
  cores = 1
)

Arguments

ldna

Output from LDnaRaw

min.edges

Minimum number of edges for a cluster that is shown as a branch in a tree.

merge.min

Is the correlation threshold at which a clade is considered a separate LD-cluster, even if it contains more than two branches.

plot.tree

If TRUE (default), plots tree.

cores

Number of cores to use.

Details

In this implementation of defining LD-clusters, only the parameter min.edges needs to be specified. Low values of min.edges lead to "bushes" with many small "twigs" in the tree, each corresponding to a separate LD-cluster. These clusters contain fewer but more highly correlated sets of loci. Conversely, high values lead to fewer "thick" branches i.e. larger (in terms of the number of loci) but less strongly correlated LD-clusters.

The single-linkage clustering tree visualizing branches/LD-clusters can be printed by plot.tree=TRUE.

With low values for min.edges an additional parameter merge.min can be used to group "branches" that merge above this threshold into a single LD-cluster; clusters that merge at high LD-threshold are so correlated, it makes no sense to regard them as separate LD-clusters.

This function works only with LDnaRaw as shown in the examples

Value

Returns a list containing a vectors of locus names belonging to a given cluster (branch)

Author(s)

Petri Kemppainen petrikemppainen2@gmail.com, Christopher Knight Chris.Knight@manchester.ac.uk

See Also

LDnaRaw

Examples

data(LDna)

ldna <- LDnaRaw(r2.baimaii_subs)

clusters <- extractBranches(ldna,min.edges=20,merge.min=0.8, plot.tree=TRUE) # default values
clusters

# with lower threshold for min.edges
clusters <- extractBranches(ldna,min.edges=5,merge.min=0.8, plot.tree=TRUE) # default values
clusters

# with lower threshold for min.edges
clusters <- extractBranches(ldna,min.edges=5,merge.min=0.2, plot.tree=TRUE) # default values
clusters

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