Skip to content

Commit

Permalink
more test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sheridar committed Oct 1, 2023
1 parent 4dc5a8d commit 7b4bbf4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/testthat/test-calc-diversity.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
df_1 <- vdj_sce@colData

df_2 <- vdj_sce@colData |>
as.data.frame() %>%
as_tibble(rownames = ".cell_id")

# Check all calc_diversity arguments
Expand Down Expand Up @@ -93,6 +94,7 @@ mets <- list(
nms <- paste0("cdr3_", names(mets), "_diversity")

test_div <- vdj_sce@colData |>
as.data.frame() |>
as_tibble(rownames = ".cell_id") |>
filter(!is.na(cdr3))

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-calc-frequency.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
df_1 <- vdj_sce@colData

df_2 <- vdj_sce@colData |>
as.data.frame() |>
as_tibble(rownames = ".cell_id")

# Check all calc_frequency arguments
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-calc-gene-usage.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
df_1 <- vdj_sce@colData

df_2 <- vdj_sce@colData |>
as.data.frame() |>
as_tibble(rownames = ".cell_id")

# Check all calc_gene_usage arguments
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-calc-similarity.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
df_1 <- vdj_sce@colData

df_2 <- vdj_sce@colData |>
as.data.frame() |>
as_tibble(rownames = ".cell_id")

test_clsts <- df_1 |>
Expand Down Expand Up @@ -34,6 +35,7 @@ test_all_args(
# Check similarity calculation
# calculate similarity independently and compare to calc_similarity results
test_sim <- vdj_sce@colData |>
as.data.frame() |>
as_tibble(rownames = ".cell_id") |>
filter(!is.na(cdr3)) |>
group_by(cdr3, seurat_clusters) |>
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ test_lvls_2 <- unique(test_so$sample) |>

df_1 <- vdj_sce@colData

df_2 <- vdj_sce@colData |>
df_2 <- df_1 |>
as.data.frame() |>
as_tibble(rownames = ".cell_id")

# Check all plot_features arguments except data_slot
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Test data
df_1 <- vdj_sce@colData

df_2 <- vdj_sce@colData |>
df_2 <- df_1 |>
as.data.frame() |>
as_tibble(rownames = ".cell_id")

# Check fetch_vdj arguments
Expand Down Expand Up @@ -30,7 +31,10 @@ test_that("fetch_vdj sep", {
sep = NULL
)

expect_identical(res, as_tibble(vdj_sce@colData, rownames = ".cell_id"))
expect_identical(
res,
as_tibble(as.data.frame(vdj_sce@colData), rownames = ".cell_id")
)

expect_warning(
res <- vdj_sce |>
Expand Down

0 comments on commit 7b4bbf4

Please sign in to comment.