tests/testthat/test-lmWrapper-glm.R

obj <- new('GLMlike', design=colData(fd), formula=~Stim.Condition)
obj <- fit(obj, response=assay(fd)[2,])
objD <- glm(obj@response>0 ~ Stim.Condition, data=obj@design, family='binomial')
objC <- glm(obj@response ~ Stim.Condition, data=obj@design, subset=obj@response>0)
context('GLMlike')
source('common-lmWrapper-tests.R', local=TRUE)

context('GLM construction')


test_that('Design is invariant to updates', {
        obj2 <- update(obj, ~ Stim.Condition+ncells)
        expect_true(length(obj2@fitC)==0)
        expect_equivalent(obj2@design, obj@design)
        expect_true(length(setdiff(colnames(obj@modelMatrix), colnames(obj2@modelMatrix)))==0)
        expect_true(length(setdiff(colnames(obj2@modelMatrix), colnames(obj@modelMatrix)))==1)
})

source('common-lmWrapper-glm-tests.R', local=TRUE)

Try the MAST package in your browser

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

MAST documentation built on Nov. 8, 2020, 8:19 p.m.