baySeq-classes {baySeq} | R Documentation

## baySeq - classes

### Description

The `countData` class is used to define summaries of count data and establishing prior and posterior parameters on distributions defined upon the count data.

### Slots

Objects of these class contain the following components:

`data`: | Count data (matrix).
`replicates`: | The replicate structure of the data. Stored as a factor, but can be given in any form.
`groups`: | Group (model) structure to test on the data (list).
`annotation`: | Annotation data for each count (data.frame).
`priorType`: | Character string describing the type of prior information available in slot `'priors'`.
`priors`: | Prior parameter information. Calculated by the functions described in `getPriors`.
`posteriors`: | Estimated (log)-posterior likelihoods for each group (matrix). Calculated by the functions described in `getLikelihoods`.
`estProps`: | Estimated proportion of tags belonging to each group (numeric). Calculated by the functions described in `getLikelihoods`.
`nullPosts`: | If calculated, the posterior likelihoods for the data having no true expression of any kind.
`seglens`: | Lengths of segments containing the counts described in `data`. A matrix, but may be initialised with a vector, or ignored altogether. See Details.

### Details

The `seglens` slot describes, for each row of the `data` object, the length of the 'segment' that contains the number of counts described by that row. For example, if we are looking at the number of hits matching genes, the `seglens` object would consist of transcript lengths. Exceptionally, we may want to use different segment lengths for different samples and so the slot takes the form of a matrix. If the matrix has only one column, it is duplicated for all samples. Otherwise, it should have the same number of columns as the '@data' slot. If the slot is the empty matrix, then it is assumed that all segments have the same length.

### Methods

The standard methods 'new', 'dim', '[', 'show', 'rbind' and 'c' have been defined for these classes. The methods 'groups', 'groups<-', 'replicates', 'replicates<-', 'libsizes' and 'libsizes<-' have also been defined in order to access and modify these slots, and their use is recommended. The method 'flatten' can be used to produce a data.frame object containing much of the basic data in a member of this class.

### Author(s)

Thomas J. Hardcastle

### Examples

    #load test data
    data(simData)

    # Create a 'countData' object from test data.
    replicates <- c("simA", "simA", "simA", "simA", "simA", "simB", "simB", "simB", "simB", "simB")
    groups <- list(NDE = c(1,1,1,1,1,1,1,1,1,1), DE = c(1,1,1,1,1,2,2,2,2,2))
    CD <- new("countData", data = simData, replicates = replicates, groups = groups)

    #estimate library sizes for countData object
    libsizes(CD) <- getLibsizes(CD)

    CD[1:10,]
    dim(CD)

[Package baySeq version 2.26.0 Index]