readGMT | R Documentation |
Imports a list of gene sets from a GMT (Gene Matrix Transposed) format file, offering a choice of ways to handle duplicated gene set names.
readGMT(
con,
sep = "\t",
geneIdType = "auto",
collectionType = NullCollection(),
valueType = c("GeneSetCollection", "list"),
deduplUse = c("first", "drop", "union", "smallest", "largest"),
...
)
con |
A connection object or a non-empty character string of length 1 containing e.g. the filename or URL of a (possibly compressed) GMT file. |
sep |
The character string separating members of each gene set in the GMT file. |
geneIdType |
By default a character vector of length 1 with the special
value |
collectionType |
Only used when |
valueType |
A character vector of length 1 specifying the desired type of return value. It must be one of:
|
deduplUse |
A character vector of length 1 specifying one of several methods to handle duplicated gene set names. Duplicated gene set names are explicitly forbidden by the GMT file format specification but can nevertheless be encountered in the wild. The available choices are:
|
... |
Further arguments passed on to |
The gene sets imported from the GMT file, with duplicate gene sets
resolved according to argument deduplUse
and in the format determined by
argument valueType
.
readLines
, GeneSetCollection
, getGmt
library(GSVA)
library(GSVAdata)
fname <- system.file("extdata", "c7.immunesigdb.v2024.1.Hs.symbols.gmt.gz",
package="GSVAdata")
## by default, guess geneIdType from content and return a GeneSetCollection
genesets <- readGMT(fname)
genesets
## how to manually override the geneIdType
genesets <- readGMT(fname, geneIdType=NullIdentifier())
genesets
## return a simple list instead of a GeneSetCollection
genesets <- readGMT(fname, valueType="list")
head(genesets, 2)
## the list has a geneIdType, too
gsvaAnnotation(genesets)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.