TCA: TCA class and constructor

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Classes.R

Description

TCA is a S4 class for storing input data, results of differential binding and clustering analysis. A TCA object can be created by the constructor function from a table of sample information, a table genomic coordinates of features, read counts(optional).

Usage

1
2
3

Arguments

design

a data frame containing information about samples/libraries, For time course analysis, design should contain at least three columns (case insensitive): sampleid, timepoint and group providing time point and group information of each sample/library. If counts is not provided when creating TCA object, the column BAMfile can be included in the design data frame, providing corresponding BAM filename of each sample/library, this information can be used for generating count table by using countReads function.

counts

an integer matrix containing read counts. Rows correspond to genomic features and columns to samples/libraries.

genomicFeature

a data frame or a GRanges object containing genomic coordinates of features of interest (e.g. genes in RNA-seq, binding regions in ChIP-seq). If genomicFeature is a data frame, four columns are required in genomicFeature: id, chr, start, end; if genomicFeature is a Granges object, the metadata column "id" is required. For TCAFromSummarizedExperiment, genomicFeature must be provided if se is a SummarizedExperiment object.

zero.based

Logical. If TRUE, the start positions of the genomic ranges in the returned TCA object are 0-based, if FALSE, the start positions will be 1-based.

se

A SummarizedExperiment or a RangedSummarizedExperiment object. The object might contain multiple assays (count table) in the assay list, only the first one will be taken to construct TCA object. For SummarizedExperiment object, genomicFeature must be provided while for RangedSummarizedExperiment object, the genomic features will be extracted directly from the object.

Details

A TCA object can be created without providing read counts, read counts can be provided by counts or generated by countReads, the number of rows should equal to that in genomicFeature and the number of columns should equal to number of rows in design. Input data and analysis results in a TCA object can be accessed by using corresponding accessors and functions. The TCA objects also have a show method printing a compact summary of their contents see counts, TCA.accessors, DBresult, tcTable, timeclust. clust

Value

A TCA object

Author(s)

Mengjun Wu

Mengjun Wu

See Also

counts, TCA.accessors, DBresult, timeclust, clust

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#create data frame of experiment design: 4 time points and 2 replicates for each time point.
d <- data.frame(sampleID = 1:8, group = rep(c(1, 2, 3, 4), 2),
               timepoint = rep(c('0h', '24h', '48h', '72h'), 2))


#create data frame of genomic intervals of interest
gf <- data.frame(chr = c(rep('chr1', 3), rep('chr2', 2), rep('chr4', 2)),
                start = seq(100, 2000, by = 300),
                end = seq(100, 2000, by = 300) + 150,
                id = paste0('peak', 1:7))
tca <- TCA(design = d, genomicFeature = gf)
genomicFeature(tca)

#if count table is available
c <- matrix(sample(1000, 56), nrow = 7, dimnames = list(paste0('peak', 1:7), 1:8))
tca <- TCA(design = d, counts = c, genomicFeature = gf)
# replace the count table of a \code{TCA} object
c2 <- matrix(sample(500, 56), nrow = 7, dimnames = list(paste0('peak', 1:7), 1:8))
counts(tca) <- c2

TCseq documentation built on Nov. 8, 2020, 5:46 p.m.