tests/testthat/test_eNames_c.R

#devtools::uses_testthat()
library(TimiRGeN)
library(testthat)

#load gene_entrez
ID_names <- readRDS("gene_entrez_c.rds")

MAE <- MultiAssayExperiment()

metadata(MAE)[["ID_names"]] <- ID_names

#perform function
MAE <- eNames(MAE, method = 'c', gene_IDs = metadata(MAE)[[1]])

#internal checks
e <- lapply(ID_names, function(x){x[[4]]})

y <- lapply(e, function(x){ x[complete.cases(x)]})

#check 1
#manual output is the same as functional output
test_that("Output is as expects", {
    expect_equal(length(e_list_mouse), 5)
    expect_equal(length(y), 5)
})

metadata(MAE)[["ID_list"]] <- y

Try the TimiRGeN package in your browser

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

TimiRGeN documentation built on April 17, 2021, 6:03 p.m.