correlate,AnyHermesData-method | R Documentation |
AnyHermesData
The correlate()
method can calculate the correlation matrix between the sample vectors of
counts from a specified assay. This produces a HermesDataCor
object, which is an extension
of a matrix
with additional quality flags in the slot flag_data
(containing the tech_failure_flag
and low_depth_flag
columns describing the original
input samples).
An autoplot()
method then afterwards can produce the corresponding heatmap.
## S4 method for signature 'AnyHermesData' correlate(object, assay_name = "counts", method = "pearson", ...) ## S4 method for signature 'HermesDataCor' autoplot( object, flag_colors = c(`FALSE` = "green", `TRUE` = "red"), cor_colors = circlize::colorRamp2(c(0, 0.5, 1), c("red", "yellow", "green")), ... )
object |
( |
assay_name |
( |
method |
( |
... |
other arguments to be passed to |
flag_colors |
(named |
cor_colors |
( |
A HermesDataCor
object.
autoplot(HermesDataCor)
: This autoplot()
method uses the ComplexHeatmap::Heatmap()
function
to plot the correlations between samples saved in a HermesDataCor
object.
object <- hermes_data # Calculate the sample correlation matrix. correlate(object) # We can specify another correlation coefficient to be calculated. result <- correlate(object, method = "spearman") # Plot the correlation matrix. autoplot(result) # We can customize the heatmap. autoplot(result, show_column_names = FALSE, show_row_names = FALSE) # Including changing the axis label text size. autoplot( result, row_names_gp = grid::gpar(fontsize = 8), column_names_gp = grid::gpar(fontsize = 8) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.