https://github.com/ctlab/phantasus
Tip revision: d5d3a2a453d193538955965af54d20d0c8b9f72c authored by Alexey Sergushichev on 02 February 2019, 13:32:57 UTC
version bump + fixes for biocheck warnings
version bump + fixes for biocheck warnings
Tip revision: d5d3a2a
testlimmaAnalysis.R
context("Limma Analysis")
test_that("limmaAnalysis finishes with result", {
load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
expect_is(limmaAnalysis(es,
fieldValues = c(rep("A", 3), rep("B", 2))), "json")
})
test_that("limmaAnalysis works when there is only one phenotype attribute", {
load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
pData(es) <- pData(es)[, "title", drop=F]
expect_is(limmaAnalysis(es,
fieldValues = c(rep("A", 3), rep("B", 2))), "json")
})
test_that("limmaAnalysisImpl works", {
load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
de <- limmaAnalysisImpl(es, rows=seq_len(nrow(es)), columns=seq_len(ncol(es)),
fieldValues = c(rep("A", 2), rep("B", 2), NA))
expect_equal(de$logFC[1], mean(exprs(es)[1, 3:4]) - mean(exprs(es)[1, 1:2]))
})
test_that("limmaAnalysisImpl works for subsamples", {
load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
de1 <- limmaAnalysisImpl(es, rows=seq_len(nrow(es)), columns=seq_len(ncol(es)),
fieldValues = c(rep("A", 2), NA, rep("B", 2)))
de2 <- limmaAnalysisImpl(es, rows=seq_len(nrow(es)), columns=c(1:2, 4:5),
fieldValues = c(rep("A", 2), rep("B", 2)))
expect_equal(de1$t, de2$t)
})