View source: R/layer_stat_cor.R
layer_stat_cor | R Documentation |
Layer modeling correlation of statistics
layer_stat_cor(
stats,
modeling_results = fetch_data(type = "modeling_results"),
model_type = names(modeling_results)[1],
reverse = FALSE,
top_n = NULL
)
stats |
A data.frame where the row names are Ensembl gene IDs, the
column names are labels for clusters of cells or cell types, and where
each cell contains the given statistic for that gene and cell type. These
statistics should be computed similarly to the modeling results from
the data we provide. For example, like the |
modeling_results |
Defaults to the output of
|
model_type |
A named element of the |
reverse |
A |
top_n |
An |
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 correlation matrix between stats
and our statistics using only
the Ensembl gene IDs present in both tables. The columns are sorted using
a hierarchical cluster.
Andrew E Jaffe, Leonardo Collado-Torres
Other Layer correlation functions:
annotate_registered_clusters()
,
layer_stat_cor_plot()
## 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"
)
## Explore the correlation matrix
head(cor_stats_layer[, seq_len(3)])
summary(cor_stats_layer)
## Repeat with top_n set to 10
summary(layer_stat_cor(
tstats_Human_DLPFC_snRNAseq_Nguyen_topLayer,
modeling_results,
model_type = "enrichment",
top_n = 10
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.