Skip to content

Commit

Permalink
Adding testthat functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ncborcherding committed Apr 2, 2024
1 parent e303efc commit 82c6314
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/test-CoNGAfy.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# test script for CoNGAfy.R - testcases are NOT comprehensive!

test_that("CoNGAfy works", {

data("ibex_example")


conga_reduction <- CoNGAfy(ibex_example)

expect_equal(
conga_reduction@meta.data,
getdata("CoNGAfy", "CoNGAfy_meta.data")
)

expect_equal(
conga_reduction@assays$RNA@layers$counts,
getdata("CoNGAfy", "CoNGAfy_counts"),
tolerance=1e-2
)
})
24 changes: 24 additions & 0 deletions tests/testthat/test-quietBCRgenes.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# test script for quietBCRgenes.R - testcases are NOT comprehensive!

test_that("quietBCRgenes works", {

data("ibex_example")

features <- rownames(ibex_example@assays$RNA$counts)

expect_equal(
quietBCRgenes(features),
getdata("quietBCRgenes", "quietBCRgenes_feature.vector")
)

ibex_example@assays$RNA@var.features <- features
Seurat::DefaultAssay(ibex_example) <- "RNA"

ibex_example <- quietBCRgenes(ibex_example)


expect_equal(
quietBCRgenes(features),
ibex_example@assays$RNA@var.features
)
})
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 82c6314

Please sign in to comment.