tests/testthat/test_is_coherent.R

library(martini)

suffledMap <- minigwas$map[sample(1:nrow(minigwas$map)), ]
shuffledGenotypes <- minigwas$genotypes[, suffledMap$snp.names]

test_that("we get errors when we should", {
  
  expect_true(is_coherent(minigwas))
  expect_error(is_coherent(list(map = suffledMap,
                                genotypes = minigwas$genotypes,
                                fam = minigwas$fam)),
               "map is not ordered by genomic position.")
  expect_error(is_coherent(list(map = minigwas$map,
                                genotypes = shuffledGenotypes,
                                fam = minigwas$fam)),
               "map and genotype SNP order differ.")
  
})

Try the martini package in your browser

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

martini documentation built on Nov. 8, 2020, 5:39 p.m.