View source: R/Examine_Region_Methylation.R
getDendro | R Documentation |
getDendro()
computes the distance between the rows of a matrix and
performs hierarchical clustering. Possible distance measures include
euclidean
, pearson
, and bicor
. The function also
optionally transposes the matrix.
getDendro(
x,
transpose = FALSE,
distance = c("euclidean", "pearson", "bicor"),
maxPOutliers = 0.1,
verbose = TRUE
)
x |
A |
transpose |
A |
distance |
A |
maxPOutliers |
A |
verbose |
A |
Euclidean distance is calculated by stats::dist()
, where
method = "euclidean"
, while Pearson correlation and biweight
midcorrelation (bicor) are computed by WGCNA::cor()
and WGCNA::bicor()
,
respectively. The cor
and bicor
are then subtracted from 1 to
calculate the dissimilarity. Hierarchical clustering is done by
stats::hclust()
, where method = "average"
.
An stats::hclust object that describes the clustering tree.
plotDendro()
to visualize dendrograms from getDendro()
.
## Not run:
# Assess Sample Similarity
getDendro(methAdj, distance = "euclidean") %>%
plotDendro(file = "Sample_Dendrogram.pdf", expandY = c(0.25,0.08))
# Examine Correlations between Modules
moduleDendro <- getDendro(MEs, distance = "bicor")
plotDendro(moduleDendro, labelSize = 4, nBreaks = 5,
file = "Module_ME_Dendrogram.pdf")
# Characterize Correlations between Samples
sampleDendro <- getDendro(MEs, transpose = TRUE, distance = "bicor")
plotDendro(sampleDendro, labelSize = 3, nBreaks = 5,
file = "Sample_ME_Dendrogram.pdf")
# Examine Correlations between Traits
traitDendro <- getCor(MEs, y = colData, corType = "bicor",
robustY = FALSE) %>%
getDendro(transpose = TRUE)
plotDendro(traitDendro, labelSize = 3.5, expandY = c(0.65,0.08),
file = "Trait_Dendrogram.pdf")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.