tests/testthat/test-Normalize_Scale.R

context("Test normalizing and scaling a Tomo object.")

library(SummarizedExperiment)
data(zh.data)
zh <- createTomo(zh.data, normalize=FALSE, scale=FALSE)

test_that("normalize",
          {
            zh_normalized <- normalizeTomo(zh)
            expect_is(zh_normalized, 'SummarizedExperiment')
            expect_equal(assayNames(zh_normalized), c('count', 'normalized'))
          })

test_that("scale",
          {
            zh_normalized <- normalizeTomo(zh)
            zh_scale <- scaleTomo(zh_normalized)
            expect_is(zh_scale, 'SummarizedExperiment')
            expect_equal(assayNames(zh_scale), c('count', 'normalized', 'scaled'))
          })

test_that("scale without normalization",
          {
            expect_identical(scaleTomo(zh), zh)
          })

Try the tomoda package in your browser

Any scripts or data that you put into this service are public.

tomoda documentation built on Nov. 8, 2020, 8:10 p.m.