https://github.com/ctlab/phantasus
Raw File
Tip revision: 5bcaa1984bd17e1409b28344ec900233a21c5364 authored by Alexey Sergushichev on 13 November 2021, 18:46:20 UTC
bump version in js
Tip revision: 5bcaa19
testpcaPlot.R
context("PCA Plot")

test_that("pcaPlot finishes with result", {
  load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
  expect_is(calcPCA(es), "json")
})

test_that("pcaPlot results in columnsXcolumns matrix", {
  load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
  expect_equal(nrow(jsonlite::fromJSON(calcPCA(es))$pca),
                length(sampleNames(es)))
})

test_that("pcaPlot drops NA rows", {
    es <- read.gct(system.file("testdata/centers.gct", package="phantasus"))
    pca <- jsonlite::fromJSON(calcPCA(es))
    expect_equal(nrow(exprs(es)), 6)
    expect_equal(nrow(pca$pca), 5)
})
back to top