Build a geneSetList or geneSetFile for use in gene set analyses (geneSetAssoc or assocTest-aggdb). Currently these can be built directly from GMT-files, data.frames and lists.

buildGeneSet(
  data = NULL,
  gmtpath = NULL,
  output = NULL,
  sep = "\t",
  verbose = TRUE
)

Arguments

data

Can be:

  • A data.frame where the first column includes the names of geneSets, the second column contains the genes included in the geneSet (comma-delimited). The third and fourth column are optional: the third column contains weights (comma-delimited), and the fourth column contains metadata.

  • A list, where the names of the list represent the geneSet names and each element in the list contains a vector with the genes included in the respective geneset.

gmtpath

Path to a gmt-file.

output

Optional output file path (output will be gz compressed text). Defaults to NULL, in which case a geneSetList is returned.

sep

Separator used in input file. Defaults to \t.

verbose

Should the function be verbose? (TRUE/FALSE). Defaults to TRUE.

Examples

genesetlist <- buildGeneSet(
  list(
    "geneset1" = c("SOD1", "NEK1"),
    "geneset2" = c("ABCA4", "SOD1", "NEK1"),
    "geneset3" = c("FUS", "NEK1")
  )
)
geneset <- genesetlist[[1]]

# list units and weights included in the geneSet
listUnits(geneset)
#> [1] "SOD1" "NEK1"
listWeights(geneset)
#> SOD1 NEK1 
#>  "1"  "1" 

# note that usually you'll work with geneSets in either a geneSetList or
# a geneSetFile (see ?geneSetList and ?geneSetFile)