grp2gmt: Convert GRP files into GMT-formatted strings

View source: R/io_gmt.R

grp2gmtR Documentation

Convert GRP files into GMT-formatted strings

Description

GRP files are used by Connectivity Map on-line tool, which stores the information of a rank-ordered list of probesets. They are simply one-column text files, each line containing one probeset. grpFiles2gmt convert GRP files into GMT-formatted strings, which can be written in GMT files to be used by GSEA and other tools.

Usage

grp2gmt(txt, chiptype, name)

grpFiles2gmt(..., chiptype, n = -1L)

Arguments

txt

A vector of character strings, each containing one probeset

chiptype

Chip type, normally character representing the microarray chip type. If the option is missing, or is of value NA or NULL, no annotation is done.

name

Character, name of the gene set (the first field of the GMT file)

...

GRP file names

n

Integer, number of lines to be read; -1 indicates all lines should be read

Details

The function grp2gmt, called by grpFiles2gmt internally, annotates probesets when chiptype is supported by GTI, and transform them into the GMT format.

If chiptype is provided, the annotate function is called to fetch probeset annotations from the databank.

Value

A vector of character strings, each containing one line of a GMT file. They can be written to a file with the writeLines function.

Note

It is user's responsibility to check that all GRP files do exist and are readable.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

References

See http://www.broadinstitute.org/cmap/index.jsp for the use of GRP files in the Connectivity Map web tool.

Examples


up.file <- system.file("extdata/tags_up.grp", package="ribiosExpression")
down.file <- system.file("extdata/tags_down.grp", package="ribiosExpression")
grp2gmt(readLines(up.file, n=-1))
grpFiles2gmt(c(up.file, down.file), n=3)

## Not run: 
grp2gmt(readLines(up.file, n=-1), chiptype="HG_U95AV2")
grpFiles2gmt(c(up.file, down.file), n=-1L, chiptype="HG_U95AV2")

## End(Not run)


bedapub/ribiosExpression documentation built on Sept. 2, 2023, 4:37 a.m.