CAGEexp-class {CAGEr} | R Documentation

## CAGEr class to hold all data and metadata about one CAGE experiment.

### Description

The `CAGEr` class is a `MultiAssayExperiment` object containing all data and metadata about a set of CAGE libraries. It is a replacement for the `CAGEset` class. The main difference is that the expression data is stored in `DataFrame` objects of `Rle`-encoded expression values, instead of plain `data.frame`s. With large datasets, this saves considerable amounts of memory.

### Details

If `genomeName` is `NULL`, checks of chromosome names will be disabled and G-correction will not be possible. See https://support.bioconductor.org/p/86437/ for an example on how to create a BSgenome package.

Sample labels must be syntactically valid in the sense of the `make.names()` function, because they will be used as column names in some tables.

### Slots

`metadata`

  A list that must at least contain a `genomeName` member.

### See Also

`CAGEset`, `make.names`

### Examples

    pathsToInputFiles <- list.files( system.file("extdata", package = "CAGEr")
                                   , "ctss$"
                                   , full.names = TRUE)
    sampleLabels <- sub( ".chr17.ctss", "", basename(pathsToInputFiles))

    # The CAGEexp object can be created using specific constructor commands

    exampleCAGEexp <-
      CAGEexp( genomeName     = "BSgenome.Drerio.UCSC.danRer7"
             , inputFiles     = pathsToInputFiles
             , inputFilesType = "ctss"
             , sampleLabels   = sub( ".chr17.ctss", "", basename(pathsToInputFiles)))

    # Alternatively, it can be created just like another MultiAssayExperiment.
    # This is useful when providing pre-existing colData with many columns.

    exampleCAGEexp <-
      CAGEexp( metadata = list(genomeName = "BSgenome.Drerio.UCSC.danRer7")
             , colData  = DataFrame( inputFiles     = pathsToInputFiles
                                   , sampleLabels   = sampleLabels
                                   , inputFilesType = "ctss"
                                   , row.names      = sampleLabels))

    # Expression data is loaded by the getCTSS() function, that also calculates
    # library sizes and store them in the object's column data.

    getCTSS(exampleCAGEexp)
    librarySizes(exampleCAGEexp)
    colData(exampleCAGEexp)

    # CTSS data is stored internally as a SummarizedExperiemnt that can be retreived
    # as a whole, or as GRanges, or as an expression DataFrame.

    CTSStagCountSE(exampleCAGEexp)
    CTSScoordinatesGR(exampleCAGEexp)
    CTSStagCountDF(exampleCAGEexp)

    # Columns of the "colData" table are accessible directly via the "$" operator.

    exampleCAGEexp$l1 <- colSums(CTSStagCountDf(exampleCAGEexp) > 0)
    exampleCAGEexp$l1

[Package CAGEr version 1.28.0 Index]