diff --git a/DESCRIPTION b/DESCRIPTION index 65233c9..67bbf19 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: lans2r Title: Work with Look at NanoSIMS Data in R Description: R interface for working with nanometer scale secondary ion mass spectrometry (NanoSIMS) data exported from Look at NanoSIMS. -Version: 1.0.1 +Version: 1.0.3 Authors@R: person("Sebastian", "Kopf", email = "sebastian.kopf@colorado.edu", role = c("aut", "cre")) URL: https://github.com/KopfLab/lans2r diff --git a/tests/testthat/test-load-data.R b/tests/testthat/test-load-data.R index 5847b52..36a5fb9 100644 --- a/tests/testthat/test-load-data.R +++ b/tests/testthat/test-load-data.R @@ -82,11 +82,10 @@ test_that("test that it is possible to load LANS maps", { base_dir = folder, quiet = T)) # check data - expect_equal({ - pixels <- maps %>% select(analysis, frame_size.px, variable) %>% unique() %>% - group_by(analysis) %>% summarize(n = unique(frame_size.px)^2 * length(variable)) - sum(pixels$n) - }, nrow(maps)) + expect_equal(nrow(maps), as.integer(256^2 * 4 * 3)) + # pixels <- maps %>% select(analysis, frame_size.px, variable) %>% unique() %>% + # group_by(analysis) %>% summarize(n = unique(frame_size.px)^2 * length(variable)) + # as.integer(sum(pixels$n)) expect_equal(maps$variable %>% unique(), c("12C", "13C", "14N12C", "15N12C")) expect_equal(maps %>% names(), diff --git a/tests/testthat/test-read-files.R b/tests/testthat/test-read-files.R index 06a13c6..44181ef 100644 --- a/tests/testthat/test-read-files.R +++ b/tests/testthat/test-read-files.R @@ -60,7 +60,8 @@ test_that("test that it is possible to read full ion data file", { c("x.px", "y.px", "frame_size.px", "x.um", "y.um", "frame_size.um", "variable", "data_type", "value", "sigma", "ROI")) - expect_equal(data$frame_size.px[1]^2 %>% as.integer(), data %>% nrow()) + expect_equal(data %>% nrow(), as.integer(256^2)) + #as.integer(data$frame_size.px[1]*data$frame_size.px[1]) expect_equal(data$value[3], 1508) # spot check expect_equal(data$variable[3], "12C") # spot check @@ -80,7 +81,8 @@ test_that("test that it is possible to read all map data in a folder", { # data checks expect_equal(data$variable %>% unique(), c("12C", "13C", "14N12C", "15N12C")) - expect_equal(as.integer(data$frame_size.px[1]^2 * length(data$variable %>% unique())), data %>% nrow()) + expect_equal(data %>% nrow(), as.integer(256^2 * 4)) + #as.integer(data$frame_size.px[1] * data$frame_size.px[1] * length(unique(data$variable))) expect_equal(data %>% names(), c("x.px", "y.px", "frame_size.px", "x.um", "y.um", "frame_size.um", "variable", "data_type", "value", "sigma", "ROI")) expect_equal(data$value[nrow(data)], 4) # spot check