writeGMT: Write GMT File

Description Usage Arguments Details Value References See Also Examples

View source: R/writeGMT.R

Description

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

Usage

1
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

1
2
3
4
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")

egonw/rWikiPathways documentation built on May 10, 2021, 11:52 a.m.