An S4 class to manage interactions with geneSetFiles. A geneSetFile can be generated from gmt-files or a list of gene sets using the buildGeneSet() method. Specific geneSets can be retrieved using the getGeneSet method. A geneSetFile can be used as input in geneSetAssoc() or assocTest() to perform competitive/self-contained gene set analyses.

Initialize geneSetFile-class object

geneSetFile(path, memlimit = 5000)

Arguments

path

Path to geneSet file.

memlimit

Maximum number of records to load at a time.

Build a geneSetFile

  • buildGeneSet(x, ...): Generate a geneSetList or geneSetFile that stores (weighted) gene sets for use geneSetAnalyses. This can be based on 1) GMT-files (https://www.gsea-msigdb.org/gsea/msigdb/) and 2) a list of #' vectors of units per gene set. See buildGeneSet() for details.

Connect to a geneSetFile

  • geneSetFile(path): Connect to a geneSetFile object.

Getters

In the following code snippets, x is a geneSetFile object.

  • getGeneSet(x, geneSet): Retrieve geneSets for specified units and/or geneSetNames. Output will be of class geneSetList.

  • listUnits(x): Return a vector of all units included in the geneSetFile

  • listGeneSets(x): Return a vector of all geneSetNames included in the geneSetFile

Association testing

A geneSetFile can be directly supplied to the geneSetAssoc() method, using the geneSet parameter, in combination with an rvbResult object. To perform gene set burden analyses, assocTest can be used.

Examples


library(rvatData)

# build a geneSetList
# can also be build based on a GMT-file (see ?buildGeneSet)
file <- tempfile()
genesetfile <- buildGeneSet(
  list("geneset1" = c("SOD1", "NEK1"),
       "geneset2" = c("ABCA4", "SOD1", "NEK1"),
       "geneset3" = c("FUS", "NEK1")
       ),
  output = file
  )
#> Generated geneSetFile: /var/folders/cl/wvc0rvjx4vd5rzt2_fhpmfth0000gp/T//RtmpRC6myU/file1825c37ba7d07

# connect to a geneSetFile
genesetfile <- geneSetFile(file)

# extract a couple of gene sets from the geneSetFile, which will return a geneSetList (see ?geneSetList)
getGeneSet(genesetfile, c("geneset1", "geneset2"))
#> geneSetList
#> Contains 2 sets

# list included gene sets 
genesets <- listGeneSets(genesetfile)
head(genesets)
#> [1] "geneset1" "geneset2" "geneset3"

# see ?geneSetAssoc and ?`assocTest-aggregateFile` to run gene set analyses