View source: R/generateCorrelations.R
generateCorrelations | R Documentation |
Generate a correlation matrix from user-supplied data
generateCorrelations(cts, transformed = FALSE, cores = 1)
cts |
a gene count matrix where rownames are genes and colnames are sample IDs. |
transformed |
Boolean. Indicates whether data is already transformed using VST or a similar approach. If TRUE, VST transformation with DESeq2 will not be performed. Default: FALSE |
cores |
Numeric. Number of cores to use for calculating size factors. NOTE: cores > 1 does not work on Windows. Detault: 1. |
This function performs the same normalization and transformation steps on a user-supplied dataset that were originally used to generate the data provided in the pre-calculated databases used by this package. The resulting correlation matrix can be supplied to analyzeSingleGenes() as an input. NOTE: the resulting matrix is very large and will take up ~8 GB of memory.
Matrix with gene co-expression correlations.
if (! 'airway' in rownames(install.packages())) { if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("airway") } if (! 'EnsDb.Hsapiens.v86' in rownames(install.packages())) { if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("EnsDb.Hsapiens.v86") } if (! 'dplyr' in rownames(install.packages())) { install.packages("dplyr") } data(airway) cts <- assay(airway) ens2gene <- ensembldb::select(EnsDb.Hsapiens.v86, keys = rownames(cts), columns = c("SYMBOL"), keytype = "GENEID") %>% dplyr::distinct(SYMBOL, .keep_all = TRUE) %>% dplyr::inner_join(y = data.frame("GENEID" = rownames(cts))) cts <- cts[ens2gene$GENEID,] rownames(cts) <- ens2gene$SYMBOL corrMat <- generateCorrelations(cts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.