Skip to content

Commit

Permalink
Adding test for distance matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
sneumann committed Aug 23, 2024
1 parent 254f35f commit 5b7f23b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file not shown.
12 changes: 12 additions & 0 deletions tests/testthat/test_dataprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ test_that("metaboliteProfileParsing works", {
expect_equal(min(result$dataFrameMeasurements[,1]), 0)

})

test_that("HCA works", {
load(system.file("extdata/testdata/calculateDistanceMatrix.Rdata", package = "MetFamily"))

result <- calculateDistanceMatrix(dataList=dataList,
filter=filter,
distanceMeasure = "Jaccard", progress = FALSE)
expect_equal(sum(result$distanceMatrix), 46522.7, tolerance = 0.005)
expect_equal(sum(result$filter), 294508)
expect_true(result$distanceMeasure == "Jaccard")

})

0 comments on commit 5b7f23b

Please sign in to comment.