Skip to contents

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

Select an assay from within a LongTable object.

Usage

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

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

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

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

# S4 method for LongTable
idCols(object)

# S4 method for LongTable
assayIndex(x)

# S4 method for LongTable
assayKeys(x, i)

# S4 method for LongTable
assayCols(object, i)

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

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

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

# S4 method for LongTable
rowData(x, ...) <- value

# S4 method for LongTable
colData(x, key = FALSE, dimnames = FALSE, ...)

# S4 method for LongTable,ANY
colData(x, ...) <- value

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

# S4 method for LongTable,list
assays(x, withDimnames = TRUE, ...) <- value

# S4 method for LongTable,ANY
assay(
  x,
  i,
  withDimnames = TRUE,
  summarize = withDimnames,
  metadata = !summarize,
  key = !(summarize || withDimnames),
  ...
)

# S4 method for LongTable,ANY
assay(x, i) <- value

# S4 method for LongTable
assayNames(x)

# S4 method for LongTable,ANY,ANY
[[(x, i)

# S4 method for LongTable
dim(x)

# S4 method for LongTable
colnames(x)

# S4 method for LongTable
rownames(x)

# S4 method for 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. This is incompatible with summarize=TRUE, which will drop the key columns regardless of the value of this argument.

x

The LongTable object to retrieve the dimnames for.

i

character(1) name or integer index of the desired assay.

use.names

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

...

For developer use only! Pass raw=TRUE to return the slot for modification by reference.

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.

withDimnames

logical(1) Should the dimension names be returned joined to the assay. This retrieves both the row and column identifiers and returns them joined to the assay. For

metadata

logical(1) Should all of the metadata also be joined to the assay. This is useful when modifying assays as the resulting list has all the information needed to recreated the LongTable object. Defaults to withDimnames.

summarize

logical(1) If the assays is a summary where some of idCols(x) are not in assayKeys(x, i), then those missing columns are dropped. Defaults to FALSE. When metadata is TRUE, only metadata columns with 1:1 cardinality with the assay keys for i.

`x`

A LongTable or inheriting class.

`i`

An optional valid assay name or index in x.

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.

character A character vector containing the unique rowIDs and colIDs in a LongTable object.

A mutable copy of the "assayIndex" for x

A mutable copy of the "assyKeys" for x

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.

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

An immutable list.

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.

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)

  • rowMeta(LongTable): Get the names of the non-id columns from rowData.

  • colIDs(LongTable): Get the names of the columns in colData required to uniquely identify each row.

  • colMeta(LongTable): Get the names of the non-id columns in the colData data.table.

  • idCols(LongTable): Get the names of all id columns.

  • assayIndex(LongTable): Get the assayIndex item from the objects internal metadata.

  • assayKeys(LongTable): Get the assayKeys item from the objects internal metadata.

  • assayCols(LongTable): Get a list of column names for each assay in the object.

  • getIntern(object = LongTable, x = character): Access structural metadata present within a LongTable object. This is mostly for developmer use.

  • getIntern(object = LongTable, x = missing): Access all structural metadata present within a LongTable object. This is primarily for developmer use.

  • rowData(LongTable): Get the row level annotations for a LongTable object.

  • rowData(LongTable) <- value: Update the row annotations for a LongTable object. Currently requires that all columns in rowIDs(longTable) be present in value.

  • colData(LongTable): Get the column level annotations for a LongTable object.

  • colData(x = LongTable) <- value: Update the colData of a LongTable object. Currently requires that all of the colIDs(longTable) be in the value object.

  • assays(LongTable): Get a list containing all the assays in a LongTable.

  • assays(x = LongTable) <- value: Update the assays in a LongTable object. The rowIDs and colIDs must be present in all assays to allow successfully remapping the keys. We recommend modifying the list returned by assays(longTable, withDimnames=TRUE) and the reassigning to the LongTable.

  • assay(x = LongTable, i = ANY): Retrieve an assay data.table object from the assays slot of a LongTable object.

  • assay(x = LongTable, i = ANY) <- value:

  • assayNames(LongTable): Return the names of the assays contained in a LongTable

  • x[[i: Get an assay from a LongTable object. This method returns the row and column annotations by default to make assignment and aggregate operations easiers.

  • dim(LongTable): Get the number of row annotations by the number of column annotations from a LongTable object. Please note that row x columns does not necessarily equal the number of rows in an assay, since it is not required for each assay to have every row or column present.

  • colnames(LongTable): Retrieve the pseudo-colnames of a LongTable object, these are constructed by pasting together the colIDs(longTable) and can be used in the subset method for regex based queries.

  • rownames(LongTable): Retrieve the pseudo-rownames of a LongTable object, these are constructed by pasting together the rowIDs(longTable) and can be used in the subset method for regex based queries.

  • dimnames(LongTable): Get the pseudo-dimnames for a LongTable object. See colnames and rownames for more information.

Slots

rowData

See Slots section.

colData

See Slots section.

assays

See Slots section.

metadata

See Slots section.

.intern

See Slots section.

Slots

  • rowData: A data.table containing the metadata associated with the row dimension of a LongTable.

  • colData: A data.table containing the metadata associated with the column dimension of a LongTable.

  • assays: A list of data.tables, one for each assay in a LongTable.

  • metadata: An optional list of additional metadata for a LongTable which doesn't map to one of the dimensions.

  • .intern: An immutable list that holds internal structural metadata about a LongTable object, such as which columns are required to key the object.

Examples

rowIDs(merckLongTable)
#> [1] "drug1id"   "drug2id"   "drug1dose" "drug2dose"

rowMeta(merckLongTable)
#> [1] "combination_name"

colIDs(merckLongTable)
#> [1] "sampleid" "batchid" 

colMeta(merckLongTable)
#> character(0)

idCols(merckLongTable)
#> [1] "drug1id"   "drug2id"   "drug1dose" "drug2dose" "sampleid"  "batchid"  

assayIndex(nci_TRE_small)
#> Key: <.sensitivity, .profiles, .assay_metadata>
#>       rowKey colKey .sensitivity .profiles .assay_metadata
#>        <int>  <int>        <int>     <int>           <int>
#>    1:      1      1            1         1               1
#>    2:      1      2            2         2               2
#>    3:      1      3            3         3               3
#>    4:      1      5            4         4               4
#>    5:      2      1            5         5               5
#>   ---                                                     
#> 9284:   1886      1         9284      9284            9284
#> 9285:   1886      2         9285      9285            9285
#> 9286:   1886      3         9286      9286            9286
#> 9287:   1886      4         9287      9287            9287
#> 9288:   1886      5         9288      9288            9288

assayKeys(nci_TRE_small)
#> $sensitivity
#> [1] "treatment1id"   "treatment2id"   "treatment1dose" "treatment2dose"
#> [5] "replicate"      "sampleid"      
#> 
#> $profiles
#> [1] "treatment1id"   "treatment2id"   "treatment1dose" "treatment2dose"
#> [5] "replicate"      "sampleid"      
#> 
#> $assay_metadata
#> [1] "treatment1id"   "treatment2id"   "treatment1dose" "treatment2dose"
#> [5] "replicate"      "sampleid"      
#> 
assayKeys(nci_TRE_small, "sensitivity")
#> [1] "treatment1id"   "treatment2id"   "treatment1dose" "treatment2dose"
#> [5] "replicate"      "sampleid"      
assayKeys(nci_TRE_small, 1)
#> [1] "treatment1id"   "treatment2id"   "treatment1dose" "treatment2dose"
#> [5] "replicate"      "sampleid"      

assayCols(merckLongTable)
#> $sensitivity
#>  [1] "drug1id"    "drug2id"    "drug1dose"  "drug2dose"  "sampleid"  
#>  [6] "batchid"    "viability1" "viability2" "viability3" "viability4"
#> 
#> $profiles
#> [1] "drug1id"            "drug2id"            "drug1dose"         
#> [4] "drug2dose"          "sampleid"           "batchid"           
#> [7] "mu/muMax_published" "X/X0_published"    
#> 

getIntern(merckLongTable, 'rowIDs')
#> immutable character 
#> [1] "drug1id"   "drug2id"   "drug1dose" "drug2dose"
getIntern(merckLongTable, c('colIDs', 'colMeta'))
#> immutable list 
#> $colIDs
#> [1] "sampleid" "batchid" 
#> 
#> $colMeta
#> character(0)
#> 

getIntern(merckLongTable)
#> immutable list 
#> $rowIDs
#> [1] "drug1id"   "drug2id"   "drug1dose" "drug2dose"
#> 
#> $rowMeta
#> [1] "combination_name"
#> 
#> $colIDs
#> [1] "sampleid" "batchid" 
#> 
#> $colMeta
#> character(0)
#> 
#> $assayKeys
#> $assayKeys$sensitivity
#> [1] "drug1id"   "drug2id"   "drug1dose" "drug2dose" "sampleid"  "batchid"  
#> 
#> $assayKeys$profiles
#> [1] "drug1id"   "drug2id"   "drug1dose" "drug2dose" "sampleid"  "batchid"  
#> 
#> 
#> $assayIndex
#> Key: <.sensitivity, .profiles>
#>       rowKey colKey .sensitivity .profiles
#>        <int>  <int>        <int>     <int>
#>    1:      1      1            1         1
#>    2:      1      3            2         2
#>    3:      1      5            3         3
#>    4:      1      8            4         4
#>    5:      1     10            5         5
#>   ---                                     
#> 3796:    744      1         3796      3796
#> 3797:    744      3         3797      3797
#> 3798:    744      5         3798      3798
#> 3799:    744      8         3799      3799
#> 3800:    744     10         3800      3800
#> 

rowData(merckLongTable)
#>           drug1id    drug2id drug1dose drug2dose         combination_name
#>            <char>     <char>     <num>     <num>                   <char>
#>   1:         5-FU Bortezomib    0.3500   0.00045        5-FU & Bortezomib
#>   2:         5-FU Bortezomib    0.3500   0.00200        5-FU & Bortezomib
#>   3:         5-FU Bortezomib    0.3500   0.00900        5-FU & Bortezomib
#>   4:         5-FU Bortezomib    0.3500   0.04000        5-FU & Bortezomib
#>   5:         5-FU    L778123    0.3500   0.32500           5-FU & L778123
#>  ---                                                                     
#> 740: geldanamycin    MK-8776    0.0223   0.32500   geldanamycin & MK-8776
#> 741: geldanamycin  Sorafenib    0.0223  10.00000 geldanamycin & Sorafenib
#> 742: geldanamycin  Sorafenib    0.0223  20.00000 geldanamycin & Sorafenib
#> 743: geldanamycin  Topotecan    0.0223   0.02230 geldanamycin & Topotecan
#> 744: geldanamycin  Topotecan    0.0223   0.07750 geldanamycin & Topotecan

rowData(merckLongTable) <- rowData(merckLongTable)

colData(merckLongTable)
#>     sampleid batchid
#>       <char>   <int>
#>  1:    A2058       1
#>  2:    A2058       3
#>  3:    A2780       1
#>  4:    A2780       2
#>  5:     A375       1
#>  6:     A375       2
#>  7:     A375       3
#>  8:     A427       1
#>  9:     A427       3
#> 10:    CAOV3       1
#> 11:    CAOV3       2
#> 12:    CAOV3       3

# Get the keys as well, mostly for internal use
colData(merckLongTable, key=TRUE)
#> Key: <colKey>
#>     sampleid batchid colKey
#>       <char>   <int>  <int>
#>  1:    A2058       1      1
#>  2:    A2058       3      2
#>  3:    A2780       1      3
#>  4:    A2780       2      4
#>  5:     A375       1      5
#>  6:     A375       2      6
#>  7:     A375       3      7
#>  8:     A427       1      8
#>  9:     A427       3      9
#> 10:    CAOV3       1     10
#> 11:    CAOV3       2     11
#> 12:    CAOV3       3     12

colData(merckLongTable) <- colData(merckLongTable)

assays(merckLongTable)
#> Warning: column(s) not removed because not found: [.colnames]
#> $sensitivity
#> Key: <drug1id, drug2id, drug1dose, drug2dose, sampleid, batchid>
#>            drug1id    drug2id drug1dose drug2dose sampleid batchid
#>             <char>     <char>     <num>     <num>   <char>   <int>
#>    1:         5-FU Bortezomib    0.3500   0.00045    A2058       1
#>    2:         5-FU Bortezomib    0.3500   0.00045    A2780       1
#>    3:         5-FU Bortezomib    0.3500   0.00045     A375       1
#>    4:         5-FU Bortezomib    0.3500   0.00045     A427       1
#>    5:         5-FU Bortezomib    0.3500   0.00045    CAOV3       1
#>   ---                                                             
#> 3796: geldanamycin  Topotecan    0.0223   0.07750    A2058       1
#> 3797: geldanamycin  Topotecan    0.0223   0.07750    A2780       1
#> 3798: geldanamycin  Topotecan    0.0223   0.07750     A375       1
#> 3799: geldanamycin  Topotecan    0.0223   0.07750     A427       1
#> 3800: geldanamycin  Topotecan    0.0223   0.07750    CAOV3       1
#>               combination_name col Key .rownames row Key viability1 viability2
#>                         <char>   <int>    <char>   <int>      <num>      <num>
#>    1:        5-FU & Bortezomib       1   A2058:1       1      0.814      0.754
#>    2:        5-FU & Bortezomib       3   A2780:1       1      0.214      0.195
#>    3:        5-FU & Bortezomib       5    A375:1       1      1.064      1.080
#>    4:        5-FU & Bortezomib       8    A427:1       1      0.675      0.582
#>    5:        5-FU & Bortezomib      10   CAOV3:1       1      0.845      0.799
#>   ---                                                                         
#> 3796: geldanamycin & Topotecan       1   A2058:1     744      0.090      0.043
#> 3797: geldanamycin & Topotecan       3   A2780:1     744      0.025      0.022
#> 3798: geldanamycin & Topotecan       5    A375:1     744      0.151      0.146
#> 3799: geldanamycin & Topotecan       8    A427:1     744      0.142      0.166
#> 3800: geldanamycin & Topotecan      10   CAOV3:1     744      0.091      0.084
#>       viability3 viability4
#>            <num>      <num>
#>    1:      0.765      0.849
#>    2:      0.186      0.223
#>    3:      1.082      1.009
#>    4:      0.482      0.516
#>    5:      0.799      0.759
#>   ---                      
#> 3796:      0.112      0.103
#> 3797:      0.029      0.023
#> 3798:      0.144      0.171
#> 3799:      0.124      0.175
#> 3800:      0.134      0.119
#> 
#> $profiles
#> Key: <drug1id, drug2id, drug1dose, drug2dose, sampleid, batchid>
#>            drug1id    drug2id drug1dose drug2dose sampleid batchid
#>             <char>     <char>     <num>     <num>   <char>   <int>
#>    1:         5-FU Bortezomib    0.3500   0.00045    A2058       1
#>    2:         5-FU Bortezomib    0.3500   0.00045    A2780       1
#>    3:         5-FU Bortezomib    0.3500   0.00045     A375       1
#>    4:         5-FU Bortezomib    0.3500   0.00045     A427       1
#>    5:         5-FU Bortezomib    0.3500   0.00045    CAOV3       1
#>   ---                                                             
#> 3796: geldanamycin  Topotecan    0.0223   0.07750    A2058       1
#> 3797: geldanamycin  Topotecan    0.0223   0.07750    A2780       1
#> 3798: geldanamycin  Topotecan    0.0223   0.07750     A375       1
#> 3799: geldanamycin  Topotecan    0.0223   0.07750     A427       1
#> 3800: geldanamycin  Topotecan    0.0223   0.07750    CAOV3       1
#>               combination_name col Key .rownames row Key mu/muMax_published
#>                         <char>   <int>    <char>   <int>              <num>
#>    1:        5-FU & Bortezomib       1   A2058:1       1              0.880
#>    2:        5-FU & Bortezomib       3   A2780:1       1              0.384
#>    3:        5-FU & Bortezomib       5    A375:1       1              1.033
#>    4:        5-FU & Bortezomib       8    A427:1       1              0.676
#>    5:        5-FU & Bortezomib      10   CAOV3:1       1              0.708
#>   ---                                                                      
#> 3796: geldanamycin & Topotecan       1   A2058:1     744             -0.187
#> 3797: geldanamycin & Topotecan       3   A2780:1     744             -0.445
#> 3798: geldanamycin & Topotecan       5    A375:1     744              0.090
#> 3799: geldanamycin & Topotecan       8    A427:1     744             -0.012
#> 3800: geldanamycin & Topotecan      10   CAOV3:1     744             -1.935
#>       X/X0_published
#>                <num>
#>    1:          0.847
#>    2:          0.426
#>    3:          1.047
#>    4:          0.638
#>    5:          0.667
#>   ---               
#> 3796:          0.193
#> 3797:          0.135
#> 3798:          0.283
#> 3799:          0.246
#> 3800:          0.017
#> 

assays(merckLongTable) <- assays(merckLongTable, withDimnames=TRUE)
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]

# Default annotations, just the key columns
assay(merckLongTable, 'sensitivity')
#> Warning: column(s) not removed because not found: [.colnames]
#> Key: <drug1id, drug2id, drug1dose, drug2dose, sampleid, batchid>
#>            drug1id    drug2id drug1dose drug2dose sampleid batchid
#>             <char>     <char>     <num>     <num>   <char>   <int>
#>    1:         5-FU Bortezomib    0.3500   0.00045    A2058       1
#>    2:         5-FU Bortezomib    0.3500   0.00045    A2780       1
#>    3:         5-FU Bortezomib    0.3500   0.00045     A375       1
#>    4:         5-FU Bortezomib    0.3500   0.00045     A427       1
#>    5:         5-FU Bortezomib    0.3500   0.00045    CAOV3       1
#>   ---                                                             
#> 3796: geldanamycin  Topotecan    0.0223   0.07750    A2058       1
#> 3797: geldanamycin  Topotecan    0.0223   0.07750    A2780       1
#> 3798: geldanamycin  Topotecan    0.0223   0.07750     A375       1
#> 3799: geldanamycin  Topotecan    0.0223   0.07750     A427       1
#> 3800: geldanamycin  Topotecan    0.0223   0.07750    CAOV3       1
#>               combination_name col Key .rownames row Key i.col Key i..rownames
#>                         <char>   <int>    <char>   <int>     <int>      <char>
#>    1:        5-FU & Bortezomib       1   A2058:1       1         1     A2058:1
#>    2:        5-FU & Bortezomib       3   A2780:1       1         3     A2780:1
#>    3:        5-FU & Bortezomib       5    A375:1       1         5      A375:1
#>    4:        5-FU & Bortezomib       8    A427:1       1         8      A427:1
#>    5:        5-FU & Bortezomib      10   CAOV3:1       1        10     CAOV3:1
#>   ---                                                                         
#> 3796: geldanamycin & Topotecan       1   A2058:1     744         1     A2058:1
#> 3797: geldanamycin & Topotecan       3   A2780:1     744         3     A2780:1
#> 3798: geldanamycin & Topotecan       5    A375:1     744         5      A375:1
#> 3799: geldanamycin & Topotecan       8    A427:1     744         8      A427:1
#> 3800: geldanamycin & Topotecan      10   CAOV3:1     744        10     CAOV3:1
#>       i.row Key viability1 viability2 viability3 viability4
#>           <int>      <num>      <num>      <num>      <num>
#>    1:         1      0.814      0.754      0.765      0.849
#>    2:         1      0.214      0.195      0.186      0.223
#>    3:         1      1.064      1.080      1.082      1.009
#>    4:         1      0.675      0.582      0.482      0.516
#>    5:         1      0.845      0.799      0.799      0.759
#>   ---                                                      
#> 3796:       744      0.090      0.043      0.112      0.103
#> 3797:       744      0.025      0.022      0.029      0.023
#> 3798:       744      0.151      0.146      0.144      0.171
#> 3799:       744      0.142      0.166      0.124      0.175
#> 3800:       744      0.091      0.084      0.134      0.119
assay(merckLongTable, 1)
#> Warning: column(s) not removed because not found: [.colnames]
#> Key: <drug1id, drug2id, drug1dose, drug2dose, sampleid, batchid>
#>            drug1id    drug2id drug1dose drug2dose sampleid batchid
#>             <char>     <char>     <num>     <num>   <char>   <int>
#>    1:         5-FU Bortezomib    0.3500   0.00045    A2058       1
#>    2:         5-FU Bortezomib    0.3500   0.00045    A2780       1
#>    3:         5-FU Bortezomib    0.3500   0.00045     A375       1
#>    4:         5-FU Bortezomib    0.3500   0.00045     A427       1
#>    5:         5-FU Bortezomib    0.3500   0.00045    CAOV3       1
#>   ---                                                             
#> 3796: geldanamycin  Topotecan    0.0223   0.07750    A2058       1
#> 3797: geldanamycin  Topotecan    0.0223   0.07750    A2780       1
#> 3798: geldanamycin  Topotecan    0.0223   0.07750     A375       1
#> 3799: geldanamycin  Topotecan    0.0223   0.07750     A427       1
#> 3800: geldanamycin  Topotecan    0.0223   0.07750    CAOV3       1
#>               combination_name col Key .rownames row Key i.col Key i..rownames
#>                         <char>   <int>    <char>   <int>     <int>      <char>
#>    1:        5-FU & Bortezomib       1   A2058:1       1         1     A2058:1
#>    2:        5-FU & Bortezomib       3   A2780:1       1         3     A2780:1
#>    3:        5-FU & Bortezomib       5    A375:1       1         5      A375:1
#>    4:        5-FU & Bortezomib       8    A427:1       1         8      A427:1
#>    5:        5-FU & Bortezomib      10   CAOV3:1       1        10     CAOV3:1
#>   ---                                                                         
#> 3796: geldanamycin & Topotecan       1   A2058:1     744         1     A2058:1
#> 3797: geldanamycin & Topotecan       3   A2780:1     744         3     A2780:1
#> 3798: geldanamycin & Topotecan       5    A375:1     744         5      A375:1
#> 3799: geldanamycin & Topotecan       8    A427:1     744         8      A427:1
#> 3800: geldanamycin & Topotecan      10   CAOV3:1     744        10     CAOV3:1
#>       i.row Key viability1 viability2 viability3 viability4
#>           <int>      <num>      <num>      <num>      <num>
#>    1:         1      0.814      0.754      0.765      0.849
#>    2:         1      0.214      0.195      0.186      0.223
#>    3:         1      1.064      1.080      1.082      1.009
#>    4:         1      0.675      0.582      0.482      0.516
#>    5:         1      0.845      0.799      0.799      0.759
#>   ---                                                      
#> 3796:       744      0.090      0.043      0.112      0.103
#> 3797:       744      0.025      0.022      0.029      0.023
#> 3798:       744      0.151      0.146      0.144      0.171
#> 3799:       744      0.142      0.166      0.124      0.175
#> 3800:       744      0.091      0.084      0.134      0.119

# With identifiers joined
assay(merckLongTable, 'sensitivity', withDimnames=TRUE)
#> Warning: column(s) not removed because not found: [.colnames]
#> Key: <drug1id, drug2id, drug1dose, drug2dose, sampleid, batchid>
#>            drug1id    drug2id drug1dose drug2dose sampleid batchid
#>             <char>     <char>     <num>     <num>   <char>   <int>
#>    1:         5-FU Bortezomib    0.3500   0.00045    A2058       1
#>    2:         5-FU Bortezomib    0.3500   0.00045    A2780       1
#>    3:         5-FU Bortezomib    0.3500   0.00045     A375       1
#>    4:         5-FU Bortezomib    0.3500   0.00045     A427       1
#>    5:         5-FU Bortezomib    0.3500   0.00045    CAOV3       1
#>   ---                                                             
#> 3796: geldanamycin  Topotecan    0.0223   0.07750    A2058       1
#> 3797: geldanamycin  Topotecan    0.0223   0.07750    A2780       1
#> 3798: geldanamycin  Topotecan    0.0223   0.07750     A375       1
#> 3799: geldanamycin  Topotecan    0.0223   0.07750     A427       1
#> 3800: geldanamycin  Topotecan    0.0223   0.07750    CAOV3       1
#>               combination_name col Key .rownames row Key i.col Key i..rownames
#>                         <char>   <int>    <char>   <int>     <int>      <char>
#>    1:        5-FU & Bortezomib       1   A2058:1       1         1     A2058:1
#>    2:        5-FU & Bortezomib       3   A2780:1       1         3     A2780:1
#>    3:        5-FU & Bortezomib       5    A375:1       1         5      A375:1
#>    4:        5-FU & Bortezomib       8    A427:1       1         8      A427:1
#>    5:        5-FU & Bortezomib      10   CAOV3:1       1        10     CAOV3:1
#>   ---                                                                         
#> 3796: geldanamycin & Topotecan       1   A2058:1     744         1     A2058:1
#> 3797: geldanamycin & Topotecan       3   A2780:1     744         3     A2780:1
#> 3798: geldanamycin & Topotecan       5    A375:1     744         5      A375:1
#> 3799: geldanamycin & Topotecan       8    A427:1     744         8      A427:1
#> 3800: geldanamycin & Topotecan      10   CAOV3:1     744        10     CAOV3:1
#>       i.row Key viability1 viability2 viability3 viability4
#>           <int>      <num>      <num>      <num>      <num>
#>    1:         1      0.814      0.754      0.765      0.849
#>    2:         1      0.214      0.195      0.186      0.223
#>    3:         1      1.064      1.080      1.082      1.009
#>    4:         1      0.675      0.582      0.482      0.516
#>    5:         1      0.845      0.799      0.799      0.759
#>   ---                                                      
#> 3796:       744      0.090      0.043      0.112      0.103
#> 3797:       744      0.025      0.022      0.029      0.023
#> 3798:       744      0.151      0.146      0.144      0.171
#> 3799:       744      0.142      0.166      0.124      0.175
#> 3800:       744      0.091      0.084      0.134      0.119

# With identifiers and metadata
assay(merckLongTable, 'profiles', withDimnames=TRUE, metadata=TRUE)
#> Warning: column(s) not removed because not found: [.colnames]
#> Key: <drug1id, drug2id, drug1dose, drug2dose, sampleid, batchid>
#>            drug1id    drug2id drug1dose drug2dose sampleid batchid
#>             <char>     <char>     <num>     <num>   <char>   <int>
#>    1:         5-FU Bortezomib    0.3500   0.00045    A2058       1
#>    2:         5-FU Bortezomib    0.3500   0.00045    A2780       1
#>    3:         5-FU Bortezomib    0.3500   0.00045     A375       1
#>    4:         5-FU Bortezomib    0.3500   0.00045     A427       1
#>    5:         5-FU Bortezomib    0.3500   0.00045    CAOV3       1
#>   ---                                                             
#> 3796: geldanamycin  Topotecan    0.0223   0.07750    A2058       1
#> 3797: geldanamycin  Topotecan    0.0223   0.07750    A2780       1
#> 3798: geldanamycin  Topotecan    0.0223   0.07750     A375       1
#> 3799: geldanamycin  Topotecan    0.0223   0.07750     A427       1
#> 3800: geldanamycin  Topotecan    0.0223   0.07750    CAOV3       1
#>               combination_name col Key .rownames row Key i.col Key i..rownames
#>                         <char>   <int>    <char>   <int>     <int>      <char>
#>    1:        5-FU & Bortezomib       1   A2058:1       1         1     A2058:1
#>    2:        5-FU & Bortezomib       3   A2780:1       1         3     A2780:1
#>    3:        5-FU & Bortezomib       5    A375:1       1         5      A375:1
#>    4:        5-FU & Bortezomib       8    A427:1       1         8      A427:1
#>    5:        5-FU & Bortezomib      10   CAOV3:1       1        10     CAOV3:1
#>   ---                                                                         
#> 3796: geldanamycin & Topotecan       1   A2058:1     744         1     A2058:1
#> 3797: geldanamycin & Topotecan       3   A2780:1     744         3     A2780:1
#> 3798: geldanamycin & Topotecan       5    A375:1     744         5      A375:1
#> 3799: geldanamycin & Topotecan       8    A427:1     744         8      A427:1
#> 3800: geldanamycin & Topotecan      10   CAOV3:1     744        10     CAOV3:1
#>       i.row Key mu/muMax_published X/X0_published
#>           <int>              <num>          <num>
#>    1:         1              0.880          0.847
#>    2:         1              0.384          0.426
#>    3:         1              1.033          1.047
#>    4:         1              0.676          0.638
#>    5:         1              0.708          0.667
#>   ---                                            
#> 3796:       744             -0.187          0.193
#> 3797:       744             -0.445          0.135
#> 3798:       744              0.090          0.283
#> 3799:       744             -0.012          0.246
#> 3800:       744             -1.935          0.017

assay(merckLongTable, 'sensitivity') <-
     assay(merckLongTable, 'sensitivity', withDimnames=TRUE)
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]
assay(merckLongTable, 'sensitivity') <- merckLongTable$sensitivity
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]
#> Warning: column(s) not removed because not found: [.colnames]

assayNames(merckLongTable)
#> [1] "sensitivity" "profiles"   
names(merckLongTable)
#> [1] "sensitivity" "profiles"   

merckLongTable[['sensitivity']]
#> Warning: column(s) not removed because not found: [.colnames]
#> Key: <drug1id, drug2id, drug1dose, drug2dose, sampleid, batchid>
#>            drug1id    drug2id drug1dose drug2dose sampleid batchid
#>             <char>     <char>     <num>     <num>   <char>   <int>
#>    1:         5-FU Bortezomib    0.3500   0.00045    A2058       1
#>    2:         5-FU Bortezomib    0.3500   0.00045    A2780       1
#>    3:         5-FU Bortezomib    0.3500   0.00045     A375       1
#>    4:         5-FU Bortezomib    0.3500   0.00045     A427       1
#>    5:         5-FU Bortezomib    0.3500   0.00045    CAOV3       1
#>   ---                                                             
#> 3796: geldanamycin  Topotecan    0.0223   0.07750    A2058       1
#> 3797: geldanamycin  Topotecan    0.0223   0.07750    A2780       1
#> 3798: geldanamycin  Topotecan    0.0223   0.07750     A375       1
#> 3799: geldanamycin  Topotecan    0.0223   0.07750     A427       1
#> 3800: geldanamycin  Topotecan    0.0223   0.07750    CAOV3       1
#>               combination_name col Key .rownames row Key i.col Key i..rownames
#>                         <char>   <int>    <char>   <int>     <int>      <char>
#>    1:        5-FU & Bortezomib       1   A2058:1       1         1     A2058:1
#>    2:        5-FU & Bortezomib       3   A2780:1       1         3     A2780:1
#>    3:        5-FU & Bortezomib       5    A375:1       1         5      A375:1
#>    4:        5-FU & Bortezomib       8    A427:1       1         8      A427:1
#>    5:        5-FU & Bortezomib      10   CAOV3:1       1        10     CAOV3:1
#>   ---                                                                         
#> 3796: geldanamycin & Topotecan       1   A2058:1     744         1     A2058:1
#> 3797: geldanamycin & Topotecan       3   A2780:1     744         3     A2780:1
#> 3798: geldanamycin & Topotecan       5    A375:1     744         5      A375:1
#> 3799: geldanamycin & Topotecan       8    A427:1     744         8      A427:1
#> 3800: geldanamycin & Topotecan      10   CAOV3:1     744        10     CAOV3:1
#>       i.row Key i.col Key.2 i..rownames.2 i.row Key.2 i.col Key.1 i..rownames.1
#>           <int>       <int>        <char>       <int>       <int>        <char>
#>    1:         1           1       A2058:1           1           1       A2058:1
#>    2:         1           3       A2780:1           1           3       A2780:1
#>    3:         1           5        A375:1           1           5        A375:1
#>    4:         1           8        A427:1           1           8        A427:1
#>    5:         1          10       CAOV3:1           1          10       CAOV3:1
#>   ---                                                                          
#> 3796:       744           1       A2058:1         744           1       A2058:1
#> 3797:       744           3       A2780:1         744           3       A2780:1
#> 3798:       744           5        A375:1         744           5        A375:1
#> 3799:       744           8        A427:1         744           8        A427:1
#> 3800:       744          10       CAOV3:1         744          10       CAOV3:1
#>       i.row Key.1 viability1 viability2 viability3 viability4
#>             <int>      <num>      <num>      <num>      <num>
#>    1:           1      0.814      0.754      0.765      0.849
#>    2:           1      0.214      0.195      0.186      0.223
#>    3:           1      1.064      1.080      1.082      1.009
#>    4:           1      0.675      0.582      0.482      0.516
#>    5:           1      0.845      0.799      0.799      0.759
#>   ---                                                        
#> 3796:         744      0.090      0.043      0.112      0.103
#> 3797:         744      0.025      0.022      0.029      0.023
#> 3798:         744      0.151      0.146      0.144      0.171
#> 3799:         744      0.142      0.166      0.124      0.175
#> 3800:         744      0.091      0.084      0.134      0.119

dim(merckLongTable)
#> Warning: column(s) not removed because not found: [.colnames]
#> [1] 744  12

dim(merckLongTable)
#> Warning: column(s) not removed because not found: [.colnames]
#> [1] 744  12

head(colnames(merckLongTable))
#> NULL

head(rownames(merckLongTable))
#> [1] "5-FU:Bortezomib:0.35:0.00045" "5-FU:Bortezomib:0.35:0.002"  
#> [3] "5-FU:Bortezomib:0.35:0.009"   "5-FU:Bortezomib:0.35:0.04"   
#> [5] "5-FU:L778123:0.35:0.325"      "5-FU:L778123:0.35:0.8"       

lapply(dimnames(merckLongTable), head)
#> [[1]]
#> [1] "5-FU:Bortezomib:0.35:0.00045" "5-FU:Bortezomib:0.35:0.002"  
#> [3] "5-FU:Bortezomib:0.35:0.009"   "5-FU:Bortezomib:0.35:0.04"   
#> [5] "5-FU:L778123:0.35:0.325"      "5-FU:L778123:0.35:0.8"       
#> 
#> [[2]]
#> NULL
#>