Constructor for the LongTableDataMapper class, which maps from one or more raw experimental data files to the slots of a LongTable object.
LongTableDataMapper.RdConstructor for the LongTableDataMapper class, which maps from one or
more raw experimental data files to the slots of a LongTable object.
Arguments
- rawdata
A
data.frameof raw data from a treatment response experiment. This will be coerced to adata.tableinternally. We recommend using joins to aggregate your raw data if it is not present in a single file.- rowDataMap
A list-like object containing two
charactervectors. The first is column names inrawdataneeded to uniquely identify each row, the second is additional columns which map to rows, but are not required to uniquely identify them. Rows should be drugs.- colDataMap
A list-like object containing two
charactervectors. The first is column names inrawdataneeded to uniquely identify each column, the second is additional columns which map to rows, but are not required to uniquely identify them. Columns should be samples.- assayMap
A list-like where each item is a
listwith twocharactervectors defining an assay, the first containing the identifier columns inrawdataneeded to uniquely identify each row an assay, and the second therawdatacolumns to be mapped to that assay. The names ofassayMapwill be the names of the assays in theLongTablethat is created when callingmetaConstructon thisDataMapperobject. If the character vectors have names, the value columns will be renamed accordingly.- metadataMap
A list-like where each item is a
charactervector ofrawdatacolumn names to assign to the@metadataof theLongTable, where the name of that assay is the name of the list item. If names are omitted, assays will be numbered by their index in the list.
Value
A LongTable object, with columns mapped to it's slots according
to the various maps in the LongTableDataMapper object.
Details
The guessMapping method can be used to test hypotheses about the
cardinality of one or more sets of identifier columns. This is helpful
to determine the id columns for rowDataMap and colDataMap, as well
as identify columns mapping to assays or metadata.
To attach metadata not associated with rawdata, please use the metadata
assignment method on your LongTableDataMapper. This metadata will be
merged with any metadata from metadataMap and added to the LongTable
which this object ultimately constructs.
Examples
data(exampleDataMapper)
exampleDataMapper
#> <LongTableDataMapper>
#> rawdata: dim(3, 4)
#> treatmentid sampleid viability metadata
#> <char> <char> <num> <char>
#> 1: drug1 cell1 0.75 additional info
#> 2: drug1 cell1 0.10 additional info
#> 3: drug1 cell1 0.90 additional info
#>
rowDataMap: NA
#> colDataMap: NA
#> assayMap: NA
#> metadataMap: NA