context("test-io")
APPDIR <- "../apps"
DATADIR <- "../data"
APP <- file.path(APPDIR, "working")
DATA <- file.path(DATADIR, "working_1")
test_that("Read input as a data frame", {
process <- fastgenomicsR::Process(app_dir=APP, data_dir=DATA)
genes <- read.table(process@input$genes)
cells <- read.table(process@input$cells)
exprs <- read.table(process@input$some_input)
expect_equal(colnames(cells), c("cell_id", "some_column", "batch_id"))
expect_equal(colnames(genes), c("gene_id", "entrez_id", "some_column"))
expect_equal(colnames(exprs), c("cell_id", "entrez_id", "expression"))
})
test_that("Read + write is a noop", {
process <- fastgenomicsR::Process(app_dir=APP, data_dir=DATA)
genes <- read.table(process@input$genes)
cells <- read.table(process@input$cells)
exprs <- read.table(process@input$some_input)
write.table(genes, process@output$genes)
write.table(cells, process@output$cells)
write.table(exprs, process@output$some_output)
expect_equal(readLines(process@input$genes@path), readLines(process@output$genes@path))
expect_equal(readLines(process@input$cells@path), readLines(process@output$cells@path))
expect_equal(readLines(process@input$some_input@path), readLines(process@output$some_output@path))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.