writeGMT: Write GMT File

View source: R/writeGMT.R

writeGMTR Documentation

Write GMT File

Description

Writes a GMT (Gene Matrix Transposed) file from a data frame.

Usage

writeGMT(df, outfile)

Arguments

df

Data frame with columns ordered as Identifiers, optional Description column and Genes. Identifiers must be first and Genes must be last.

outfile

Path to output GMT file

Details

The input data frame must include at least two columns: Identifiers (first column) and Genes (last column). The Identifiers will be duplicated to fill the Description column in the output GMT file if none is provided. If more than three columns are provided, then the first n columns will be concatenated with number of columns.

Value

None

References

Adapted from the GMT writer in MAGeCKFlute, https://github.com/WubingZhang/MAGeCKFlute/blob/master/R/readGMT.R

See Also

readPathwayGMT

Examples


#my.df <- data.frame(id=c("WP1000","WP1000","WP1000","WP1001","WP1001"),
#         description=c("cancer","cancer","cancer","diabetes","diabetes"),
#         gene=c("574413","2167","4690","5781","11184"))
#writeGMT(my.df, "my_gmt_file.gmt")


wikipathways/rWikiPathways documentation built on Jan. 10, 2024, 11:37 p.m.