context('stratify_by_phenotype')
test_that("stratify_by_phenotype", {
# quick checks
ind = list(healthy = letters[3:12], unhealthy = letters[13:23])
ref = list(disease1 = data.table(sid = letters[1:23], value = runif(23)))
result = stratify_by_phenotype(ind, ref)
expect_true(all(c(letters[3:23]) %in% result$sid))
expect_true(all(!letters[c(1,2,25,26)] %in% result$sid))
})
test_that("complex merges", {
# quick checks
ind = list(healthy = letters[3:12], unhealthy = letters[13:23])
ref = list(disease1 = data.table(sid = letters[1:23], value = runif(23)),
disease2 = data.table(sid = letters[c(2,3,14)], value = rnorm(6)))
result = stratify_by_phenotype(ind, ref)
expect_true(all(table(result$trait) == c(21, 4)))
expect_true(all(table(result$group) == c(12, 13)))
expect_true(sum(table(result$sid)) == 25)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.