Created
June 27, 2022 09:21
-
-
Save dBenedek/ca381fe6ab9e92c904399b2d7d0ce916 to your computer and use it in GitHub Desktop.
[Run GSVA] Run GSVA on gene sets #GSVA #enrichment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("GSVA") | |
library("fgsea") | |
library("tidyverse") | |
# Perform DESeq2 normalization on count data: | |
dds <- DESeqDataSetFromMatrix(countData = as.matrix(round(counts)), | |
colData = col_dat, | |
design = ~ 1) | |
dds <- estimateSizeFactors(dds) | |
normalized_counts <- ceiling(counts(dds, normalized=TRUE)-.5) | |
# Run GSVA: | |
gsva.es <- gsva(as.matrix(normalized_counts), gs, # gene set collection in a list format | |
verbose=T, kcdf="Poisson", # Gaussian if log-TPM | |
method="gsva", parallel.sz = 30) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment