melt.gct {cmapR} | R Documentation

## Transform a GCT object in to a long form `data.table` (aka 'melt')

### Description

Utilizes the `melt.data.table` function to transform the matrix into long form. Optionally can include the row and column annotations in the transformed `data.table`.

### Usage

    melt.gct(...)

    melt_gct(
      g,
      suffixes = NULL,
      remove_symmetries = FALSE,
      keep_rdesc = TRUE,
      keep_cdesc = TRUE,
      ...
    )

    ## S4 method for signature 'GCT'
    melt_gct(
      g,
      suffixes = NULL,
      remove_symmetries = FALSE,
      keep_rdesc = TRUE,
      keep_cdesc = TRUE,
      ...
    )

### Arguments

`...` | further arguments passed along to `data.table::merge`
`g` | the GCT object
`suffixes` | the character suffixes to be applied if there are collisions between the names of the row and column descriptors
`remove_symmetries` | boolean indicating whether to remove the lower triangle of the matrix (only applies if `g@mat` is symmetric)
`keep_rdesc` | boolean indicating whether to keep the row descriptors in the final result
`keep_cdesc` | boolean indicating whether to keep the column descriptors in the final result

### Value

a `data.table` object with the row and column ids and the matrix values and (optinally) the row and column descriptors

### See Also

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

### Examples

    # simple melt, keeping both row and column meta
    head(melt_gct(ds))

    # update row/colum suffixes to indicate rows are genes, columns experiments
    head(melt_gct(ds, suffixes = c("_gene", "_experiment")))

    # ignore row/column meta
    head(melt_gct(ds, keep_rdesc = FALSE, keep_cdesc = FALSE))

[Package cmapR version 1.2.1 Index]