annotate_gct: Add annotations to a GCT object

Description Usage Arguments Value See Also Examples

Description

Given a GCT object and either a data.frame or a path to an annotation table, apply the annotations to the gct using the given keyfield.

Usage

1
2
3
4
5
6
annotate.gct(...)

annotate_gct(g, annot, dim = "row", keyfield = "id")

## S4 method for signature 'GCT'
annotate_gct(g, annot, dim = "row", keyfield = "id")

Arguments

...

arguments passed on to annotate_gct

g

a GCT object

annot

a data.frame or path to text table of annotations

dim

either 'row' or 'column' indicating which dimension of g to annotate

keyfield

the character name of the column in annot that matches the row or column identifiers in g

Value

a GCT object with annotations applied to the specified dimension

See Also

Other GCT utilities: melt.gct(), merge.gct(), rank.gct(), subset.gct()

Examples

1
2
3
4
5
6
7
gct_path <- system.file("extdata", "modzs_n25x50.gctx", package="cmapR")
# read the GCT file, getting the matrix only
g <- parse_gctx(gct_path, matrix_only=TRUE)
# separately, read the column annotations and then apply them using
# annotate_gct
cdesc <- read_gctx_meta(gct_path, dim="col")
g <- annotate_gct(g, cdesc, dim="col", keyfield="id")

cmap/cmapR documentation built on Oct. 14, 2021, 12:51 a.m.