Skip to content

Commit

Permalink
Fix tests after tfidf bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hpliner committed Oct 17, 2019
1 parent 0c1efdb commit 866f0ba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-get_training_sample.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
36 changes: 18 additions & 18 deletions tests/testthat/test-overall.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})


Expand Down Expand Up @@ -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)
Expand All @@ -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)
})

0 comments on commit 866f0ba

Please sign in to comment.