tests/testthat/test-excludeProblematicCells.R

## Cover both `excludeContaminatedCells` and `excludeProblematicCells`.

test_that("excludeProblematicCells", {
    for (var in c("contaminated", "problematic")) {
        object <- cello
        colName <- camelCase(paste("is", var))
        funName <- camelCase(paste("exclude", var, "cells"))
        fun <- get(funName)
        vals <- Rle(c(TRUE, rep(FALSE, nrow(object) - 1L)))
        object[colName] <- vals
        object2 <- fun(object)
        expect_identical(
            object = nrow(object) - nrow(object2),
            expected = 1L
        )
    }
})
acidgenomics/Cellosaurus documentation built on March 15, 2024, 1:28 a.m.