LongTable-class {CoreGx}R Documentation

LongTable class definition

Description

Define a private constructor method to be used to build a LongTable object.

This is used as an alternative to R attributes for storing structural metadata of an S4 objects.

Add or replace an assay in a LongTable by name. Currently this function only works when the assay has all columns in row and column data tables (i.e., when assays is retured withDimnames=TRUE). This will be fixed in future updates.

Select an assay from within a LongTable object.

Usage

## S4 method for signature 'LongTable'
rowIDs(object, data = FALSE, key = FALSE)

## S4 method for signature 'LongTable'
rowMeta(object, data = FALSE, key = FALSE)

## S4 method for signature 'LongTable'
colIDs(object, data = FALSE, key = FALSE)

## S4 method for signature 'LongTable'
colMeta(object, data = FALSE, key = FALSE)

## S4 method for signature 'LongTable'
assayCols(object, i)

## S4 method for signature 'LongTable,character'
getIntern(object, x, ...)

## S4 method for signature 'LongTable,missing'
getIntern(object, x)

## S4 method for signature 'LongTable'
rowData(x, key = FALSE, use.names = FALSE)

## S4 replacement method for signature 'LongTable'
rowData(x) <- value

## S4 method for signature 'LongTable'
colData(x, key = FALSE)

## S4 replacement method for signature 'LongTable,ANY'
colData(x) <- value

## S4 method for signature 'LongTable'
assays(x, withDimnames = TRUE, metadata = withDimnames, key = !withDimnames)

## S4 replacement method for signature 'LongTable,list'
assays(x) <- value

## S4 method for signature 'LongTable,ANY'
assay(x, i, withDimnames = FALSE, metadata = withDimnames, key = !withDimnames)

## S4 replacement method for signature 'LongTable,character'
assay(x, i) <- value

## S4 method for signature 'LongTable'
assayNames(x)

## S4 method for signature 'LongTable,ANY,ANY'
x[[i, withDimnames = TRUE, metadata = withDimnames, keys = !withDimnames]]

## S4 method for signature 'data.frame'
buildLongTable(from, rowDataCols, colDataCols, assayCols)

## S4 method for signature 'character'
buildLongTable(from, rowDataCols, colDataCols, assayCols)

## S4 method for signature 'LongTable'
dim(x)

## S4 method for signature 'LongTable'
colnames(x)

## S4 method for signature 'LongTable'
rownames(x)

## S4 method for signature 'LongTable'
dimnames(x)

Arguments

object

LongTable

data

logical Should the colData for the metadata columns be returned instead of the column names? Default is FALSE.

key

logical Should the key columns also be returned? Defaults to !withDimnames.

i

character name or integer index of the desired assay.

x

The LongTable object to retrieve the dimnames for.

...

pairlist Addtional arguments to get or mget inside of the function.

use.names

logical This parameter is just here to stop matching the posotopoma; argument to use.names from the rowData generic. It doesn't do anything at this time and can be ignored.

value

A data.frame or data.table to update the assay data with. This must at minumum contain the row and column data identifier columns to allow correctly mapping the assay keys. We recommend modifying the results returned by assay(longTable, 'assayName', withDimnames=TRUE). For convenience, both the [[ and $ LongTable accessors return an assay with the dimnames and metadata already attached. In the case where your assay has only some of the row or column indentifiers and the an assay, i, already exists in x, then try join=TRUE to attempt to join with existing data.

withDimnames

logical Should the row and column IDs be joined to the assay. Default is TRUE to allow easy use of group by arguments when performing data aggregation using the data.table API.

metadata

logical Should the row and column metadata also be joined to the to the returned assay. Default is withDimnames.

keys

logical Should the row and column keys also be returned? Defaults to !withDimnames.

from

character Path to the .csv file containing the data and metadata from which to build the LongTable.

rowDataCols

list List with two character vectors, the first specifying one or more columns to be used as cell identifiers (e.g., cell-line name columns) and the second containing any additional metadata columns related to the cell identifiers.

colDataCols

list List with two character vectors, the first specifying one or more columns to be used as column identifiers (e.g., drug name columns) and the second containing any additional metadata columns related to the column identifiers.

assayCols

list A named list of character vectors specifying how to parse assay columns into a list of data.tables. Each list data.table will be named for the name of corresponding list item and contain the columns specified in the character vector of column names in each list item.

Value

LongTable object containing the assay data from a treatment response experiment

A character vector of rowData column names if data is FALSE, otherwise a data.table with the data from the rowData id columns.

A character vector of rowData column names if data is FALSE, otherwise a data.table with the data from the rowData metadta columns.

A character vector of colData column names if data is FALSE, otherwise a data.table with the data from the colData id columns.

A character vector of colData column names if data is FALSE, otherwise a data.table with the data from the colData metadta columns.

A list of character vectors containing the value column names for each assay if i is missing, otherwise a character vector of value column names for the selected assay.

value of x if length(x) == 1 else named list of values for all symbols in x

A named list with all values in environment object@.intern coerced to a list (and therefore copied).

A data.table containing rowID, row identifiers, and row metadata.

A copy of the LongTable object with the rowData slot updated.

A data.table containing row identifiers and metadata.

A copy of the LongTable object with the colData slot updated.

A list of data.table objects, one per assay in the object.

A copy of the LongTable with the assays modified.

LongTable With updated assays slot.

character Names of the assays contained in the LongTable.

A LongTable object containing one or more assays, indexed by rowID and colID.

A LongTable object containing one or more assays, indexed by rowID and colID.

numeric Vector of object dimensions.

character Vector of column names.

character Vector of row names.

list List with two character vectors, one for row and one for column names.

Methods (by generic)

Slots

rowData

See Slots section.

colData

See Slots section.

assays

See Slots section.

metadata

See Slots section.

.intern

See Slots section.

Slots

Examples

rowIDs(merckLongTable)

rowMeta(merckLongTable)

colIDs(merckLongTable)

colMeta(merckLongTable)

assayCols(merckLongTable)

getIntern(merckLongTable, 'rowIDs')
getIntern(merckLongTable, c('colIDs', 'colMeta'))

getIntern(merckLongTable)

rowData(merckLongTable)

rowData(merckLongTable) <- rowData(merckLongTable)

colData(merckLongTable)

# Get the keys as well, mostly for internal use
colData(merckLongTable, key=TRUE)

colData(merckLongTable) <- colData(merckLongTable)

assays(merckLongTable)

assays(merckLongTable) <- assays(merckLongTable, withDimnames=TRUE)

# Default annotations, just the key columns
assay(merckLongTable, 'sensitivity')
assay(merckLongTable, 1)

# With identifiers joined
assay(merckLongTable, 'sensitivity', withDimnames=TRUE)

# With identifiers and metadata
assay(merckLongTable, 'profiles', withDimnames=TRUE, metadata=TRUE)

assay(merckLongTable, 'sensitivity') <-
     assay(merckLongTable, 'sensitivity', withDimnames=TRUE)
assay(merckLongTable, 'sensitivity') <- merckLongTable$sensitivity

assayNames(merckLongTable)

merckLongTable[['sensitivity']]

dim(merckLongTable)

dim(merckLongTable)

head(colnames(merckLongTable))

head(rownames(merckLongTable))

lapply(dimnames(merckLongTable), head)


[Package CoreGx version 1.6.0 Index]