swh:1:snp:0c004a03453a29b80f921a24433f7e780b9ceb53
Raw File
Tip revision: c6bb0e960554a23eb712690cbd7f8e3f7d79ca0d authored by Alexey Sergushichev on 02 July 2021, 13:19:49 UTC
Update js
Tip revision: c6bb0e9
testgct.R
context("GCT")

test_that("write.gct and read.gct work", {
    load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
    gctFile <- tempfile(fileext = ".gct")
    write.gct(es, gctFile)
    es2 <- read.gct(gctFile)
    expect_equal(dim(es2), dim(es))
})

test_that("write.gct and read.gct work for gzip files", {
    load(file = system.file("testdata/GSE27112-GPL6103.rda", package="phantasus"))
    gctFile <- tempfile(fileext = ".gct.gz")
    write.gct(es, gctFile, gzip = T)
    es2 <- read.gct(gctFile)
    expect_equal(dim(es2), dim(es))
})

test_that("read.gct works (simple version)", {
    es <- read.gct(system.file("testdata/test.gct", package="phantasus"))
    expect_equal(dim(exprs(es)), c(5, 7))
    expect_equal(colnames(es)[1], "s1")
    expect_equal(rownames(es)[1], "1415670_at")
    expect_true(all(c("Gene symbol", "Gene ID") %in% colnames(fData(es))), setdiff(c("Gene symbol", "Gene ID"), colnames(fData(es))))
    expect_true(all(c("condition") %in% colnames(pData(es))), setdiff(c("condition"), colnames(pData(es))))
})
back to top