tests/testthat/test-GetIsotopeDistribution.R

testthat::test_that(
  desc = "GetIsotopeDistribution works", 
  code = {
    inp <- "C12H40O2S2Si3"
    out <- InterpretMSSpectrum:::GetIsotopeDistribution(fml = inp)
    testthat::expect_true(is.matrix(out))
    testthat::expect_length(out, 6)
    testthat::expect_equal(unname(out[2,]), c(0.6528, 0.1945, 0.1527))
    
    out2 <- InterpretMSSpectrum:::GetIsotopeDistribution(fml = inp, res=100000)
    testthat::expect_equal(unname(out2[2,]), c(0.7206000, 0.1316000, 0.1478000))
  }
)

Try the InterpretMSSpectrum package in your browser

Any scripts or data that you put into this service are public.

InterpretMSSpectrum documentation built on May 29, 2024, 10:18 a.m.