From 866f0ba9c94b4b41b92bf061755a7245a2e55705 Mon Sep 17 00:00:00 2001 From: Hannah A Pliner Date: Thu, 17 Oct 2019 11:19:40 +0100 Subject: [PATCH] Fix tests after tfidf bug --- tests/testthat/test-get_training_sample.R | 2 +- tests/testthat/test-overall.R | 36 +++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/testthat/test-get_training_sample.R b/tests/testthat/test-get_training_sample.R index 9fd737d..d1faed3 100644 --- a/tests/testthat/test-get_training_sample.R +++ b/tests/testthat/test-get_training_sample.R @@ -43,5 +43,5 @@ test_classifier <- train_cell_classifier(cds = test_cds, test_that("get_training_sample follows rules", { expect_equal( igraph::V(test_classifier@classification_tree)[1]$model[[1]]$glmnet.fit$nobs, - 297) + 298) }) diff --git a/tests/testthat/test-overall.R b/tests/testthat/test-overall.R index dc5d2f4..e986eb7 100644 --- a/tests/testthat/test-overall.R +++ b/tests/testthat/test-overall.R @@ -19,13 +19,13 @@ test_cds <- garnett::classify_cells(test_cds, test_classifier, cds_gene_id_type = "SYMBOL") test_that("whole process is the same", { - expect_equal(sum(colData(test_cds)$cell_type == "B cells"), 213) - expect_equal(sum(colData(test_cds)$cell_type == "CD4 T cells"), 102) - expect_equal(sum(colData(test_cds)$cell_type == "CD8 T cells"), 59) - expect_equal(sum(colData(test_cds)$cell_type == "T cells"), 126) - expect_equal(sum(colData(test_cds)$cluster_ext_type == "B cells"), 403) + expect_equal(sum(colData(test_cds)$cell_type == "B cells"), 201) + expect_equal(sum(colData(test_cds)$cell_type == "CD4 T cells"), 80) + expect_equal(sum(colData(test_cds)$cell_type == "CD8 T cells"), 50) + expect_equal(sum(colData(test_cds)$cell_type == "T cells"), 103) + expect_equal(sum(colData(test_cds)$cluster_ext_type == "B cells"), 402) expect_equal(sum(colData(test_cds)$cluster_ext_type == "CD4 T cells"), 205) - expect_equal(sum(colData(test_cds)$cluster_ext_type == "T cells"), 192) + expect_equal(sum(colData(test_cds)$cluster_ext_type == "T cells"), 193) }) @@ -79,13 +79,13 @@ test_cds <- garnett::classify_cells(test_cds, test_classifier, cds_gene_id_type = "SYMBOL") test_that("whole process is the same multi-core", { - expect_equal(sum(colData(test_cds)$cell_type == "B cells"), 213) - expect_equal(sum(colData(test_cds)$cell_type == "CD4 T cells"), 102) - expect_equal(sum(colData(test_cds)$cell_type == "CD8 T cells"), 59) - expect_equal(sum(colData(test_cds)$cell_type == "T cells"), 126) - expect_equal(sum(colData(test_cds)$cluster_ext_type == "B cells"), 403) + expect_equal(sum(colData(test_cds)$cell_type == "B cells"), 201) + expect_equal(sum(colData(test_cds)$cell_type == "CD4 T cells"), 80) + expect_equal(sum(colData(test_cds)$cell_type == "CD8 T cells"), 50) + expect_equal(sum(colData(test_cds)$cell_type == "T cells"), 103) + expect_equal(sum(colData(test_cds)$cluster_ext_type == "B cells"), 402) expect_equal(sum(colData(test_cds)$cluster_ext_type == "CD4 T cells"), 205) - expect_equal(sum(colData(test_cds)$cluster_ext_type == "T cells"), 192) + expect_equal(sum(colData(test_cds)$cluster_ext_type == "T cells"), 193) }) data(test_cds) @@ -106,12 +106,12 @@ test_cds <- garnett::classify_cells(test_cds, test_classifier, cds_gene_id_type = "SYMBOL") test_that("whole process is the same db = 'none'", { - expect_equal(sum(colData(test_cds)$cell_type == "B cells"), 202) - expect_equal(sum(colData(test_cds)$cell_type == "CD4 T cells"), 71) - expect_equal(sum(colData(test_cds)$cell_type == "CD8 T cells"), 44) - expect_equal(sum(colData(test_cds)$cell_type == "T cells"), 110) - expect_equal(sum(colData(test_cds)$cluster_ext_type == "B cells"), 403) + expect_equal(sum(colData(test_cds)$cell_type == "B cells"), 205) + expect_equal(sum(colData(test_cds)$cell_type == "CD4 T cells"), 66) + expect_equal(sum(colData(test_cds)$cell_type == "CD8 T cells"), 48) + expect_equal(sum(colData(test_cds)$cell_type == "T cells"), 106) + expect_equal(sum(colData(test_cds)$cluster_ext_type == "B cells"), 402) expect_equal(sum(colData(test_cds)$cluster_ext_type == "CD4 T cells"), 205) - expect_equal(sum(colData(test_cds)$cluster_ext_type == "T cells"), 192) + expect_equal(sum(colData(test_cds)$cluster_ext_type == "T cells"), 193) })