tests/testthat/test_null_prep.R

context("check null model prep")

test_that("nullModelTestPrep", {
    n <- 100
    dat <- .testNullInputs(n)
    geno <- .testGenoMatrix(n)
    
    # basic
    nullmod <- fitNullMod(dat$y, dat$X, verbose=FALSE)
    Xtilde <- calcXtilde(nullmod, geno)

    expect_equal(dim(Xtilde), c(n, ncol(geno)))
    expect_equal(dim(nullmod$Ytilde), dim(dat$y))

    # with covMatList
    nullmod <- fitNullMod(dat$y, dat$X, dat$cor.mat, verbose=FALSE)
    Xtilde <- calcXtilde(nullmod, geno)

    expect_equal(dim(Xtilde), c(n, ncol(geno)))
    expect_equal(dim(nullmod$Ytilde), dim(dat$y))
})
UW-GAC/genesis2_tests documentation built on May 9, 2019, 9:57 p.m.