GCT: Initialize an object of class 'GCT'

Description Usage Arguments Details Value See Also Examples

View source: R/GCT.R

Description

Initialize an object of class GCT

Usage

1
2
3
4
5
6
7
8
9
GCT(
  mat = NULL,
  rdesc = NULL,
  cdesc = NULL,
  src = NULL,
  rid = NULL,
  cid = NULL,
  matrix_only = FALSE
)

Arguments

mat

a matrix

rdesc

a data.frame of row metadata

cdesc

a data.frame of column metadata

src

path to a GCT file to read

rid

vector of character identifiers for rows

cid

vector of character identifiers for columns

matrix_only

logical indicating whether to read just the matrix data from src

Details

If mat is provided, rid and cid are treated as the row and column identifiers for the matrix and are assigned to the rid and cid slots of the GCT object.

If mat is not provided but src is provided, rid and cid are treated as filters. Data will be read from the file path provided to src and will then be restricted to the character ids or integer indices provided to rid and cid. In a similar manner, matrix_only controls whether the row and column metadata are also read from the src file path.

Value

a GCT object

See Also

Other GCTX parsing functions: append.dim(), fix.datatypes(), parse.gctx(), process_ids(), read.gctx.ids(), read.gctx.meta(), write.gctx.meta(), write.gctx(), write.gct()

Examples

1
2
3
4
5
6
7
8
9
# an empty object
(g <- GCT())
# with a matrix
# note we must specify row and column ids
(g <- GCT(mat=matrix(rnorm(100), nrow=10),
          rid=letters[1:10], cid=letters[1:10]))
# from file
gct_file <- system.file("extdata", "modzs_n25x50.gctx", package="cmapR")
(g <- GCT(src=gct_file))

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