glmDataSet {MethylIT}R Documentation

Data set constructor for class glmDataSet

Description

This function is used to build a object suitable to be used with Methyl-IT link{countTest2} function.

Usage

glmDataSet(GR = NULL, counts = NULL, colData = NULL)

Arguments

GR

A GRanges object with the count matrix of DMPs in the metacolumns (see 'counts'). If provided, then leave paramater 'counts = NULL'.

counts

Count matrix of DMPs with minimal dimmensions 1 (row) x 4 (columns). Column names must corresponds to the rownames from parameter 'colData'.

colData

A data frame with one columnn named 'condition', which must be a factor with exactly two levels. The rownames of colData individual samples. The row names of colData must correspond to th column names of the count matrix.

Details

Data set constructor for class glmDataSet also validate the object

Examples

set.seed(133) # Set a seed
## A GRanges object with the count matrix in the metacolumns is created
countData <- matrix(sample.int(200, 500, replace = TRUE), ncol = 4)
colnames(countData) <- c("A1","A2","B1","B2")
start <- seq(1, 25e4, 2000)
end <- start + 1000
chr <- c(rep("chr1", 70), rep("chr2", 55))
GR <- GRanges(seqnames = chr, IRanges(start = start, end = end))
mcols(GR) <- countData
## Gene IDs
names(GR) <- paste0("gene", 1:length(GR))

## An experiment design is set.
colData <- data.frame(condition = factor(c("A","A","B","B")),
                      c("A1","A2","B1","B2"),
                      row.names = 2)
## A RangedGlmDataSet is created
ds <- glmDataSet(GR = GR, colData = colData)


[Package MethylIT version 0.3.1 ]