View source: R/extractBranches.R
extractBranches | R Documentation |
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.
extractBranches(
ldna,
min.edges = 200,
merge.min = 0.8,
plot.tree = TRUE,
cores = 1
)
ldna |
Output from |
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 |
cores |
Number of cores to use. |
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
Returns a list containing a vectors of locus names belonging to a given cluster (branch)
Petri Kemppainen petrikemppainen2@gmail.com, Christopher Knight Chris.Knight@manchester.ac.uk
LDnaRaw
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.