Learn R Programming

bsseq (version 1.8.2)

BSseq: The constructor function for BSseq objects.

Description

The constructor function for BSseq objects.

Usage

BSseq(M = NULL, Cov = NULL, coef = NULL, se.coef = NULL, trans = NULL, parameters = NULL, pData = NULL, gr = NULL, pos = NULL, chr = NULL, sampleNames = NULL, rmZeroCov = FALSE)

Arguments

M
A matrix of methylation evidence.
Cov
A matrix of coverage.
coef
Smoothing estimates.
se.coef
Smoothing standard errors.
trans
A smoothing transformation.
parameters
A list of smoothing parameters.
pData
An data.frame or DataFrame.
sampleNames
A vector of sample names.
gr
An object of type GRanges.
pos
A vector of locations.
chr
A vector of chromosomes.
rmZeroCov
Should genomic locations with zero coverage in all samples be removed.

Value

An object of class BSseq.

Details

Genomic locations are specified either through gr or through chr and pos but not both. There should be the same number of genomic locations as there are rows in the M and Cov matrix.

The argument rmZeroCov may be useful in order to reduce the size of the return object be removing methylation loci with zero coverage.

In case one or more methylation loci appears multiple times, the M and Cov matrices are summed over rows linked to the same methylation loci. See the example below.

Users should never have to specify coef, se.coef, trans, and parameters, this is for internal use (they are added by BSmooth).

phenoData is a way to specify pheno data (as known from the ExpressionSet and eSet classes), at a minimum sampleNames should be given (if they are not present, the function uses col.names(M)).

See Also

BSseq

Examples

Run this code
  M <- matrix(0:8, 3, 3)
  Cov <- matrix(1:9, 3, 3)
  BS1 <- BSseq(chr = c("chr1", "chr2", "chr1"), pos = c(1,2,3),
               M = M, Cov = Cov, sampleNames = c("A","B", "C"))
  BS1
  BS2 <- BSseq(chr = c("chr1", "chr1", "chr1"), pos = c(1,1,1),
               M = M, Cov = Cov, sampleNames = c("A","B", "C"))
  BS2

Run the code above in your browser using DataLab