Write gene sets to GMT file (Gene Matrix Transposed). The GMT format is commonly used to store gene sets or gene annotations.
Examples
# Create example GMT data
gmt <- list(
"Pathway1" = c("GENE1", "GENE2", "GENE3"),
"Pathway2" = c("GENE2", "GENE4", "GENE5"),
"Pathway3" = c("GENE1", "GENE5", "GENE6")
)
# \donttest{
# Write to GMT file (creates file in temp directory)
temp_file <- tempfile(fileext = ".gmt")
write.gmt(gmt, temp_file)
# Write with custom source information
temp_file2 <- tempfile(fileext = ".gmt")
write.gmt(gmt, temp_file2, source = c("DB1", "DB2", "DB3"))
# Clean up
unlink(c(temp_file, temp_file2))
# }
