Sometimes, the data is wanted in a "tidy" format with each piece of information as an individual row. tidy_gmt() converts the list output of read_gmt() to a tibble.

tidy_gmt(gmt)

Arguments

gmt

a gmt from read_gmt()

Value

a tibble with columns "gene_set" and "gene"

Examples

kegg_path <- system.file("extdata", "c2.cp.kegg.v6.2.symbols.gmt.txt", package = "readgmt") kegg <- read_gmt(kegg_path) tidy_gmt(kegg)
#> # A tibble: 12,875 x 2 #> gene_set gene #> <chr> <chr> #> 1 KEGG_GLYCOLYSIS_GLUCONEOGENESIS ACSS2 #> 2 KEGG_GLYCOLYSIS_GLUCONEOGENESIS GCK #> 3 KEGG_GLYCOLYSIS_GLUCONEOGENESIS PGK2 #> 4 KEGG_GLYCOLYSIS_GLUCONEOGENESIS PGK1 #> 5 KEGG_GLYCOLYSIS_GLUCONEOGENESIS PDHB #> 6 KEGG_GLYCOLYSIS_GLUCONEOGENESIS PDHA1 #> 7 KEGG_GLYCOLYSIS_GLUCONEOGENESIS PDHA2 #> 8 KEGG_GLYCOLYSIS_GLUCONEOGENESIS PGM2 #> 9 KEGG_GLYCOLYSIS_GLUCONEOGENESIS TPI1 #> 10 KEGG_GLYCOLYSIS_GLUCONEOGENESIS ACSS1 #> # … with 12,865 more rows