R/enrichment.R

# ssgsea of the count matrix using normalized count data
# method parameter is the same as gsva from gsva package
# enrichment : transcription factors (tfs), pathways (pws), default tfs
library(GSVA) # gsva
library(GSEABase) # getGmt

funEnrichment <- function(countMatrix, scData, fun2enrich="tfs", method){
 normData <- preprocessCountMatrix(countMatrix, scData="TRUE")
 if(fun2enrich=="tfs"){
  annots <- getGmt("data/c3.tft.v6.1.entrez.gmt")
  enrichTest <- gsva(expr=data.matrix(normData), gset.idx.list=annots, method="ssgsea")
 } else if(fun2enrich=="pws"){
   
 }
 return(enrichTest)
}
richabatra/FunRNA documentation built on May 4, 2019, 7:43 p.m.