formatGmt: Make strings in the GMT format

formatGmtR Documentation

Make strings in the GMT format

Description

Resulting string(s) can be exported into GMT file by writeLines

Usage

formatGmt(title, comment, genes)

## S4 method for signature 'character,character,character'
formatGmt(title, comment, genes)

## S4 method for signature 'character,missing,character'
formatGmt(title, genes)

## S4 method for signature 'character,character,list'
formatGmt(title, comment, genes)

## S4 method for signature 'character,missing,list'
formatGmt(title, genes)

Arguments

title

Character, title(s) of gene set(s)

comment

Character, comment(s) of gene set(s). Can be of the same length as the title, or be of length one: in the latter case, it will be replicated in gene set. This option can also be left out: the comment field of the GMT file will be left blank.

genes

A character vector of gene names, or a list of such vectors. In the former case, one GMT line is produced; otherwise multiple lines are returned. In the latter case, the length of the list must match the length of title.

Value

One or more lines of GMT file

Methods (by class)

  • formatGmt(title = character, comment = character, genes = character): title, comment, and genes are one character string

  • formatGmt(title = character, comment = missing, genes = character): title and genes are both one character string, comments are missing

  • formatGmt(title = character, comment = character, genes = list): title and comments are both vectors of character strings, genes are a list of the same length

  • formatGmt(title = character, comment = missing, genes = list): title is vectors of character strings, comments are missing, genes are a list of the same length as the title

Author(s)

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

Examples


formatGmt(title="GeneSet0", comment="My geneset", genes=c("MAPT", "MAPK", "AKT1"))
formatGmt(title="GeneSet0", genes=c("MAPT", "MAPK", "AKT1"))

formatGmt(title=c("GeneSet0", "GeneSet1"),
          comment=c("My geneset 0", "My geneset 1"),
          genes=list(c("MAPT", "MAPK", "AKT1"), c("EGFR", "CDC42")))
formatGmt(title=c("GeneSet0", "GeneSet1"),
          comment="My genesets",
          genes=list(c("MAPT", "MAPK", "AKT1"), c("EGFR", "CDC42")))
formatGmt(title=c("GeneSet0", "GeneSet1"),
          genes=list(c("MAPT", "MAPK", "AKT1"), c("EGFR", "CDC42")))

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