[.WideSomaLogicData {readat} | R Documentation

## Indexing for WideSomaLogicData objects

### Description

Wrapper to `[.data.table`, ensuring that the `SequenceData`, `Metadata` and `Checksum` attributes are preserved.

### Usage

    ## S3 method for class 'WideSomaLogicData'
    x[...]

### Arguments

`x` | A `WideSomaLogicData` object.
`...` | Passed to `[.data.table`.

### Value

If the indexing returns a A `WideSomaLogicData` object.

### See Also

`data.table`

### Examples

    soma_file <- extractSampleData()
    wide_soma_data <- readAdat(soma_file)

    # Indexing returns a data.table, so the WideSomaLogicClass is preserved
    wide_soma_data[1:5, list(`SeqId.3896-5_2`)]
    # Indexing simplifies to a numeric vector, so the class is lost
    wide_soma_data[1:5, `SeqId.3896-5_2`]

    # Ignore the intensity columns (as per getSampleData)
    j <- !colnamesStartWithSeqId(wide_soma_data)
    wide_soma_data[1:5, j, with = FALSE]
    unlink(soma_file)

[Package readat version 1.6.0 Index]