Skip to contents

Reads a GMT file from MSigDB and converts it into a named list of gene sets suitable for IOBR functions.

Usage

format_msigdb(gmt, ont = "term", gene = "gene")

Arguments

gmt

Character string. Path to a GMT file.

ont

Character string. Name of the signature/set column in the parsed GMT table. Default is `"term"`.

gene

Character string. Name of the gene column in the parsed GMT table. Default is `"gene"`.

Value

Named list of character vectors, where each element contains the genes belonging to one signature.

Examples

if (rlang::is_installed("clusterProfiler")) {
  tf <- tempfile(fileext = ".gmt")
  writeLines(
    c(
      "HALLMARK_TNFA_SIGNALING_VIA_NFKB\tNA\tTNF\tNFKB1\tNFKB2",
      "HALLMARK_P53_PATHWAY\tNA\tTP53\tMDM2\tCDKN1A"
    ),
    con = tf
  )

  sig_list <- format_msigdb(tf, ont = "term", gene = "gene")
  names(sig_list)
  sig_list[[1]]
}
#> 
#> [1] "TNF"   "NFKB1" "NFKB2"