computeStat: Compute a test statistic based on smoothed whole-genome...

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

View source: R/BSmooth.fstat.R

Description

Compute a test statistic based on smoothed whole-genome bisulfite sequencing data.

Usage

1

Arguments

BSseqStat

An object of class BSseqStat, typically an object returned by smoothSds(...) and not constructed by the user.

coef

A vector indicating for which coefficients the statistic is to be computed (coef = NULL corresponds to testing all coefficients). If the length of the coef is 1 then the corresponding t-statistic is computed, otherwise the corresponding F-statistic is computed.

Details

TODO

Value

An object of class BSseqStat. More speciically, the input BSseqStat object with the computed statistics added to the stats slot (accessible with getStats).

Author(s)

Kasper Daniel Hansen [email protected]

See Also

smoothSds for the function to create the appropriate BSseqStat input object. BSseqStat also describes the return class. This function is likely to be followed by the use of dmrFinder.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
  
    if(require(bsseqData)) {
        data(keepLoci.ex)
        data(BS.cancer.ex.fit)
        BS.cancer.ex.fit <- updateObject(BS.cancer.ex.fit)
        ## Remember to subset the BSseq object, see vignette for explanation
        ## TODO: Kind of a forced example
        design <- model.matrix(~0 + BS.cancer.ex.fit$Type)
        colnames(design) <- gsub("BS\\.cancer\\.ex\\.fit\\$Type", "",
                                 colnames(design))
        contrasts <- makeContrasts(
            cancer_vs_normal = cancer - normal,
            levels = design
        )
        BS.stat <- BSmooth.fstat(BS.cancer.ex.fit[keepLoci.ex,],
                                  design,
                                  contrasts)
        BS.stat <- smoothSds(BS.stat)
        BS.stat <- computeStat(BS.stat)
        BS.stat
    }
  

kasperdanielhansen/bsseq documentation built on Nov. 4, 2018, 11:51 p.m.