library(GSNA)
# From a differential expression data set, we can generate a
# subset of genes with significant differential expression,
# up or down. Here we will extract genes with significant
# negative differential expression with
# avg_log2FC < 0 and p_val_adj <= 0.05 from **Seurat** data:
sig_DN.genes <-
toupper( rownames(subset( Bai_CiHep_v_Fib2.de,
avg_log2FC < 0 & p_val_adj < 0.05 )) )
# Using all the genes in the differential expression data set,
# we can obtain a suitable background:
bg <- rownames( Bai_CiHep_v_Fib2.de )
# Next we need a gene set collection in the form of a list of
# character vectors. We can convert the **Bai_gsc.tmod** object
# included in the sample data to such a list:
Bai.gsc <- tmod2gsc( Bai_gsc.tmod )
# Now, we can do a overrepresentation analysis search on this
# data using **Bai.gsc**:
sig_DN.gsnora <- gsnORAtest_cpp( l = sig_DN.genes,
bg = bg,
geneSetCollection = Bai.gsc )
Run the code above in your browser using DataLab