tests/testthat/test_null_prep.R

context("check null model prep")

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

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

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

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

Try the GENESIS package in your browser

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

GENESIS documentation built on Jan. 30, 2021, 2:01 a.m.