AbstractTopDownSet-class {topdownr} | R Documentation

## The AbstractTopDownSet class

### Description

Abstract/VIRTUAL parent class for TopDownSet and NCBSet to provide common interface.

### Usage

    ## S4 method for signature 'AbstractTopDownSet,ANY,ANY,ANY'
    x[i, j, ..., drop = FALSE]

    ## S4 method for signature 'AbstractTopDownSet,ANY,missing'
    x[[i, j, ...]]

    ## S4 replacement method for signature 'AbstractTopDownSet,ANY,missing'
    x[[i, j, ...]] <- value

    ## S4 method for signature 'AbstractTopDownSet'
    x$name

    ## S4 replacement method for signature 'AbstractTopDownSet'
    x$name <- value

    ## S4 method for signature 'AbstractTopDownSet'
    assayData(object)

    ## S4 method for signature 'AbstractTopDownSet'
    colData(object)

    ## S4 replacement method for signature 'AbstractTopDownSet'
    colData(object, ...) <- value

    ## S4 method for signature 'AbstractTopDownSet,AbstractTopDownSet'
    combine(x, y)

    ## S4 method for signature 'AbstractTopDownSet'
    conditionData(object, ...)

    ## S4 replacement method for signature 'AbstractTopDownSet'
    conditionData(object, ...) <- value

    ## S4 method for signature 'AbstractTopDownSet'
    conditionNames(object)

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

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

    ## S4 method for signature 'AbstractTopDownSet'
    removeEmptyConditions(object)

    ## S4 method for signature 'AbstractTopDownSet'
    rowViews(object, ...)

    ## S4 method for signature 'AbstractTopDownSet'
    show(object)

    ## S4 method for signature 'AbstractTopDownSet'
    summary(object, what = c("rows", "columns"), ...)

    ## S4 method for signature 'AbstractTopDownSet'
    updateConditionNames(
      object,
      sampleColumns = c("Mz", "AgcTarget", "EtdReagentTarget", "EtdActivation",
        "CidActivation", "HcdActivation", "UvpdActivation"),
      verbose = interactive()
    )

    ## S4 method for signature 'AbstractTopDownSet'
    updateMedianInjectionTime(
      object,
      by = list(Mz = object$Mz, AgcTarget = object$AgcTarget)
    )

### Arguments

`i, j` | `numeric`, `logical` or `character`, indices specifying elements to extract or replace.
`drop` | `logical`, currently ignored.
`value` | replacment value.
`name` | `character` name of an (non)existing column in `colData`.
`object, x` | `AbstractTopDownSet`
`y` | `AbstractTopDownSet`
`what` | `character`, specifies whether `"rows"` or `"columns"` should be summarized.
`sampleColumns` | `character`, column names of the `colData()` used to define a sample (technical replicate). This is used to add the `Sample` column (used for easier aggregation, etc.).
`verbose` | `logical`, verbose output?
`by` | `list`, grouping information.
`...` | arguments passed to internal/other methods.

### Details

This class just provides a common interface. It is not intended for direct use by the user. Please see TopDownSet for an example usage of its child class.

### Value

This is an Abstract/VIRTUAL class to provide a common interface for TopDownSet and NCBSet. It is not possible to create an `AbstractTopDownSet` object.

### Methods (by generic)

- `[`: Subset operator.

  For `i` `numeric`, `logical` or `character` vectors or empty (missing) or `NULL` are supported. Subsetting is done on the fragment/bond (row) level. `character` indices could be names (e.g. `c("a1", "b1", "c1", "c2", "c3")`) or types (e.g. `c("c", "x")`) of the fragments for TopDownSet objects, or names of the bonds (e.g. `c("bond001")`) for NCBSet objects.
  `j` could be a `numeric` or `logical` vector and subsetting is done on the condition/run (column) level.

- `[[`: Subset operator.

  `i` could be a `numeric` or `logical` vector and subsetting is done on the condition/run (column) level.

- `[[<-`: Setter for a column in the `colData` slot.

  The `[[<-` operator is used to add/replace a single column of the `colData` `DataFrame`.

- `$`: Accessor for columns in the `colData` slot.

  The `$` simplifies the accession of a single column of the `colData`. It is identical to the `[[` operator.

- `$<-`: Setter for a column in the `colData` slot.

  The `$<-` operator is used to add/replace a single column of the `colData` `DataFrame`. It is identical to the `[[<-` operator.

- `assayData`: Accessor for the `assay` slot.

  Returns a Matrix::dgCMatrix that stores the intensity/coverage information of AbstractTopDownSet object.

- `colData`: Accessor for the `colData` slot.

  Returns a S4Vectors::DataFrame that stores metadata for the conditons/runs (columns) of the AbstractTopDownSet object.

- `colData<-`: Setter for the `colData` slot.

  Replaces metadata for the conditons/runs (columns) of the AbstractTopDownSet object.

- `combine`: Combine `AbstractTopDownSet` objects.

  `combine` allows to combine two or more `AbstractTopDownSet` objects. Please note that it uses the default `sampleColumns` to define technical replicates (see `readTopDownFiles()`).and the default `by` argument to group ion injection times for the calculation of the median time (see `updateMedianInjectionTime()`). Both could be modified after `combine` by calling `updateConditionNames()` (with modified `sampleColumns` argument) and `updateMedianInjectionTime()` (with modified `by` argument).

- `conditionData`: Accessor for the `colData` slot.

  An alias for `colData`.

- `conditionData<-`: Setter for the `colData` slot.

  An alias for `colData<-`.

- `conditionNames`: Accessor for condition names.

  Returns a `character` with names for the conditions/runs (columns).

- `dim`: Accessor for dimensions.

  Returns a `numeric` with number of fragments/bonds (rows) and conditions/runs (columns).

- `dimnames`: Accessor for dimension names.

  Returns a `list` with names for the fragments/bonds (rows) and for the conditions/runs (columns).

- `removeEmptyConditions`: Remove empty conditions/runs.

  Removes conditions/runs (columns) without any intensity/coverage information from the AbstractTopDownSet object. It returns a modified AbstractTopDownSet object.

- `rowViews`: Accessor for the `rowViews` slot.

  Depending on the implementation it returns an FragmentViews object for TopDownSet objects or an Biostrings::XStringViews object for NCBSet objects.

- `summary`: Summary statistics.

  Returns a `matrix` with some statistics: number of fragments, total/min/first quartile/median/mean/third quartile/maximum of intensity values.

- `updateConditionNames`: Update condition names.

  Updates condition names based on `sampleColumns` from `conditionData`/`colData`. Columns with just identical entries are ignored. This method will create/update the `colData(object)$Sample` column that identifies technical replicates and could be used in other methods.

- `updateMedianInjectionTime`: Update median ion injection times.

  Recalculates median ion injection times by a user given grouping variable (default: Mz, AgcTarget). This is useful if you acquire new data and the ion injection time differs across the runs. Use the `by` argument to provide a `list`/`data.frame` of grouping variables, e.g. `by=colData(object)[, c("Mz", "AgcTarget", "File")]`.

### Slots

`rowViews`

  Biostrings::XStringViews, information about fragments/bonds (name, type, sequence, mass, charge), see Biostrings::XStringViews and FragmentViews for details.

`colData`

  S4Vectors::DataFrame, information about the MS2 experiments and the fragmentation conditions.

`assay`

  Matrix::dgCMatrix, intensity/coverage values of the fragments/bonds. The rows correspond to the fragments/bonds and the columns to the condition/run. It just stores values that are different from zero.

`files`

  `character`, files that were imported.

`processing`

  `character`, log messages.

### Author(s)

Sebastian Gibb mail@sebastiangibb.de

### See Also

- TopDownSet and NCBSet which both implement/use this interface. These manual pages also provide some example code.

- FragmentViews (and Biostrings::XStringViews) for the row view interface.

- Matrix::dgCMatrix for technical details about the intensity/coverage storage.

### Examples

    ## Because AbstractTopDownSet is a VIRTUAL class we could not create any
    ## object of it. Here we demonstrate the usage with an TopDownSet that
    ## implements the AbstractTopDownSet interface. See `?"TopDownSet-class"` for
    ## more details an further examples.

    ## Example data
    data(tds, package="topdownr")

    tds

    head(summary(tds))

    # Accessing slots
    rowViews(tds)
    colData(tds)
    head(assayData(tds))

    # Accessing colData
    tds$Mz
    tds$FilterString

    # Subsetting

    # First 100 fragments
    tds[1:100]

    # All c fragments
    tds["c"]

    # Just c 152
    tds["c152"]

    # Condition 1 to 10
    tds[, 1:10]

[Package topdownr version 1.10.0 Index]