View source: R/layer_stat_cor_plot.R
layer_stat_cor_plot | R Documentation |
This function makes a heatmap from the layer_stat_cor()
correlation matrix
between a given set of cell cluster/type statistics derived from scRNA-seq
or snRNA-seq data (among other types) and the layer statistics from the
Human DLPFC Visium data (when using the default arguments).
layer_stat_cor_plot(
cor_stats_layer,
max = 0.81,
min = -max,
layerHeights = NULL,
cex = 1.2
)
cor_stats_layer |
The output of |
max |
A |
min |
A |
layerHeights |
A |
cex |
Passed to |
Check https://github.com/LieberInstitute/HumanPilot/blob/master/Analysis/Layer_Guesses/dlpfc_snRNAseq_annotation.R for a full analysis from which this family of functions is derived from.
A heatmap for the correlation matrix between statistics.
Andrew E Jaffe, Leonardo Collado-Torres
layer_matrix_plot annotate_registered_clusters
Other Layer correlation functions:
annotate_registered_clusters()
,
layer_stat_cor()
## Obtain the necessary data
if (!exists("modeling_results")) {
modeling_results <- fetch_data(type = "modeling_results")
}
## Compute the correlations
cor_stats_layer <- layer_stat_cor(
tstats_Human_DLPFC_snRNAseq_Nguyen_topLayer,
modeling_results,
model_type = "enrichment"
)
## Visualize the correlation matrix
layer_stat_cor_plot(cor_stats_layer, max = max(cor_stats_layer))
## Annotate then re-plot
rownames(cor_stats_layer) <- paste0(
rownames(cor_stats_layer),
" - ",
annotate_registered_clusters(cor_stats_layer)$layer_label
)
layer_stat_cor_plot(cor_stats_layer, max = max(cor_stats_layer))
## Restrict the range of colors further
layer_stat_cor_plot(cor_stats_layer, max = 0.25)
## Repeat with just the top 10 layer marker genes
layer_stat_cor_plot(layer_stat_cor(
tstats_Human_DLPFC_snRNAseq_Nguyen_topLayer,
modeling_results,
model_type = "enrichment",
top_n = 10
), max = 0.25)
## Now with the "pairwise" modeling results and also top_n = 10
layer_stat_cor_plot(layer_stat_cor(
tstats_Human_DLPFC_snRNAseq_Nguyen_topLayer,
modeling_results,
model_type = "pairwise",
top_n = 10
), max = 0.25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.