Skip to content

Instantly share code, notes, and snippets.

@dBenedek
Created June 27, 2022 09:21
Show Gist options
  • Save dBenedek/ca381fe6ab9e92c904399b2d7d0ce916 to your computer and use it in GitHub Desktop.
Save dBenedek/ca381fe6ab9e92c904399b2d7d0ce916 to your computer and use it in GitHub Desktop.
[Run GSVA] Run GSVA on gene sets #GSVA #enrichment
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