SilacProteinPeptideExperiment-accessors {pulsedSilac} | R Documentation

## Accessors for the SilacProteinExperiment and SilacPeptideExperiment classes

### Description

All the accessors, dimension, subsetting, merging and coercers that work on `SilacProteinExperiment` and `SilacPeptideExperiment` objects. Functions that work on `SummarizedExperiment` objects should also work on these two objects. Detailed examples of these functions can be found in the vignette of this package.

### Usage

    ## S4 replacement method for signature 'SilacProteinExperiment,ANY'
    assays(x) <- value

    ## S4 replacement method for signature 'SilacPeptideExperiment,ANY'
    assays(x) <- value

    ## S4 method for signature 'SilacProteinExperiment'
    cbind(..., deparse.level = 1)

    ## S4 method for signature 'SilacPeptideExperiment'
    cbind(..., deparse.level = 1)

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

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

    ## S4 method for signature 'SilacProteinExperiment'
    metaoptions(x)

    ## S4 replacement method for signature 'SilacProteinExperiment'
    metaoptions(x) <- value

    ## S4 method for signature 'SilacPeptideExperiment'
    metaoptions(x)

    ## S4 replacement method for signature 'SilacPeptideExperiment'
    metaoptions(x) <- value

    ## S4 method for signature 'SilacProteinExperiment'
    rbind(..., deparse.level = 1)

    ## S4 method for signature 'SilacPeptideExperiment'
    rbind(..., deparse.level = 1)

    ## S4 replacement method for signature 'SilacProteinExperiment'
    rowData(x, ...) <- value

    ## S4 replacement method for signature 'SilacPeptideExperiment'
    rowData(x, ...) <- value

    ## S4 method for signature 'SilacProteinExperiment'
    subset(x, ...)

    ## S4 method for signature 'SilacPeptideExperiment'
    subset(x, ...)

### Arguments

`x` | A `SilacProteinExperiment` or a `SilacPeptideExperiment` object.
`value` | An object of class specified in the S4 method signature or as described in the following sections.
`...` | For `rbind` and `cbind` are `SilacProteinExperiment` or `SilacPeptideExperiment` objects to be joined together. For `subset` it is a logical comparison using a column name from the respective rowData `data.frame`. Otherwise unused.
`deparse.level` | Unused.

### Value

Elements from `SilacProteinExperiment` or `SilacPeptideExperiment` objects.

### Accessors

The following functions can be used to access the data in the class slots

`assays`:

  Access the assays (list of matrices) of the object. Value should be a matrix or list of matrices.

`assayNames`

  Access the assay names of the object. Value should be a character vector.

`rowData`

  Access the protein/peptide feature `data.frame` of the object. Value should be `data.frame` with as many rows as proteins/peptides.

`colData`:

  Access the samples `data.frame` of the object. Value should be a `data.frame` with as many rows as samples.

`metadata`:

  Access the metadata `list` of the object. Value should be a `list`.

`metaoptions`:

  Access the metaoptions `list` of the object. Value should be a `list`.

### Dimensions

The following functions can be used to get the number of proteins/peptides and number of samples:

`nrow`:

  Gives how many proteins and/or peptides the object has.

`ncol`:

  Gives how many samples the object has.

`dim`:

  Gives the number of proteins/peptides and the number of samples the object has.

`length`:

  Gives how many proteins and/or peptides the object has.

### Subsetting

The following functions can be used to subset the different classes:

`$`:

  Gives a column from colData by name.

``[``:

  Can be used to subset by row and column.

`subset`:

  Allows to subset based on a logical comparison using a column name from the rowData `data.frame`.

### Merging

The following functions can be used to aggregate objects of the same class together:

`cbind`:

  Joins two or more objects horizontally (adding samples). Must have the same proteins/peptides and in the same order.

`rbind`:

  Joins two or more objects vertically (adding proteins/peptides). Must have the same samples and in the same order.

`merge`:

  Joins two objects by adding new samples and tries to merge the proteins/peptide rowData data.frames.

Merge methods are explained in detail in merge.

### Coercers

The folloing functions can be used to transform a `SilacProteinExperiment` or a `SilacPeptideExperiment` into a `SummarizedExperiment` or a `data.frame`.

`as(x, 'SummarizedEpriment')`:

  Transforms the object into an object of class `SummarizedExperiment`.

`as(x, 'data.frame')`:

  Transforms the object into an object of class `data.frame`.

### Examples

    data('wormsPE')
    protPE <- ProtExp(wormsPE)

    # Accessors
    ## assays
    assays(protPE)

    ## assaysNames
    assayNames(protPE)

    ## colData
    colData(protPE)

    ## rowData
    rowData(protPE)

    ## metadata
    metadata(protPE)

    ## metaoptions
    #metaoptions(protPE)

    # Dimensions
    nrow(protPE)
    ncol(protPE)
    dim(protPE)
    length(protPE)

    # Subsetting
    protPE$line
    protPE[1,1]
    subset(protPE, protein_id == 'AC3.2')

    # Merging
    rbind(protPE[1:10, ], protPE[11:20, ])
    cbind(protPE[,1:2], protPE[,3:4])
    #merge(protPE[1:10, 1:3], protPE[3:10, 4:5])

    # Coercers
    as(protPE, 'SummarizedExperiment')
    as(protPE, 'data.frame')

[Package pulsedSilac version 1.1.4 Index]