inst/unitTests/test_quantro.R

test_quantro <- function() {
    library(minfi)
    data(flowSorted)
  
    ## Test 1: Using matrix object and groupFactor
    p <- getBeta(flowSorted, offset = 100)
    pd <- pData(flowSorted)
    qtest <- quantro(object = p, groupFactor = pd$CellType)
    checkEqualsNumeric(quantroStat(qtest), 8.807, tolerance=1.0e-4)

    ## Test 2: Using MethylSet object and groupFactor
    qtest <- quantro(object = flowSorted, groupFactor = pd$CellType)
    checkEqualsNumeric(quantroStat(qtest), 8.807, tolerance=1.0e-4)

    ## Test 3: Using MethylSet object, but with parallelization feature
    if(require(doParallel)){
        registerDoParallel(cores = 4)
        
        pd <- pData(flowSorted)
        qtest <- quantro(flowSorted, pd$CellType, B = 100)
        checkEqualsNumeric(quantroStat(qtest), 8.807, tolerance=1.0e-4)
    }
}

Try the quantro package in your browser

Any scripts or data that you put into this service are public.

quantro documentation built on Nov. 8, 2020, 8:28 p.m.