makeTimeSeriesExperimentFromSummarizedExperiment: TimeSeriesExperiment constructor from SummarizedExperiment

Description Usage Arguments Details Value Examples

View source: R/TimeSeriesExperiment-class.R

Description

TimeSeriesExperiment constructor initializes the object from SummarizedExperiment::SummarizedExperiment and populates the time, replicate, and group slots.

Usage

1
2
3
4
5
6

Arguments

se

SummarizedExperiment::SummarizedExperiment object

timepoint

a vector indicating timepoint at which each sample was collected or a character string equal to one of the column names of a supplied SummarizedExperiment.

group

a vector indicating a group membership for each sample or a character string equal to one of the column names of a supplied SummarizedExperiment If not specified, the group is set to 'G1' for each sample.

replicate

a vector indicating a replicate id of each sample or a character string equal to one of the column names of a supplied SummarizedExperiment If not specified, the replicate is set to 'R1' for each sample.

Details

TimeSeriesExperiment is an extension of SummarizedExperiment class.

Value

Returns an initialized TimeSeriesExperiment object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
raw <- matrix(runif(3000), ncol = 30)
pheno.data <- data.frame(
   time = rep(rep(1:5, each = 3), 2),
   replicate = rep(1:3, 10),
   group = rep(1:2, each = 15))
feature.data <- data.frame(
   feature = paste0("F", 1:100)
)
test_sumexp <- SummarizedExperiment::SummarizedExperiment(
   assays = list(counts = raw),
   rowData = feature.data, colData = pheno.data)
test_TimeSeriesExperiment <- 
makeTimeSeriesExperimentFromSummarizedExperiment(
   test_sumexp, timepoint = "time", group = "group",
   replicate = "replicate")
test_TimeSeriesExperiment

nlhuong/TimeSeriesExperiment documentation built on Sept. 8, 2021, 12:30 a.m.