testthat::context("Datasets after post-processing")
post_proc.mset <- phenomis::reading(LATMX2::post_processed_dir.c())
testthat::test_that("values", {
testthat::expect_equal(Biobase::exprs(post_proc.mset[["proteomics_liver"]])["Q8C196_Carbamoyl-phosphate synt.",
"W627m"],
32.1570347762747, tol = 1e-13)
testthat::expect_equal(Biobase::exprs(post_proc.mset[["proteomics_plasma"]])["P01027_Complement C3",
"W617f"],
32.4223086299966, tol = 1e-13)
})
testthat::test_that("dimensions", {
post_proc_dim.mn <- t(sapply(names(post_proc.mset),
function(set.c) dim(post_proc.mset[[set.c]])))
# paste(paste(rownames(post_proc_dim.mn),
# apply(post_proc_dim.mn, 1, function(x) paste(x, collapse = "|")),
# sep = "|"),
# collapse = "', '")
test_dim.vc <- c("clinics|213|42",
"proteomics_liver|2187|42",
"proteomics_plasma|446|36")
# test_dim.vc <- c('liv_met_annot_sac|99|42',
# 'liv_met_c18n_theix|519|42',
# 'liv_met_c18p_sac|8939|42',
# 'liv_met_c18p_theix|2060|42',
# 'liv_met_hiln_sac|3630|42',
# 'liv_prot_F|2187|22',
# 'liv_prot_M|2187|20',
# 'liv_prot_stra|2187|42',
# 'pheno_phenomin|213|42',
# 'plas_met_annot_sac|83|42',
# 'plas_met_c18n_theix|1920|42',
# 'plas_met_c18p_sac|9149|42',
# 'plas_met_c18p_theix|3276|42',
# 'plas_met_hiln_sac|3402|42',
# 'plas_prot_toul|446|36')
test_dim.mn <- sapply(test_dim.vc, function(x) unlist(strsplit(x, "|", fixed = TRUE))[c(2, 3)])
mode(test_dim.mn) <- "integer"
dimnames(test_dim.mn) <- list(c("Features", "Samples"),
sapply(test_dim.vc, function(x) unlist(strsplit(x, "|", fixed = TRUE))[1], USE.NAMES = FALSE))
test_dim.mn <- t(test_dim.mn)
testthat::expect_identical(post_proc_dim.mn,
test_dim.mn)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.