GCT {cmapR} | R Documentation

## Initialize an object of class `GCT`

### Description

Initialize an object of class `GCT`

### Usage

    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

    # 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))

[Package cmapR version 1.2.1 Index]