https://github.com/ctlab/phantasus
Raw File
Tip revision: b2cf762bc10e284e0212751c8ea52f93b6fb34d8 authored by Vladislav Kamenev on 29 October 2018, 16:55:09 UTC
ARCHS4 is now subfolder in cache
Tip revision: b2cf762
testgseaPlot.R
context("GSEA plot")
library(jsonlite)
library(Biobase)

test_that("gseaPlot works", {
    load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))

    set.seed(42)
    fData(es)$t <- rnorm(nrow(es))

    f <- fromJSON(gseaPlot(es, rankBy = "t", selectedGenes = sample.int(nrow(es), 10),
             width=6, height=4))
    expect_true(file.exists(f))

    f <- fromJSON(gseaPlot(es, rankBy = "t", selectedGenes = sample.int(nrow(es), 10),
             width=6, height=4, vertical = TRUE))
    expect_true(file.exists(f))

    f <- fromJSON(gseaPlot(es, rankBy = "t", selectedGenes = sample.int(nrow(es), 10),
             width=6, height=4, vertical = TRUE,
             addHeatmap = TRUE, showAnnotation = "time"))
    expect_true(file.exists(f))

    f <- fromJSON(gseaPlot(es, rankBy = "t", selectedGenes = sample.int(nrow(es), 10),
             width=6, height=4, vertical = FALSE,
             addHeatmap = TRUE, showAnnotation = "time"))
    expect_true(file.exists(f))

    f <- fromJSON(gseaPlot(es, rankBy = "t", selectedGenes = sample.int(nrow(es), 10),
                           width=6, height=4, vertical = FALSE,
                           addHeatmap = TRUE))
    expect_true(file.exists(f))
})

back to top