tests/testthat/test_utils_ms1.R

test_that("Matching of mz values works", {
  
  # read MS1 data
  gda_cluster <- readGda(system.file("extdata/20191108_Pesticides_test_Cluster.gda",
                                     package = "genedataRutils"))
  
  gda_peaks <- readGda(system.file("extdata/20191108_Pesticides_test_Peaks.gda",
                                   package = "genedataRutils"))
  
  spectra <- reconstructIsoPattern(gda_peaks, gda_cluster)
  
  # perform tests
  expect_equal(length(spectra), 16)
  expect_equal(unique(spectra$CLUSTER_ID), c("Cluster_0311", "Cluster_0331", "Cluster_0444", "Cluster_0615"))
  
})
michaelwitting/genedataRutils documentation built on April 30, 2021, 5:11 p.m.