From d529933dc90c3c5a24005e4789c82a5e07447923 Mon Sep 17 00:00:00 2001 From: JulienBoehm <180776296+JulienBoehm@users.noreply.github.com> Date: Wed, 22 Apr 2026 13:46:45 +0200 Subject: [PATCH 1/6] updated read_junior_pam --- README.md | 13 +- src/R/read_pam_data.R | 72 +++----- src/R/validation.R | 4 +- .../junior_pam_data/2026_04_22_junior_pam.csv | 20 +++ .../junior_pam_data/junior_pam_20250613.csv | 20 --- src/man/read_junior_pam_data.Rd | 2 +- .../testthat/data/2026_04_22_junior_pam.csv | 20 +++ .../testthat/data/junior_pam_20250613.csv | 20 --- .../test-eilers_peeters_junior_pam_etr_II.R | 79 --------- .../testthat/test-read_junior_pam_data.R | 166 +++++++++--------- texport_junior_pam.png | Bin 0 -> 42974 bytes 11 files changed, 161 insertions(+), 255 deletions(-) create mode 100644 src/inst/extdata/junior_pam_data/2026_04_22_junior_pam.csv delete mode 100644 src/inst/extdata/junior_pam_data/junior_pam_20250613.csv create mode 100644 src/tests/testthat/data/2026_04_22_junior_pam.csv delete mode 100644 src/tests/testthat/data/junior_pam_20250613.csv delete mode 100644 src/tests/testthat/test-eilers_peeters_junior_pam_etr_II.R create mode 100644 texport_junior_pam.png diff --git a/README.md b/README.md index 02e37fc..f15e965 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ The function processes the provided CSV file by: - Combining the `Date` and `Time` columns to create a `DateTime` column and ordering the data chronologically. - Calculating initial ETR values from `Pm.-Det.` and `Fm-Det.` rows using `calc_etr()`. - Iterating through all rows with `Action == "P.+F. SP"` to calculate ETR values for both `Y.I.` and `Y.II.` -- Optionally stopping at the recovery period if `remove_recovery = TRUE`. +- Stopping at the recovery period if `remove_recovery = TRUE`. #### Return @@ -179,7 +179,7 @@ The function processes the provided CSV file by: - Combining the `Date` and `Time` columns to create a `DateTime` column and ordering the data chronologically. - Extracting the initial Pm.-Det. measurement at `PAR = 0` to calculate the first ETR value. - Iterating through all rows with `Action == "P700 SP"` to calculate ETR values for Photosystem I (`Y.I.`). -- Optionally stopping at the recovery period if `remove_recovery = TRUE`. +- Stopping at the recovery period if `remove_recovery = TRUE`. #### Return @@ -236,7 +236,7 @@ The function processes the provided CSV file by: - Combining the `Date` and `Time` columns to create a `DateTime` column and ordering the data chronologically. - Extracting the initial **Fm-Det.** measurement at `PAR = 0` to calculate the first ETR value. - Iterating through all rows with `Action == "Fluo. SP"` to calculate ETR values for Photosystem II (`Y.II.`). -- Optionally stopping at the recovery period if `remove_recovery = TRUE`. +- Stopping at the recovery period if `remove_recovery = TRUE`. #### Return @@ -292,9 +292,12 @@ The function processes the provided CSV file by: - Validating the raw Junior-PAM data with `validate_junior_pam_data()`. - Renaming columns to standard names (`PAR`, `Y.II`.) if necessary. - Filtering rows where Type equals `"FO"` or `"F"`. -- Converting and ordering the `DateTime` column. +- Ordering by `Time (rel/ms)` column. - Iterating through all rows to calculate ETR values for `Y.II.` using `calc_etr()`. -- Optionally stopping at the recovery period if `remove_recovery = TRUE`. +- Stopping at the recovery period if `remove_recovery = TRUE`. + +To ensure the file is imported correctly, please export the CSV file using the default settings: +![Plot](texport_junior_pam.png) #### Return diff --git a/src/R/read_pam_data.R b/src/R/read_pam_data.R index 5b76d2c..189b901 100644 --- a/src/R/read_pam_data.R +++ b/src/R/read_pam_data.R @@ -111,12 +111,11 @@ read_universal_data <- function(csv_path, #' data <- read_dual_pam_data(path) #' @export read_dual_pam_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -249,12 +248,11 @@ read_dual_pam_data <- function( #' data <- read_dual_pam_single_channel_p700_data(path) #' @export read_dual_pam_single_channel_p700_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -380,12 +378,11 @@ read_dual_pam_single_channel_p700_data <- function( #' data <- read_dual_pam_single_channel_fluo_data(path) #' @export read_dual_pam_single_channel_fluo_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -532,17 +529,16 @@ calc_etr <- function(yield, par, etr_factor, p_ratio) { #' @examples #' path <- file.path( #' system.file("extdata/junior_pam_data", package = "pam"), -#' "junior_pam_20250613.csv" +#' "2026_04_22_junior_pam.csv" #' ) #' data <- read_junior_pam_data(path) #' @export read_junior_pam_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -565,20 +561,7 @@ read_junior_pam_data <- function( } data <- data[data$Type == "FO" | data$Type == "F", ] - data$Datetime <- as.POSIXct(data$Datetime, format = "%Y-%m-%d %H:%M:%OS", tz = "GMT") - - date_time_col_values <- c() - for (i in seq_len(nrow(data))) { - row <- data[i, ] - - date_time_row_value <- as.POSIXct( - paste(row$Date, row$Time, sep = " "), - tz = "GMT", "%d.%m.%y %H:%M:%S" - ) - date_time_col_values <- c(date_time_col_values, date_time_row_value) - } - data$DateTime <- date_time_col_values - data <- data[order(data$Datetime), ] + data <- data[order(data$"Time..rel.ms."), ] result <- data.table::data.table( par = numeric(), @@ -657,12 +640,11 @@ read_junior_pam_data <- function( #' data <- read_pam_2500_data(path) #' @export read_pam_2500_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } diff --git a/src/R/validation.R b/src/R/validation.R index 85a7639..69d5d40 100644 --- a/src/R/validation.R +++ b/src/R/validation.R @@ -217,8 +217,8 @@ validate_junior_pam_data <- function(data) { stop("required col 'Y..II.' not found") } - if (!"Datetime" %in% colnames(data)) { - stop("required col 'Datetime' not found") + if (!"Time..rel.ms." %in% colnames(data)) { + stop("required col 'Time (rel/ms)' not found") } } diff --git a/src/inst/extdata/junior_pam_data/2026_04_22_junior_pam.csv b/src/inst/extdata/junior_pam_data/2026_04_22_junior_pam.csv new file mode 100644 index 0000000..3f4f810 --- /dev/null +++ b/src/inst/extdata/junior_pam_data/2026_04_22_junior_pam.csv @@ -0,0 +1,20 @@ +26-04-22;10:44:04.000;WinControl (rev1255) report file +Time (rel/ms);Type;No.;2:F;2:Fm';2:PAR;2:Y (II);2:ETR +0;D;;Device Nr: #2, JUNIOR-PAM-III (CFMG0711B); +0;SLCS;;Light Curve start; +0;REG1;;#2: alpha: - , ETRm: - , Ik: - ( beta: - 0.001, ETRmPot: 76.798 ) (Platt et al. 1980); +0;REG2;;#2: alpha: 0.188, ETRm: 77.953, Ik: 414.611 (Jassby and Platt 1976); +1393;FO;1;130;506;0;0.743;0 +51389;F;2;278;489;50;0.431;9.1 +101375;F;3;317;472;90;0.328;12.4 +151366;F;4;211;342;130;0.383;20.9 +201357;F;5;178;304;180;0.414;31.3 +251347;F;6;164;284;250;0.423;44.4 +301335;F;7;159;248;380;0.359;57.3 +351325;F;8;148;210;570;0.295;70.6 +401305;F;9;144;183;840;0.213;75.1 +451323;F;10;140;164;1250;0.146;76.7 +501306;F;11;135;150;1640;0.1;68.9 +551299;F;12;131;143;2300;0.084;81.1 +601286;F;13;127;136;3000;0.066;83.2 +605163;SLCE;;Light Curve end; diff --git a/src/inst/extdata/junior_pam_data/junior_pam_20250613.csv b/src/inst/extdata/junior_pam_data/junior_pam_20250613.csv deleted file mode 100644 index 94e369e..0000000 --- a/src/inst/extdata/junior_pam_data/junior_pam_20250613.csv +++ /dev/null @@ -1,20 +0,0 @@ -25-06-13;10:50:28.000;WinControl (rev1242) report file -Datetime;Time (abs/ms);Time (rel/ms);Type;No.;1:F;1:Fm';1:PAR;1:Y (II);1:ETR -;0;D;;Device Nr: #1, JUNIOR-PAM-III (CFMG0710B); -2025-06-13 10:38:54.217;1749803934217;0;SLCS;;Light Curve start; -2025-06-13 10:38:54.217;1749803934217;0;REG1;;#1: alpha: 0.303, ETRm: 59.733, Ik: 197.268 ( beta: 0.001, ETRmPot: 61.486 ) (Platt et al. 1980); -2025-06-13 10:38:54.217;1749803934217;0;REG2;;#1: alpha: 0.238, ETRm: 58.397, Ik: 245.332 (Jassby and Platt 1976); -2025-06-13 10:38:55.603;1.7498e+012;1386;FO;1;124;584;0;0.788;0 -2025-06-13 10:39:35.598;1.7498e+012;41381;F;2;207;549;50;0.623;13.1 -2025-06-13 10:40:15.588;1.7498e+012;81371;F;3;207;512;90;0.596;22.5 -2025-06-13 10:40:55.576;1.7498e+012;121359;F;4;214;472;130;0.547;29.9 -2025-06-13 10:41:35.555;1.7498e+012;161338;F;5;204;396;180;0.485;36.7 -2025-06-13 10:42:15.549;1.7498e+012;201332;F;6;198;336;250;0.411;43.2 -2025-06-13 10:42:55.538;1.7498e+012;241321;F;7;196;286;380;0.315;50.3 -2025-06-13 10:43:35.534;1.7498e+012;281317;F;8;193;252;570;0.234;56 -2025-06-13 10:44:15.514;1.7498e+012;321297;F;9;189;226;840;0.164;57.9 -2025-06-13 10:44:55.507;1.7498e+012;361290;F;10;185;209;1250;0.115;60.4 -2025-06-13 10:45:35.495;1.7498e+012;401278;F;11;178;196;1640;0.092;63.4 -2025-06-13 10:46:15.491;1.7498e+012;441274;F;12;174;185;2300;0.059;57 -2025-06-13 10:46:55.496;1.7498e+012;481279;F;13;168;176;3000;0.045;56.7 -2025-06-13 10:46:58.974;1749804418974;484757;SLCE;;Light Curve end; diff --git a/src/man/read_junior_pam_data.Rd b/src/man/read_junior_pam_data.Rd index 180872a..f233dff 100644 --- a/src/man/read_junior_pam_data.Rd +++ b/src/man/read_junior_pam_data.Rd @@ -45,7 +45,7 @@ A detailed documentation can be found under \url{https://github.com/biotoolbox/p \examples{ path <- file.path( system.file("extdata/junior_pam_data", package = "pam"), - "junior_pam_20250613.csv" + "2026_04_22_junior_pam.csv" ) data <- read_junior_pam_data(path) } diff --git a/src/tests/testthat/data/2026_04_22_junior_pam.csv b/src/tests/testthat/data/2026_04_22_junior_pam.csv new file mode 100644 index 0000000..3f4f810 --- /dev/null +++ b/src/tests/testthat/data/2026_04_22_junior_pam.csv @@ -0,0 +1,20 @@ +26-04-22;10:44:04.000;WinControl (rev1255) report file +Time (rel/ms);Type;No.;2:F;2:Fm';2:PAR;2:Y (II);2:ETR +0;D;;Device Nr: #2, JUNIOR-PAM-III (CFMG0711B); +0;SLCS;;Light Curve start; +0;REG1;;#2: alpha: - , ETRm: - , Ik: - ( beta: - 0.001, ETRmPot: 76.798 ) (Platt et al. 1980); +0;REG2;;#2: alpha: 0.188, ETRm: 77.953, Ik: 414.611 (Jassby and Platt 1976); +1393;FO;1;130;506;0;0.743;0 +51389;F;2;278;489;50;0.431;9.1 +101375;F;3;317;472;90;0.328;12.4 +151366;F;4;211;342;130;0.383;20.9 +201357;F;5;178;304;180;0.414;31.3 +251347;F;6;164;284;250;0.423;44.4 +301335;F;7;159;248;380;0.359;57.3 +351325;F;8;148;210;570;0.295;70.6 +401305;F;9;144;183;840;0.213;75.1 +451323;F;10;140;164;1250;0.146;76.7 +501306;F;11;135;150;1640;0.1;68.9 +551299;F;12;131;143;2300;0.084;81.1 +601286;F;13;127;136;3000;0.066;83.2 +605163;SLCE;;Light Curve end; diff --git a/src/tests/testthat/data/junior_pam_20250613.csv b/src/tests/testthat/data/junior_pam_20250613.csv deleted file mode 100644 index 94e369e..0000000 --- a/src/tests/testthat/data/junior_pam_20250613.csv +++ /dev/null @@ -1,20 +0,0 @@ -25-06-13;10:50:28.000;WinControl (rev1242) report file -Datetime;Time (abs/ms);Time (rel/ms);Type;No.;1:F;1:Fm';1:PAR;1:Y (II);1:ETR -;0;D;;Device Nr: #1, JUNIOR-PAM-III (CFMG0710B); -2025-06-13 10:38:54.217;1749803934217;0;SLCS;;Light Curve start; -2025-06-13 10:38:54.217;1749803934217;0;REG1;;#1: alpha: 0.303, ETRm: 59.733, Ik: 197.268 ( beta: 0.001, ETRmPot: 61.486 ) (Platt et al. 1980); -2025-06-13 10:38:54.217;1749803934217;0;REG2;;#1: alpha: 0.238, ETRm: 58.397, Ik: 245.332 (Jassby and Platt 1976); -2025-06-13 10:38:55.603;1.7498e+012;1386;FO;1;124;584;0;0.788;0 -2025-06-13 10:39:35.598;1.7498e+012;41381;F;2;207;549;50;0.623;13.1 -2025-06-13 10:40:15.588;1.7498e+012;81371;F;3;207;512;90;0.596;22.5 -2025-06-13 10:40:55.576;1.7498e+012;121359;F;4;214;472;130;0.547;29.9 -2025-06-13 10:41:35.555;1.7498e+012;161338;F;5;204;396;180;0.485;36.7 -2025-06-13 10:42:15.549;1.7498e+012;201332;F;6;198;336;250;0.411;43.2 -2025-06-13 10:42:55.538;1.7498e+012;241321;F;7;196;286;380;0.315;50.3 -2025-06-13 10:43:35.534;1.7498e+012;281317;F;8;193;252;570;0.234;56 -2025-06-13 10:44:15.514;1.7498e+012;321297;F;9;189;226;840;0.164;57.9 -2025-06-13 10:44:55.507;1.7498e+012;361290;F;10;185;209;1250;0.115;60.4 -2025-06-13 10:45:35.495;1.7498e+012;401278;F;11;178;196;1640;0.092;63.4 -2025-06-13 10:46:15.491;1.7498e+012;441274;F;12;174;185;2300;0.059;57 -2025-06-13 10:46:55.496;1.7498e+012;481279;F;13;168;176;3000;0.045;56.7 -2025-06-13 10:46:58.974;1749804418974;484757;SLCE;;Light Curve end; diff --git a/src/tests/testthat/test-eilers_peeters_junior_pam_etr_II.R b/src/tests/testthat/test-eilers_peeters_junior_pam_etr_II.R deleted file mode 100644 index f5143e8..0000000 --- a/src/tests/testthat/test-eilers_peeters_junior_pam_etr_II.R +++ /dev/null @@ -1,79 +0,0 @@ -test_that("test-eilers_peeters_etr_II junior_pam_20250613.csv.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) - - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") - data <- read_junior_pam_data(test_data_file) - model_result <- eilers_peeters_generate_regression_ETR_II(data) - - expect_equal(model_result[["residual_sum_of_squares"]], 18.5975058) - # expect_equal(model_result[["a"]], 0.000001594) - expect_equal(model_result[["b"]], 0.01213671) - expect_equal(model_result[["c"]], 2.77837046) - expect_equal(model_result[["pm"]], 61.1793644) - expect_equal(model_result[["s"]], 0.35992320) - expect_equal(model_result[["ik"]], 169.978939) - expect_equal(model_result[["im"]], 1320.307821) - expect_equal(model_result[["w"]], 5.7674788) -}) - -test_that("test-eilers_peeters_etr_II junior_pam_20250613.csv.csv", { - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") - data <- read_junior_pam_data(test_data_file) - model_result <- eilers_peeters_generate_regression_ETR_II(data) - expect_no_error(validate_model_result(model_result)) -}) - -test_that("test-eilers_peeters_etr_II modified junior_pam_20250613.csv.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") - data <- read_junior_pam_data(test_data_file) - model_result <- eilers_peeters_generate_regression_ETR_II(data) - model_result <- eilers_peeters_modified(model_result) - - expect_equal(model_result[["residual_sum_of_squares"]], 18.5975058) - # expect_equal(model_result[["a"]], 0.000001594) - expect_equal(model_result[["b"]], 0.01213671) - expect_equal(model_result[["c"]], 2.77837046) - expect_equal(model_result[["d"]], NA_real_) - expect_equal(model_result[["alpha"]], 0.35992320) - expect_equal(model_result[["beta"]], NA_real_) - expect_equal(model_result[["etrmax_with_photoinhibition"]], 61.1793644) - expect_equal(model_result[["etrmax_without_photoinhibition"]], NA_real_) - expect_equal(model_result[["ik_with_photoinhibition"]], 169.978939) - expect_equal(model_result[["ik_without_photoinhibition"]], NA_real_) - expect_equal(model_result[["im_with_photoinhibition"]], 1320.307821) - expect_equal(model_result[["w"]], 5.7674788) - expect_equal(model_result[["ib"]], NA_real_) - expect_equal(model_result[["etrmax_without_with_ratio"]], NA_real_) -}) - -test_that("test-eilers_peeters_etr_II modified junior_pam_20250613.csv.csv", { - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") - data <- read_junior_pam_data(test_data_file) - - model_result <- eilers_peeters_generate_regression_ETR_II(data) - expect_no_error(validate_model_result(model_result)) - - model_result <- eilers_peeters_modified(model_result) - expect_no_error(validate_modified_model_result(model_result)) -}) - -test_that("test-eilers_peeters_etr_II modified control plot junior_pam_20250613.csv", { - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") - data <- read_junior_pam_data(test_data_file) - model_result <- eilers_peeters_generate_regression_ETR_II(data) - model_result <- model_result <- eilers_peeters_modified(model_result) - - plot <- plot_control( - data, - model_result, - "eilers_peeters ETR II modified junior_pam_20250613.csv", - color_eilers_peeters - ) - expect_s3_class(plot, "ggplot") - expect_gt(length(plot$layers), 0) - - out <- file.path("results", "test-eilers_peeters_etr_II modified control plot junior_pam_20250613.jpg") - ggplot2::ggsave(out, create.dir = TRUE, plot = plot, units = "px", width = 1000, height = 1000, dpi = 100, limitsize = FALSE) - expect_true(file.exists(out)) -}) diff --git a/src/tests/testthat/test-read_junior_pam_data.R b/src/tests/testthat/test-read_junior_pam_data.R index 8290928..30c8982 100644 --- a/src/tests/testthat/test-read_junior_pam_data.R +++ b/src/tests/testthat/test-read_junior_pam_data.R @@ -1,5 +1,5 @@ -test_that("read_junior_pam_data junior_pam_20250613.csv - default", { - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") +test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - default", { + test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") data <- read_junior_pam_data(test_data_file) par <- data$par @@ -33,19 +33,19 @@ test_that("read_junior_pam_data junior_pam_20250613.csv - default", { expect_equal(yield_1[13], NA_real_) yield_2 <- data$yield_2 - expect_equal(yield_2[1], 0.788) - expect_equal(yield_2[2], 0.623) - expect_equal(yield_2[3], 0.596) - expect_equal(yield_2[4], 0.547) - expect_equal(yield_2[5], 0.485) - expect_equal(yield_2[6], 0.411) - expect_equal(yield_2[7], 0.315) - expect_equal(yield_2[8], 0.234) - expect_equal(yield_2[9], 0.164) - expect_equal(yield_2[10], 0.115) - expect_equal(yield_2[11], 0.092) - expect_equal(yield_2[12], 0.059) - expect_equal(yield_2[13], 0.045) + expect_equal(yield_2[1], 0.743) + expect_equal(yield_2[2], 0.4310) + expect_equal(yield_2[3], 0.3280) + expect_equal(yield_2[4], 0.3830) + expect_equal(yield_2[5], 0.414) + expect_equal(yield_2[6], 0.423) + expect_equal(yield_2[7], 0.359) + expect_equal(yield_2[8], 0.295) + expect_equal(yield_2[9], 0.213) + expect_equal(yield_2[10], 0.146) + expect_equal(yield_2[11], 0.1000) + expect_equal(yield_2[12], 0.084) + expect_equal(yield_2[13], 0.066) etr_1 <- data$etr_1 expect_equal(etr_1[1], NA_real_) @@ -64,22 +64,22 @@ test_that("read_junior_pam_data junior_pam_20250613.csv - default", { etr_2 <- data$etr_2 expect_equal(etr_2[1], 0) - expect_equal(etr_2[2], 13.083) - expect_equal(etr_2[3], 22.5288) - expect_equal(etr_2[4], 29.8662) - expect_equal(etr_2[5], 36.666) - expect_equal(etr_2[6], 43.155) - expect_equal(etr_2[7], 50.274) - expect_equal(etr_2[8], 56.0196) - expect_equal(etr_2[9], 57.8592) - expect_equal(etr_2[10], 60.375) - expect_equal(etr_2[11], 63.3696) - expect_equal(etr_2[12], 56.994) - expect_equal(etr_2[13], 56.7) + expect_equal(etr_2[2], 9.0510) + expect_equal(etr_2[3], 12.3984) + expect_equal(etr_2[4], 20.9118) + expect_equal(etr_2[5], 31.2984) + expect_equal(etr_2[6], 44.4150) + expect_equal(etr_2[7], 57.2964) + expect_equal(etr_2[8], 70.6230) + expect_equal(etr_2[9], 75.1464) + expect_equal(etr_2[10], 76.6500) + expect_equal(etr_2[11], 68.8800) + expect_equal(etr_2[12], 81.1440) + expect_equal(etr_2[13], 83.1600) }) -test_that("read_junior_pam_data junior_pam_20250613.csv - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") +test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - etr_factor 0.5", { + test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") data <- read_junior_pam_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -113,19 +113,19 @@ test_that("read_junior_pam_data junior_pam_20250613.csv - etr_factor 0.5", { expect_equal(yield_1[13], NA_real_) yield_2 <- data$yield_2 - expect_equal(yield_2[1], 0.788) - expect_equal(yield_2[2], 0.623) - expect_equal(yield_2[3], 0.596) - expect_equal(yield_2[4], 0.547) - expect_equal(yield_2[5], 0.485) - expect_equal(yield_2[6], 0.411) - expect_equal(yield_2[7], 0.315) - expect_equal(yield_2[8], 0.234) - expect_equal(yield_2[9], 0.164) - expect_equal(yield_2[10], 0.115) - expect_equal(yield_2[11], 0.092) - expect_equal(yield_2[12], 0.059) - expect_equal(yield_2[13], 0.045) + expect_equal(yield_2[1], 0.743) + expect_equal(yield_2[2], 0.4310) + expect_equal(yield_2[3], 0.3280) + expect_equal(yield_2[4], 0.3830) + expect_equal(yield_2[5], 0.414) + expect_equal(yield_2[6], 0.423) + expect_equal(yield_2[7], 0.359) + expect_equal(yield_2[8], 0.295) + expect_equal(yield_2[9], 0.213) + expect_equal(yield_2[10], 0.146) + expect_equal(yield_2[11], 0.1000) + expect_equal(yield_2[12], 0.084) + expect_equal(yield_2[13], 0.066) etr_1 <- data$etr_1 expect_equal(etr_1[1], NA_real_) @@ -144,27 +144,27 @@ test_that("read_junior_pam_data junior_pam_20250613.csv - etr_factor 0.5", { etr_2 <- data$etr_2 expect_equal(etr_2[1], 0) - expect_equal(etr_2[2], 7.7875) - expect_equal(etr_2[3], 13.41) - expect_equal(etr_2[4], 17.7775) - expect_equal(etr_2[5], 21.825) - expect_equal(etr_2[6], 25.6875) - expect_equal(etr_2[7], 29.925) - expect_equal(etr_2[8], 33.345) - expect_equal(etr_2[9], 34.44) - expect_equal(etr_2[10], 35.9375) - expect_equal(etr_2[11], 37.72) - expect_equal(etr_2[12], 33.925) - expect_equal(etr_2[13], 33.75) + expect_equal(etr_2[2], 5.3875) + expect_equal(etr_2[3], 7.3800) + expect_equal(etr_2[4], 12.4475) + expect_equal(etr_2[5], 18.6300) + expect_equal(etr_2[6], 26.4375) + expect_equal(etr_2[7], 34.1050) + expect_equal(etr_2[8], 42.0375) + expect_equal(etr_2[9], 44.7300) + expect_equal(etr_2[10], 45.6250) + expect_equal(etr_2[11], 41.0000) + expect_equal(etr_2[12], 48.3000) + expect_equal(etr_2[13], 49.5000) }) -test_that("read_junior_pam_data junior_pam_20250613.csv - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") +test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - fraction_photosystem > 1", { + test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") expect_error(read_junior_pam_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) -test_that("read_junior_pam_data junior_pam_20250613.csv - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "junior_pam_20250613.csv") +test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { + test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") data <- read_junior_pam_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par @@ -198,19 +198,19 @@ test_that("read_junior_pam_data junior_pam_20250613.csv - fraction_photosystem_I expect_equal(yield_1[13], NA_real_) yield_2 <- data$yield_2 - expect_equal(yield_2[1], 0.788) - expect_equal(yield_2[2], 0.623) - expect_equal(yield_2[3], 0.596) - expect_equal(yield_2[4], 0.547) - expect_equal(yield_2[5], 0.485) - expect_equal(yield_2[6], 0.411) - expect_equal(yield_2[7], 0.315) - expect_equal(yield_2[8], 0.234) - expect_equal(yield_2[9], 0.164) - expect_equal(yield_2[10], 0.115) - expect_equal(yield_2[11], 0.092) - expect_equal(yield_2[12], 0.059) - expect_equal(yield_2[13], 0.045) + expect_equal(yield_2[1], 0.743) + expect_equal(yield_2[2], 0.4310) + expect_equal(yield_2[3], 0.3280) + expect_equal(yield_2[4], 0.3830) + expect_equal(yield_2[5], 0.414) + expect_equal(yield_2[6], 0.423) + expect_equal(yield_2[7], 0.359) + expect_equal(yield_2[8], 0.295) + expect_equal(yield_2[9], 0.213) + expect_equal(yield_2[10], 0.146) + expect_equal(yield_2[11], 0.1000) + expect_equal(yield_2[12], 0.084) + expect_equal(yield_2[13], 0.066) etr_1 <- data$etr_1 expect_equal(etr_1[1], NA_real_) @@ -229,16 +229,16 @@ test_that("read_junior_pam_data junior_pam_20250613.csv - fraction_photosystem_I etr_2 <- data$etr_2 expect_equal(etr_2[1], 0) - expect_equal(etr_2[2], 20.9328) - expect_equal(etr_2[3], 36.04608) - expect_equal(etr_2[4], 47.78592) - expect_equal(etr_2[5], 58.6656) - expect_equal(etr_2[6], 69.048) - expect_equal(etr_2[7], 80.4384) - expect_equal(etr_2[8], 89.63136) - expect_equal(etr_2[9], 92.57472) - expect_equal(etr_2[10], 96.6) - expect_equal(etr_2[11], 101.39136) - expect_equal(etr_2[12], 91.1904) - expect_equal(etr_2[13], 90.72) + expect_equal(etr_2[2], 14.48160) + expect_equal(etr_2[3], 19.83744) + expect_equal(etr_2[4], 33.45888) + expect_equal(etr_2[5], 50.07744) + expect_equal(etr_2[6], 71.06400) + expect_equal(etr_2[7], 91.67424) + expect_equal(etr_2[8], 112.99680) + expect_equal(etr_2[9], 120.23424) + expect_equal(etr_2[10], 122.64000) + expect_equal(etr_2[11], 110.20800) + expect_equal(etr_2[12], 129.83040) + expect_equal(etr_2[13], 133.05600) }) diff --git a/texport_junior_pam.png b/texport_junior_pam.png new file mode 100644 index 0000000000000000000000000000000000000000..28ffa71140da507f6820eb6217cc9043b7d03e5e GIT binary patch literal 42974 zcmd42cRZVK|2`bmRwthhwdp{WqH5LFYPGi7Gqh?%gldf1S}iR_Yj28ByLOGBRZ=Ul zW2=$`5i25go-2Ca_v`+Cf4}FS=dZ_$SLDi-^E$6{9Pi^e-tX(ZzV5@br#Mf6K%lc4 zkM0|QK#Xx9(2=ea$AKfE$vsoR3j^HX;XP0(ntK6wbJX#!&Rr0wJo@zBlVia9lg}TS z!$F`+0`xxy4FmpF5GWt6asRH-OYqWuP?Du%0D;!5c(i}!VK%#4knQsekr!4_-=!XN z^tp6|UgA$p4?NY%7SN0sy>vIReU|v+-P^URi~>iU%e`(qbt=hKEm}4XG`<{a^n z+P9_~8%#rAHB0YoQaoKm27gxh4J8Y0gQluZlJ{r1A?P|!{&YBh&m&0;%5$N9X?KDu zN3Dy_&7n@Hpf72NtgpUiYg9G0_KYvBUld0EJ|^DFYHIbF#s4>>yw_4v6pzAiH#M5J z6}?lCxpTvGwEAnsA9L6l{Sg@!OXk*S=xI>uc!H>9H^0keJ3Bjv^T%D1lnpU{Q)G`e zR@3=Tk+MN8@cMb{0LqZ>0Xb7#Zc$D~CQo$wVArioD)3@yaq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#epyDSPKTuh7YW5S0UiFM ze{Orf@7aYz<;Dr8N7T4Yn+lPa5b{pyDE|bygz3kanK{jakg)-{EXj}z_T6eRCP<#V z(;F(ixJx2==f<7N>*n0ddb_e&_##E(cgjxY+v4S}x^@!72zBb4Y?hVm>d2@%MZWs| zA$7=Dh=p$JwqLiB2Sq+y{$s}XEX$5VrRyG8qILHqQgnh$SlN2x`6ZN`^ z`EwpAza4<|j(`#Bq|Vh_h*w>uR9`eixVqk^?>|`%5dV`I#>l#I-n?^In_AqDO|~uw z@kUgdVZsA{IYJXwhUb#a>c`gI-Al-Bb>GMNnnK<-=~BPv+F=@LUgso%=+*%o#{RC} zYp1KhE|+P7barphj?rH#q+_oxh$F*ABlL7V@A{SI4>1G($|N_t74Jt&!*i!)igqpI zs+U$}=!41G89kHG<75yaJ@zG!ys@~gFB@Lh4Tj%a z)8e%qW}OgfC!SzcEnCXxk+3k%)udl}4Yh69-4cD&?LbZ?E0+05%=YM1Z$B|Ty_Fd) zc%XSSA$G%j%4%&~$ecz>YOK-wo?#s@FzD*OwjkhW;Pf(-2^?od2`~Ffi#L@!*2s#= z(_cULOz}@76wVq^I1=E~cQg`uKVZVK1zS%77kr5!9-S?!2YdJ{=#iLo`*v@l{{!2D z2UjmJiz9l|$y!m4haeOWxE=4lY|98H5=xC1k}xUl6-$YEA&Xu-+fOiW;KQKbM~sm)}&z~j^w z1nKDxEiNwF8W|5Asd^{V7!p)0< ztV%O%?bM%Pls%F4>nU996!lC!7h9dmQ@5?pDi*?qy;?d|%y9~RKgFqzE! e*0iseyvJ!N*ZRx)GRlu-aa+gm22R`l>AwKi*UC=- literal 0 HcmV?d00001 From 159883df93b2accfe3d2d962b756cb67f736ad39 Mon Sep 17 00:00:00 2001 From: JulienBoehm <180776296+JulienBoehm@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:22:34 +0200 Subject: [PATCH 2/6] updated test data set for read_pam_2500_data --- src/R/read_pam_data.R | 4 +- .../extdata/pam_2500_data/20260311_1(2).CSV | 18 -- .../pam_2500_data/20260422_pam_2500.CSV | 18 ++ src/man/read_pam_2500_data.Rd | 2 +- .../testthat/data/20260311_1(2)_pam_2500.CSV | 18 -- src/tests/testthat/data/20260422_pam_2500.CSV | 18 ++ src/tests/testthat/test-read_pam_2500_data.R | 216 ++++++++---------- 7 files changed, 132 insertions(+), 162 deletions(-) delete mode 100644 src/inst/extdata/pam_2500_data/20260311_1(2).CSV create mode 100644 src/inst/extdata/pam_2500_data/20260422_pam_2500.CSV delete mode 100644 src/tests/testthat/data/20260311_1(2)_pam_2500.CSV create mode 100644 src/tests/testthat/data/20260422_pam_2500.CSV diff --git a/src/R/read_pam_data.R b/src/R/read_pam_data.R index 189b901..f284218 100644 --- a/src/R/read_pam_data.R +++ b/src/R/read_pam_data.R @@ -636,7 +636,7 @@ read_junior_pam_data <- function( #' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} #' } #' @examples -#' path <- file.path(system.file("extdata/pam_2500_data", package = "pam"), "20260311_1(2).CSV") +#' path <- file.path(system.file("extdata/pam_2500_data", package = "pam"), "20260422_pam_2500.CSV") #' data <- read_pam_2500_data(path) #' @export read_pam_2500_data <- function( @@ -701,7 +701,7 @@ read_pam_2500_data <- function( last_par <- current_par } - + print(result) return(result) }, warning = function(w) { diff --git a/src/inst/extdata/pam_2500_data/20260311_1(2).CSV b/src/inst/extdata/pam_2500_data/20260311_1(2).CSV deleted file mode 100644 index 6868c88..0000000 --- a/src/inst/extdata/pam_2500_data/20260311_1(2).CSV +++ /dev/null @@ -1,18 +0,0 @@ - -"t";"Date";"Time";"No.";"ML";"Temp.";"PAR";"F";"Fo'";"Fm'";"~Fo'";"Y(II)";"Y(NPQ)";"Y(NO)";"NPQ";"qN";"qP";"qL";"ETR";"Y4S";""; - 2;11.03.26;14:16:47;Type: LC - 4;11.03.26;14:16:48;default_60.par - 2;11.03.26;14:16:47;;1; 0.0;0;0.166;Fo: 0.166;Fm: 0.744 - 2;11.03.26;14:16:47;1;1; 0.0;0; 0.166; 0.000; 0.744; 0.166;0.777;0.000;0.223;0.000;0.000;1.000;1.000; 0.0;0.777 - 12;11.03.26;14:16:57;2;1; 0.0;5; 0.208; 0.194; 0.708; 0.164;0.706;0.014;0.280;0.051;0.111;0.973;0.907; 1.5;0.706 - 42;11.03.26;14:17:27;3;1; 0.0;9; 0.238; 0.184; 0.474; 0.147;0.498;0.182;0.320;0.570;0.498;0.814;0.629; 1.9;0.498 - 72;11.03.26;14:17:57;4;1; 0.0;34; 0.246; 0.180; 0.423; 0.142;0.418;0.251;0.331;0.759;0.580;0.728;0.533; 6.0;0.418 - 102;11.03.26;14:18:27;5;1; 0.0;67; 0.259; 0.174; 0.412; 0.141;0.371;0.281;0.348;0.806;0.588;0.643;0.432; 10.5;0.371 - 132;11.03.26;14:18:57;6;1; 0.0;104; 0.270; 0.168; 0.397; 0.139;0.320;0.317;0.363;0.874;0.604;0.555;0.345; 14.0;0.320 - 162;11.03.26;14:19:27;7;1; 0.0;144; 0.277; 0.177; 0.383; 0.137;0.277;0.351;0.372;0.943;0.644;0.515;0.329; 16.7;0.277 - 192;11.03.26;14:19:57;8;1; 0.0;201; 0.285; 0.172; 0.371; 0.136;0.232;0.385;0.383;1.005;0.656;0.432;0.261; 19.6;0.232 - 222;11.03.26;14:20:27;9;1; 0.0;274; 0.294; 0.169; 0.361; 0.134;0.186;0.419;0.395;1.061;0.668;0.349;0.201; 21.4;0.186 - 252;11.03.26;14:20:57;10;1; 0.0;366; 0.299; 0.171; 0.351; 0.133;0.148;0.450;0.402;1.120;0.689;0.289;0.165; 22.8;0.148 - 282;11.03.26;14:21:27;11;1; 0.0;477; 0.303; 0.170; 0.344; 0.132;0.119;0.474;0.407;1.163;0.699;0.236;0.132; 23.9;0.119 - 312;11.03.26;14:21:57;12;1; 0.0;622; 0.304; 0.169; 0.337; 0.131;0.098;0.493;0.409;1.208;0.709;0.196;0.109; 25.6;0.098 - 329;11.03.26;14:22:14;File: L_260311_141645.PWS diff --git a/src/inst/extdata/pam_2500_data/20260422_pam_2500.CSV b/src/inst/extdata/pam_2500_data/20260422_pam_2500.CSV new file mode 100644 index 0000000..663240e --- /dev/null +++ b/src/inst/extdata/pam_2500_data/20260422_pam_2500.CSV @@ -0,0 +1,18 @@ + +"t";"Date";"Time";"No.";"ML";"Temp.";"PAR";"F";"Fo'";"Fm'";"~Fo'";"Y(II)";"Y(NPQ)";"Y(NO)";"NPQ";"qN";"qP";"qL";"ETR";""; + 12;22.04.26;11:20:13;Type: LC + 14;22.04.26;11:20:14;default_60.par + 12;22.04.26;11:20:13;;2; 0.0;0;0.389;Fo: 0.389;Fm: 1.960 + 12;22.04.26;11:20:13;1;2; 0.0;0; 0.389; 0.000; 1.960; 0.389;0.802;0.000;0.198;0.000;0.000;1.000;1.000; 0.0 + 42;22.04.26;11:20:43;2;2; 0.0;7; 0.921; 0.000; 1.726; 0.379;0.466;0.064;0.470;0.136;0.142;0.598;0.246; 1.4 + 72;22.04.26;11:21:13;3;2; 0.0;36; 0.783; 0.000; 1.379; 0.359;0.432;0.168;0.399;0.421;0.351;0.584;0.268; 6.5 + 102;22.04.26;11:21:43;4;2; 0.0;106; 0.644; 0.000; 1.082; 0.335;0.405;0.267;0.329;0.811;0.525;0.586;0.305; 18.0 + 132;22.04.26;11:22:13;5;2; 0.0;203; 0.595; 0.000; 0.899; 0.315;0.338;0.358;0.304;1.180;0.628;0.521;0.276; 28.8 + 162;22.04.26;11:22:43;6;2; 0.0;368; 0.584; 0.000; 0.780; 0.299;0.251;0.451;0.298;1.513;0.694;0.408;0.209; 38.8 + 192;22.04.26;11:23:13;7;2; 0.0;624; 0.585; 0.000; 0.712; 0.289;0.178;0.523;0.298;1.753;0.730;0.300;0.148; 46.7 + 222;22.04.26;11:23:43;8;2; 0.0;986; 0.588; 0.000; 0.673; 0.282;0.126;0.574;0.300;1.912;0.751;0.217;0.104; 52.3 + 252;22.04.26;11:24:13;9;2; 0.0;1391; 0.588; 0.000; 0.651; 0.278;0.097;0.603;0.300;2.011;0.763;0.169;0.080; 56.5 + 282;22.04.26;11:24:43;10;2; 0.0;2020; 0.592; 0.000; 0.636; 0.275;0.069;0.629;0.302;2.082;0.770;0.122;0.057; 58.7 + 312;22.04.26;11:25:13;11;2; 0.0;7; 0.449; 0.000; 1.011; 0.328;0.556;0.215;0.229;0.939;0.565;0.823;0.601; 1.6 + 342;22.04.26;11:25:43;12;2; 0.0;69; 0.507; 0.000; 1.065; 0.333;0.524;0.217;0.259;0.840;0.534;0.763;0.502; 15.2 + 355;22.04.26;11:25:55;File: L_260422_112001.PWS diff --git a/src/man/read_pam_2500_data.Rd b/src/man/read_pam_2500_data.Rd index 7199f92..5fdd444 100644 --- a/src/man/read_pam_2500_data.Rd +++ b/src/man/read_pam_2500_data.Rd @@ -43,7 +43,7 @@ Calculates ETR II using: A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file} } \examples{ -path <- file.path(system.file("extdata/pam_2500_data", package = "pam"), "20260311_1(2).CSV") +path <- file.path(system.file("extdata/pam_2500_data", package = "pam"), "20260422_pam_2500.CSV") data <- read_pam_2500_data(path) } \references{ diff --git a/src/tests/testthat/data/20260311_1(2)_pam_2500.CSV b/src/tests/testthat/data/20260311_1(2)_pam_2500.CSV deleted file mode 100644 index 6868c88..0000000 --- a/src/tests/testthat/data/20260311_1(2)_pam_2500.CSV +++ /dev/null @@ -1,18 +0,0 @@ - -"t";"Date";"Time";"No.";"ML";"Temp.";"PAR";"F";"Fo'";"Fm'";"~Fo'";"Y(II)";"Y(NPQ)";"Y(NO)";"NPQ";"qN";"qP";"qL";"ETR";"Y4S";""; - 2;11.03.26;14:16:47;Type: LC - 4;11.03.26;14:16:48;default_60.par - 2;11.03.26;14:16:47;;1; 0.0;0;0.166;Fo: 0.166;Fm: 0.744 - 2;11.03.26;14:16:47;1;1; 0.0;0; 0.166; 0.000; 0.744; 0.166;0.777;0.000;0.223;0.000;0.000;1.000;1.000; 0.0;0.777 - 12;11.03.26;14:16:57;2;1; 0.0;5; 0.208; 0.194; 0.708; 0.164;0.706;0.014;0.280;0.051;0.111;0.973;0.907; 1.5;0.706 - 42;11.03.26;14:17:27;3;1; 0.0;9; 0.238; 0.184; 0.474; 0.147;0.498;0.182;0.320;0.570;0.498;0.814;0.629; 1.9;0.498 - 72;11.03.26;14:17:57;4;1; 0.0;34; 0.246; 0.180; 0.423; 0.142;0.418;0.251;0.331;0.759;0.580;0.728;0.533; 6.0;0.418 - 102;11.03.26;14:18:27;5;1; 0.0;67; 0.259; 0.174; 0.412; 0.141;0.371;0.281;0.348;0.806;0.588;0.643;0.432; 10.5;0.371 - 132;11.03.26;14:18:57;6;1; 0.0;104; 0.270; 0.168; 0.397; 0.139;0.320;0.317;0.363;0.874;0.604;0.555;0.345; 14.0;0.320 - 162;11.03.26;14:19:27;7;1; 0.0;144; 0.277; 0.177; 0.383; 0.137;0.277;0.351;0.372;0.943;0.644;0.515;0.329; 16.7;0.277 - 192;11.03.26;14:19:57;8;1; 0.0;201; 0.285; 0.172; 0.371; 0.136;0.232;0.385;0.383;1.005;0.656;0.432;0.261; 19.6;0.232 - 222;11.03.26;14:20:27;9;1; 0.0;274; 0.294; 0.169; 0.361; 0.134;0.186;0.419;0.395;1.061;0.668;0.349;0.201; 21.4;0.186 - 252;11.03.26;14:20:57;10;1; 0.0;366; 0.299; 0.171; 0.351; 0.133;0.148;0.450;0.402;1.120;0.689;0.289;0.165; 22.8;0.148 - 282;11.03.26;14:21:27;11;1; 0.0;477; 0.303; 0.170; 0.344; 0.132;0.119;0.474;0.407;1.163;0.699;0.236;0.132; 23.9;0.119 - 312;11.03.26;14:21:57;12;1; 0.0;622; 0.304; 0.169; 0.337; 0.131;0.098;0.493;0.409;1.208;0.709;0.196;0.109; 25.6;0.098 - 329;11.03.26;14:22:14;File: L_260311_141645.PWS diff --git a/src/tests/testthat/data/20260422_pam_2500.CSV b/src/tests/testthat/data/20260422_pam_2500.CSV new file mode 100644 index 0000000..663240e --- /dev/null +++ b/src/tests/testthat/data/20260422_pam_2500.CSV @@ -0,0 +1,18 @@ + +"t";"Date";"Time";"No.";"ML";"Temp.";"PAR";"F";"Fo'";"Fm'";"~Fo'";"Y(II)";"Y(NPQ)";"Y(NO)";"NPQ";"qN";"qP";"qL";"ETR";""; + 12;22.04.26;11:20:13;Type: LC + 14;22.04.26;11:20:14;default_60.par + 12;22.04.26;11:20:13;;2; 0.0;0;0.389;Fo: 0.389;Fm: 1.960 + 12;22.04.26;11:20:13;1;2; 0.0;0; 0.389; 0.000; 1.960; 0.389;0.802;0.000;0.198;0.000;0.000;1.000;1.000; 0.0 + 42;22.04.26;11:20:43;2;2; 0.0;7; 0.921; 0.000; 1.726; 0.379;0.466;0.064;0.470;0.136;0.142;0.598;0.246; 1.4 + 72;22.04.26;11:21:13;3;2; 0.0;36; 0.783; 0.000; 1.379; 0.359;0.432;0.168;0.399;0.421;0.351;0.584;0.268; 6.5 + 102;22.04.26;11:21:43;4;2; 0.0;106; 0.644; 0.000; 1.082; 0.335;0.405;0.267;0.329;0.811;0.525;0.586;0.305; 18.0 + 132;22.04.26;11:22:13;5;2; 0.0;203; 0.595; 0.000; 0.899; 0.315;0.338;0.358;0.304;1.180;0.628;0.521;0.276; 28.8 + 162;22.04.26;11:22:43;6;2; 0.0;368; 0.584; 0.000; 0.780; 0.299;0.251;0.451;0.298;1.513;0.694;0.408;0.209; 38.8 + 192;22.04.26;11:23:13;7;2; 0.0;624; 0.585; 0.000; 0.712; 0.289;0.178;0.523;0.298;1.753;0.730;0.300;0.148; 46.7 + 222;22.04.26;11:23:43;8;2; 0.0;986; 0.588; 0.000; 0.673; 0.282;0.126;0.574;0.300;1.912;0.751;0.217;0.104; 52.3 + 252;22.04.26;11:24:13;9;2; 0.0;1391; 0.588; 0.000; 0.651; 0.278;0.097;0.603;0.300;2.011;0.763;0.169;0.080; 56.5 + 282;22.04.26;11:24:43;10;2; 0.0;2020; 0.592; 0.000; 0.636; 0.275;0.069;0.629;0.302;2.082;0.770;0.122;0.057; 58.7 + 312;22.04.26;11:25:13;11;2; 0.0;7; 0.449; 0.000; 1.011; 0.328;0.556;0.215;0.229;0.939;0.565;0.823;0.601; 1.6 + 342;22.04.26;11:25:43;12;2; 0.0;69; 0.507; 0.000; 1.065; 0.333;0.524;0.217;0.259;0.840;0.534;0.763;0.502; 15.2 + 355;22.04.26;11:25:55;File: L_260422_112001.PWS diff --git a/src/tests/testthat/test-read_pam_2500_data.R b/src/tests/testthat/test-read_pam_2500_data.R index 97c31c8..d288fb4 100644 --- a/src/tests/testthat/test-read_pam_2500_data.R +++ b/src/tests/testthat/test-read_pam_2500_data.R @@ -1,20 +1,18 @@ -test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - default", { - test_data_file <- testthat::test_path("data", "20260311_1(2)_pam_2500.CSV") +test_that("read_pam_2500_data 20260422_pam_2500.CSV - default", { + test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") data <- read_pam_2500_data(test_data_file) par <- data$par expect_equal(par[1], 0) - expect_equal(par[2], 5) - expect_equal(par[3], 9) - expect_equal(par[4], 34) - expect_equal(par[5], 67) - expect_equal(par[6], 104) - expect_equal(par[7], 144) - expect_equal(par[8], 201) - expect_equal(par[9], 274) - expect_equal(par[10], 366) - expect_equal(par[11], 477) - expect_equal(par[12], 622) + expect_equal(par[2], 7) + expect_equal(par[3], 36) + expect_equal(par[4], 106) + expect_equal(par[5], 203) + expect_equal(par[6], 368) + expect_equal(par[7], 624) + expect_equal(par[8], 986) + expect_equal(par[9], 1391) + expect_equal(par[10], 2020) yield_1 <- data$yield_1 expect_equal(yield_1[1], NA_real_) @@ -27,22 +25,18 @@ test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - default", { expect_equal(yield_1[8], NA_real_) expect_equal(yield_1[9], NA_real_) expect_equal(yield_1[10], NA_real_) - expect_equal(yield_1[11], NA_real_) - expect_equal(yield_1[12], NA_real_) yield_2 <- data$yield_2 - expect_equal(yield_2[1], 0.777) - expect_equal(yield_2[2], 0.706) - expect_equal(yield_2[3], 0.498) - expect_equal(yield_2[4], 0.418) - expect_equal(yield_2[5], 0.371) - expect_equal(yield_2[6], 0.320) - expect_equal(yield_2[7], 0.277) - expect_equal(yield_2[8], 0.232) - expect_equal(yield_2[9], 0.186) - expect_equal(yield_2[10], 0.148) - expect_equal(yield_2[11], 0.119) - expect_equal(yield_2[12], 0.098) + expect_equal(yield_2[1], 0.802) + expect_equal(yield_2[2], 0.466) + expect_equal(yield_2[3], 0.432) + expect_equal(yield_2[4], 0.405) + expect_equal(yield_2[5], 0.338) + expect_equal(yield_2[6], 0.251) + expect_equal(yield_2[7], 0.178) + expect_equal(yield_2[8], 0.126) + expect_equal(yield_2[9], 0.097) + expect_equal(yield_2[10], 0.069) etr_1 <- data$etr_1 expect_equal(etr_1[1], NA_real_) @@ -55,41 +49,35 @@ test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - default", { expect_equal(etr_1[8], NA_real_) expect_equal(etr_1[9], NA_real_) expect_equal(etr_1[10], NA_real_) - expect_equal(etr_1[11], NA_real_) - expect_equal(etr_1[12], NA_real_) etr_2 <- data$etr_2 expect_equal(etr_2[1], 0) - expect_equal(etr_2[2], 1.48260) - expect_equal(etr_2[3], 1.88244) - expect_equal(etr_2[4], 5.969040) - expect_equal(etr_2[5], 10.439940) - expect_equal(etr_2[6], 13.97760) - expect_equal(etr_2[7], 16.752960) - expect_equal(etr_2[8], 19.58544) - expect_equal(etr_2[9], 21.404880) - expect_equal(etr_2[10], 22.75056) - expect_equal(etr_2[11], 23.84046) - expect_equal(etr_2[12], 25.601520) + expect_equal(etr_2[2], 1.37004) + expect_equal(etr_2[3], 6.53184) + expect_equal(etr_2[4], 18.03060) + expect_equal(etr_2[5], 28.81788) + expect_equal(etr_2[6], 38.79456) + expect_equal(etr_2[7], 46.65024) + expect_equal(etr_2[8], 52.17912) + expect_equal(etr_2[9], 56.66934) + expect_equal(etr_2[10], 58.53960) }) -test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - etr-factor 0.5", { - test_data_file <- testthat::test_path("data", "20260311_1(2)_pam_2500.CSV") +test_that("read_pam_2500_data 20260422_pam_2500.CSV - etr-factor 0.5", { + test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") data <- read_pam_2500_data(test_data_file, etr_factor = 0.5) par <- data$par - expect_equal(par[1], 0) - expect_equal(par[2], 5) - expect_equal(par[3], 9) - expect_equal(par[4], 34) - expect_equal(par[5], 67) - expect_equal(par[6], 104) - expect_equal(par[7], 144) - expect_equal(par[8], 201) - expect_equal(par[9], 274) - expect_equal(par[10], 366) - expect_equal(par[11], 477) - expect_equal(par[12], 622) + expect_equal(par[1], 0) + expect_equal(par[2], 7) + expect_equal(par[3], 36) + expect_equal(par[4], 106) + expect_equal(par[5], 203) + expect_equal(par[6], 368) + expect_equal(par[7], 624) + expect_equal(par[8], 986) + expect_equal(par[9], 1391) + expect_equal(par[10], 2020) yield_1 <- data$yield_1 expect_equal(yield_1[1], NA_real_) @@ -102,22 +90,18 @@ test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - etr-factor 0.5", { expect_equal(yield_1[8], NA_real_) expect_equal(yield_1[9], NA_real_) expect_equal(yield_1[10], NA_real_) - expect_equal(yield_1[11], NA_real_) - expect_equal(yield_1[12], NA_real_) yield_2 <- data$yield_2 - expect_equal(yield_2[1], 0.777) - expect_equal(yield_2[2], 0.706) - expect_equal(yield_2[3], 0.498) - expect_equal(yield_2[4], 0.418) - expect_equal(yield_2[5], 0.371) - expect_equal(yield_2[6], 0.320) - expect_equal(yield_2[7], 0.277) - expect_equal(yield_2[8], 0.232) - expect_equal(yield_2[9], 0.186) - expect_equal(yield_2[10], 0.148) - expect_equal(yield_2[11], 0.119) - expect_equal(yield_2[12], 0.098) + expect_equal(yield_2[1], 0.802) + expect_equal(yield_2[2], 0.466) + expect_equal(yield_2[3], 0.432) + expect_equal(yield_2[4], 0.405) + expect_equal(yield_2[5], 0.338) + expect_equal(yield_2[6], 0.251) + expect_equal(yield_2[7], 0.178) + expect_equal(yield_2[8], 0.126) + expect_equal(yield_2[9], 0.097) + expect_equal(yield_2[10], 0.069) etr_1 <- data$etr_1 expect_equal(etr_1[1], NA_real_) @@ -130,46 +114,40 @@ test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - etr-factor 0.5", { expect_equal(etr_1[8], NA_real_) expect_equal(etr_1[9], NA_real_) expect_equal(etr_1[10], NA_real_) - expect_equal(etr_1[11], NA_real_) - expect_equal(etr_1[12], NA_real_) etr_2 <- data$etr_2 expect_equal(etr_2[1], 0) - expect_equal(etr_2[2], 0.8825) - expect_equal(etr_2[3], 1.12050) - expect_equal(etr_2[4], 3.553) - expect_equal(etr_2[5], 6.21425) - expect_equal(etr_2[6], 8.320) - expect_equal(etr_2[7], 9.972) - expect_equal(etr_2[8], 11.658) - expect_equal(etr_2[9], 12.741) - expect_equal(etr_2[10], 13.542) - expect_equal(etr_2[11], 14.190750) - expect_equal(etr_2[12], 15.239) + expect_equal(etr_2[2], 0.81550) + expect_equal(etr_2[3], 3.88800) + expect_equal(etr_2[4], 10.73250) + expect_equal(etr_2[5], 17.15350) + expect_equal(etr_2[6], 23.09200) + expect_equal(etr_2[7], 27.76800) + expect_equal(etr_2[8], 31.05900) + expect_equal(etr_2[9], 33.73175) + expect_equal(etr_2[10], 34.84500) }) -test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "20260311_1(2)_pam_2500.CSV") +test_that("read_pam_2500_data 20260422_pam_2500.CSV - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { + test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") expect_error(read_pam_2500_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) -test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "20260311_1(2)_pam_2500.CSV") +test_that("read_pam_2500_data 20260422_pam_2500.CSV - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { + test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") data <- read_pam_2500_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par expect_equal(par[1], 0) - expect_equal(par[2], 5) - expect_equal(par[3], 9) - expect_equal(par[4], 34) - expect_equal(par[5], 67) - expect_equal(par[6], 104) - expect_equal(par[7], 144) - expect_equal(par[8], 201) - expect_equal(par[9], 274) - expect_equal(par[10], 366) - expect_equal(par[11], 477) - expect_equal(par[12], 622) + expect_equal(par[2], 7) + expect_equal(par[3], 36) + expect_equal(par[4], 106) + expect_equal(par[5], 203) + expect_equal(par[6], 368) + expect_equal(par[7], 624) + expect_equal(par[8], 986) + expect_equal(par[9], 1391) + expect_equal(par[10], 2020) yield_1 <- data$yield_1 expect_equal(yield_1[1], NA_real_) @@ -182,22 +160,18 @@ test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - fraction_photosystem_ expect_equal(yield_1[8], NA_real_) expect_equal(yield_1[9], NA_real_) expect_equal(yield_1[10], NA_real_) - expect_equal(yield_1[11], NA_real_) - expect_equal(yield_1[12], NA_real_) yield_2 <- data$yield_2 - expect_equal(yield_2[1], 0.777) - expect_equal(yield_2[2], 0.706) - expect_equal(yield_2[3], 0.498) - expect_equal(yield_2[4], 0.418) - expect_equal(yield_2[5], 0.371) - expect_equal(yield_2[6], 0.320) - expect_equal(yield_2[7], 0.277) - expect_equal(yield_2[8], 0.232) - expect_equal(yield_2[9], 0.186) - expect_equal(yield_2[10], 0.148) - expect_equal(yield_2[11], 0.119) - expect_equal(yield_2[12], 0.098) + expect_equal(yield_2[1], 0.802) + expect_equal(yield_2[2], 0.466) + expect_equal(yield_2[3], 0.432) + expect_equal(yield_2[4], 0.405) + expect_equal(yield_2[5], 0.338) + expect_equal(yield_2[6], 0.251) + expect_equal(yield_2[7], 0.178) + expect_equal(yield_2[8], 0.126) + expect_equal(yield_2[9], 0.097) + expect_equal(yield_2[10], 0.069) etr_1 <- data$etr_1 expect_equal(etr_1[1], NA_real_) @@ -210,20 +184,16 @@ test_that("read_pam_2500_data 20260311_1(2)_pam_2500.CSV - fraction_photosystem_ expect_equal(etr_1[8], NA_real_) expect_equal(etr_1[9], NA_real_) expect_equal(etr_1[10], NA_real_) - expect_equal(etr_1[11], NA_real_) - expect_equal(etr_1[12], NA_real_) etr_2 <- data$etr_2 expect_equal(etr_2[1], 0) - expect_equal(etr_2[2], 2.37216) - expect_equal(etr_2[3], 3.011904) - expect_equal(etr_2[4], 9.5504640) - expect_equal(etr_2[5], 16.7039040) - expect_equal(etr_2[6], 22.36416) - expect_equal(etr_2[7], 26.804736) - expect_equal(etr_2[8], 31.3367040) - expect_equal(etr_2[9], 34.2478080) - expect_equal(etr_2[10], 36.4008960) - expect_equal(etr_2[11], 38.1447360) - expect_equal(etr_2[12], 40.9624320) + expect_equal(etr_2[2], 2.192064) + expect_equal(etr_2[3], 10.450944) + expect_equal(etr_2[4], 28.848960) + expect_equal(etr_2[5], 46.108608) + expect_equal(etr_2[6], 62.071296) + expect_equal(etr_2[7], 74.640384) + expect_equal(etr_2[8], 83.486592) + expect_equal(etr_2[9], 90.670944) + expect_equal(etr_2[10], 93.663360) }) From 239c563f340d625d00c797ac6fb48dc91501c45c Mon Sep 17 00:00:00 2001 From: Phi-S <926151+Phi-S@users.noreply.github.com> Date: Thu, 23 Apr 2026 10:26:32 +0200 Subject: [PATCH 3/6] mprove column validation in junior PAM data functions --- src/R/read_pam_data.R | 71 +++++++++++++++++++++---------------------- src/R/validation.R | 12 ++++++-- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/src/R/read_pam_data.R b/src/R/read_pam_data.R index f284218..139288b 100644 --- a/src/R/read_pam_data.R +++ b/src/R/read_pam_data.R @@ -111,11 +111,12 @@ read_universal_data <- function(csv_path, #' data <- read_dual_pam_data(path) #' @export read_dual_pam_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -248,11 +249,12 @@ read_dual_pam_data <- function( #' data <- read_dual_pam_single_channel_p700_data(path) #' @export read_dual_pam_single_channel_p700_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -378,11 +380,12 @@ read_dual_pam_single_channel_p700_data <- function( #' data <- read_dual_pam_single_channel_fluo_data(path) #' @export read_dual_pam_single_channel_fluo_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -534,11 +537,12 @@ calc_etr <- function(yield, par, etr_factor, p_ratio) { #' data <- read_junior_pam_data(path) #' @export read_junior_pam_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -550,15 +554,8 @@ read_junior_pam_data <- function( validate_junior_pam_data(data) - par_col <- grep("PAR", names(data), value = TRUE) - if (length(par_col) == 1 && par_col != "PAR") { - data.table::setnames(data, old = par_col, new = "PAR") - } - - yield_2_col <- grep("Y..II.", names(data), value = TRUE) - if (length(yield_2_col) == 1 && yield_2_col != "Y..II.") { - data.table::setnames(data, old = yield_2_col, new = "Y.II.") - } + par_col <- grep("^.+\\.PAR$", names(data), value = TRUE)[1] + yield_2_col <- grep("^.+\\.Y\\.\\.II\\.$", names(data), value = TRUE)[1] data <- data[data$Type == "FO" | data$Type == "F", ] data <- data[order(data$"Time..rel.ms."), ] @@ -573,13 +570,13 @@ read_junior_pam_data <- function( last_par <- as.numeric(0) for (i in seq_len(nrow(data))) { row <- data[i, ] - current_par <- row$PAR + current_par <- row[[par_col]] if (remove_recovery && last_par != 0 && current_par < last_par) { break } - yield_2 <- row$Y.II. + yield_2 <- row[[yield_2_col]] recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) new_row <- list( @@ -640,11 +637,12 @@ read_junior_pam_data <- function( #' data <- read_pam_2500_data(path) #' @export read_pam_2500_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5) { + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { if (fraction_photosystem_I + fraction_photosystem_II != 1) { stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") } @@ -701,7 +699,6 @@ read_pam_2500_data <- function( last_par <- current_par } - print(result) return(result) }, warning = function(w) { diff --git a/src/R/validation.R b/src/R/validation.R index 69d5d40..8fdce1a 100644 --- a/src/R/validation.R +++ b/src/R/validation.R @@ -209,12 +209,18 @@ validate_junior_pam_data <- function(data) { stop("no cols in data") } - if (!any(grepl("PAR", colnames(data)))) { + par_cols <- grep("^.+\\.PAR$", names(data), value = TRUE) + if (length(par_cols) == 0) { stop("required col 'PAR' not found") + } else if (length(par_cols) > 1) { + stop(paste(length(par_cols), " 'PAR' cols found. Only supporting one 'PAR' column")) } - if (!any(grepl("Y..II.", colnames(data)))) { - stop("required col 'Y..II.' not found") + yield_cols <- grep("^.+\\.Y\\.\\.II\\.$", names(data), value = TRUE) + if (length(yield_cols) == 0) { + stop("required col 'Y (II)' not found") + } else if (length(yield_cols) > 1) { + stop(paste(length(yield_cols), " 'Y (II)' cols found. Only supporting one 'Y (II)' column")) } if (!"Time..rel.ms." %in% colnames(data)) { From aab70e2f7718defdaed9378e10ca631fadf5a220 Mon Sep 17 00:00:00 2001 From: Phi-S <926151+Phi-S@users.noreply.github.com> Date: Thu, 23 Apr 2026 10:32:19 +0200 Subject: [PATCH 4/6] updated folder structure for test data and images used in the README --- README.md | 8 ++++---- examples/Example_compare_models.R | 2 +- examples/Example_multiple_data.R | 2 +- texport_junior_pam.png => img/export_junior_pam.png | Bin ...eeters_etr_II_modified_control_plot_20240925.jpg | Bin .../test_combo_plot_control_etr_II.jpg | Bin .../data/{ => dual_pam_data}/20231122_01.csv | 0 .../testthat/data/{ => dual_pam_data}/20240925.csv | 0 .../data/{ => dual_pam_data}/bulk/20231123_02.csv | 0 .../data/{ => dual_pam_data}/bulk/20231123_03.csv | 0 .../data/{ => dual_pam_data}/bulk/20231123_04.csv | 0 .../data/{ => dual_pam_data}/bulk/20231123_05.csv | 0 .../data/{ => dual_pam_data}/bulk/20231123_06.csv | 0 .../data/{ => dual_pam_data}/bulk/20231123_07.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_08.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_09.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_10.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_11.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_12.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_13.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_14.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_15.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_16.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_17.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_18.csv | 0 .../data/{ => dual_pam_data}/bulk/20231214_19.csv | 0 .../20260130_efeutute_dual_pam_only_fluo.csv | 0 .../20260130_01_efeutute_dual_pam_only_p700.csv | 0 .../{ => junior_pam_data}/2026_04_22_junior_pam.csv | 0 .../data/{ => pam_2500_data}/20260422_pam_2500.CSV | 0 .../data/{ => universal_data}/universal_data.csv | 0 src/tests/testthat/test-combo_plot_control_etr_I.R | 2 +- src/tests/testthat/test-combo_plot_control_etr_II.R | 2 +- .../testthat/test-compare_regression_models_etr_I.R | 4 ++-- .../test-compare_regression_models_etr_II.R | 4 ++-- .../testthat/test-compare_regression_models_total.R | 4 ++-- src/tests/testthat/test-eilers_peeters_etr_I.R | 12 ++++++------ src/tests/testthat/test-eilers_peeters_etr_II.R | 10 +++++----- .../testthat/test-get_etr_data_for_par_values.R | 2 +- src/tests/testthat/test-platt_etr_I.R | 10 +++++----- src/tests/testthat/test-platt_etr_II.R | 12 ++++++------ src/tests/testthat/test-read_dual_pam_data.R | 12 ++++++------ .../test-read_dual_pam_single_channel_fluo_data.R | 8 ++++---- .../test-read_dual_pam_single_channel_p700_data.R | 8 ++++---- src/tests/testthat/test-read_junior_pam_data.R | 8 ++++---- src/tests/testthat/test-read_pam_2500_data.R | 8 ++++---- src/tests/testthat/test-read_universal_data.R | 8 ++++---- .../test-relative_root_mean_squared_error.R | 4 ++-- src/tests/testthat/test-root_mean_squared_error.R | 4 ++-- src/tests/testthat/test-universal_data_etr_I.R | 6 +++--- src/tests/testthat/test-vollenweider_etr_I.R | 12 ++++++------ src/tests/testthat/test-vollenweider_etr_II.R | 12 ++++++------ src/tests/testthat/test-walsby_etr_I.R | 12 ++++++------ src/tests/testthat/test-walsby_etr_II.R | 12 ++++++------ src/tests/testthat/test-write_model_result_csv.R | 4 ++-- 56 files changed, 96 insertions(+), 96 deletions(-) rename texport_junior_pam.png => img/export_junior_pam.png (100%) rename test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg => img/test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg (100%) rename test_combo_plot_control_etr_II.jpg => img/test_combo_plot_control_etr_II.jpg (100%) rename src/tests/testthat/data/{ => dual_pam_data}/20231122_01.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/20240925.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231123_02.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231123_03.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231123_04.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231123_05.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231123_06.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231123_07.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_08.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_09.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_10.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_11.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_12.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_13.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_14.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_15.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_16.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_17.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_18.csv (100%) rename src/tests/testthat/data/{ => dual_pam_data}/bulk/20231214_19.csv (100%) rename src/tests/testthat/data/{ => dual_pam_single_channel_fluo_data}/20260130_efeutute_dual_pam_only_fluo.csv (100%) rename src/tests/testthat/data/{ => dual_pam_single_channel_p700_data}/20260130_01_efeutute_dual_pam_only_p700.csv (100%) rename src/tests/testthat/data/{ => junior_pam_data}/2026_04_22_junior_pam.csv (100%) rename src/tests/testthat/data/{ => pam_2500_data}/20260422_pam_2500.CSV (100%) rename src/tests/testthat/data/{ => universal_data}/universal_data.csv (100%) diff --git a/README.md b/README.md index f15e965..5625986 100644 --- a/README.md +++ b/README.md @@ -297,7 +297,7 @@ The function processes the provided CSV file by: - Stopping at the recovery period if `remove_recovery = TRUE`. To ensure the file is imported correctly, please export the CSV file using the default settings: -![Plot](texport_junior_pam.png) +![Plot](img/export_junior_pam.png) #### Return @@ -966,7 +966,7 @@ plot_control_eilers_peeters_ETR_II <- plot_control( print(plot_control_eilers_peeters_ETR_II) ``` -![Plot](test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg) +![Plot](img/test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg) --- @@ -989,7 +989,7 @@ A plot displaying the original ETR and Yield values and the regression data from #### Examples ```r -test_data_file <- file.path(getwd(), "data", "20240925.csv") +test_data_file <- file.path(getwd(), "data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) eilers_peeters <- eilers_peeters_modified(eilers_peeters_generate_regression_ETR_II(data)) @@ -1006,7 +1006,7 @@ test_data_file <- file.path(getwd(), "data", "20240925.csv") ) ``` -![combo Plot](test_combo_plot_control_etr_II.jpg) +![combo Plot](img/test_combo_plot_control_etr_II.jpg) --- diff --git a/examples/Example_compare_models.R b/examples/Example_compare_models.R index e65a9a0..04a6a54 100644 --- a/examples/Example_compare_models.R +++ b/examples/Example_compare_models.R @@ -7,7 +7,7 @@ library("pam") #### read_dual_pam_data()#### # raw data file directory script_dir <- dirname(sys.frame(1)$ofile) -data_dir <- file.path(script_dir, "data", "bulk") +data_dir <- file.path(script_dir, "data", "dual_pam_data", "bulk") #### compare_regression_models_ETR_II#### compare_regression_models_ETR_II_result <- compare_regression_models_ETR_II(data_dir, read_dual_pam_data) diff --git a/examples/Example_multiple_data.R b/examples/Example_multiple_data.R index fc69ef3..e3d8c41 100644 --- a/examples/Example_multiple_data.R +++ b/examples/Example_multiple_data.R @@ -6,7 +6,7 @@ library("pam") #### raw data file directory#### script_dir <- dirname(sys.frame(1)$ofile) -data_dir <- file.path(script_dir, "data", "bulk") +data_dir <- file.path(script_dir, "data", "dual_pam_data", "bulk") output_dir <- file.path(script_dir, "output") dir.create(output_dir, showWarnings = FALSE) output_path_pdf <- file.path(output_dir, "eilers_peters_plot_control.pdf") diff --git a/texport_junior_pam.png b/img/export_junior_pam.png similarity index 100% rename from texport_junior_pam.png rename to img/export_junior_pam.png diff --git a/test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg b/img/test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg similarity index 100% rename from test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg rename to img/test-eilers_peeters_etr_II_modified_control_plot_20240925.jpg diff --git a/test_combo_plot_control_etr_II.jpg b/img/test_combo_plot_control_etr_II.jpg similarity index 100% rename from test_combo_plot_control_etr_II.jpg rename to img/test_combo_plot_control_etr_II.jpg diff --git a/src/tests/testthat/data/20231122_01.csv b/src/tests/testthat/data/dual_pam_data/20231122_01.csv similarity index 100% rename from src/tests/testthat/data/20231122_01.csv rename to src/tests/testthat/data/dual_pam_data/20231122_01.csv diff --git a/src/tests/testthat/data/20240925.csv b/src/tests/testthat/data/dual_pam_data/20240925.csv similarity index 100% rename from src/tests/testthat/data/20240925.csv rename to src/tests/testthat/data/dual_pam_data/20240925.csv diff --git a/src/tests/testthat/data/bulk/20231123_02.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231123_02.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231123_02.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231123_02.csv diff --git a/src/tests/testthat/data/bulk/20231123_03.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231123_03.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231123_03.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231123_03.csv diff --git a/src/tests/testthat/data/bulk/20231123_04.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231123_04.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231123_04.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231123_04.csv diff --git a/src/tests/testthat/data/bulk/20231123_05.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231123_05.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231123_05.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231123_05.csv diff --git a/src/tests/testthat/data/bulk/20231123_06.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231123_06.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231123_06.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231123_06.csv diff --git a/src/tests/testthat/data/bulk/20231123_07.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231123_07.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231123_07.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231123_07.csv diff --git a/src/tests/testthat/data/bulk/20231214.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214.csv diff --git a/src/tests/testthat/data/bulk/20231214_08.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_08.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_08.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_08.csv diff --git a/src/tests/testthat/data/bulk/20231214_09.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_09.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_09.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_09.csv diff --git a/src/tests/testthat/data/bulk/20231214_10.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_10.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_10.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_10.csv diff --git a/src/tests/testthat/data/bulk/20231214_11.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_11.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_11.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_11.csv diff --git a/src/tests/testthat/data/bulk/20231214_12.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_12.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_12.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_12.csv diff --git a/src/tests/testthat/data/bulk/20231214_13.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_13.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_13.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_13.csv diff --git a/src/tests/testthat/data/bulk/20231214_14.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_14.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_14.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_14.csv diff --git a/src/tests/testthat/data/bulk/20231214_15.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_15.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_15.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_15.csv diff --git a/src/tests/testthat/data/bulk/20231214_16.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_16.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_16.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_16.csv diff --git a/src/tests/testthat/data/bulk/20231214_17.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_17.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_17.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_17.csv diff --git a/src/tests/testthat/data/bulk/20231214_18.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_18.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_18.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_18.csv diff --git a/src/tests/testthat/data/bulk/20231214_19.csv b/src/tests/testthat/data/dual_pam_data/bulk/20231214_19.csv similarity index 100% rename from src/tests/testthat/data/bulk/20231214_19.csv rename to src/tests/testthat/data/dual_pam_data/bulk/20231214_19.csv diff --git a/src/tests/testthat/data/20260130_efeutute_dual_pam_only_fluo.csv b/src/tests/testthat/data/dual_pam_single_channel_fluo_data/20260130_efeutute_dual_pam_only_fluo.csv similarity index 100% rename from src/tests/testthat/data/20260130_efeutute_dual_pam_only_fluo.csv rename to src/tests/testthat/data/dual_pam_single_channel_fluo_data/20260130_efeutute_dual_pam_only_fluo.csv diff --git a/src/tests/testthat/data/20260130_01_efeutute_dual_pam_only_p700.csv b/src/tests/testthat/data/dual_pam_single_channel_p700_data/20260130_01_efeutute_dual_pam_only_p700.csv similarity index 100% rename from src/tests/testthat/data/20260130_01_efeutute_dual_pam_only_p700.csv rename to src/tests/testthat/data/dual_pam_single_channel_p700_data/20260130_01_efeutute_dual_pam_only_p700.csv diff --git a/src/tests/testthat/data/2026_04_22_junior_pam.csv b/src/tests/testthat/data/junior_pam_data/2026_04_22_junior_pam.csv similarity index 100% rename from src/tests/testthat/data/2026_04_22_junior_pam.csv rename to src/tests/testthat/data/junior_pam_data/2026_04_22_junior_pam.csv diff --git a/src/tests/testthat/data/20260422_pam_2500.CSV b/src/tests/testthat/data/pam_2500_data/20260422_pam_2500.CSV similarity index 100% rename from src/tests/testthat/data/20260422_pam_2500.CSV rename to src/tests/testthat/data/pam_2500_data/20260422_pam_2500.CSV diff --git a/src/tests/testthat/data/universal_data.csv b/src/tests/testthat/data/universal_data/universal_data.csv similarity index 100% rename from src/tests/testthat/data/universal_data.csv rename to src/tests/testthat/data/universal_data/universal_data.csv diff --git a/src/tests/testthat/test-combo_plot_control_etr_I.R b/src/tests/testthat/test-combo_plot_control_etr_I.R index cf29b08..87c882a 100644 --- a/src/tests/testthat/test-combo_plot_control_etr_I.R +++ b/src/tests/testthat/test-combo_plot_control_etr_I.R @@ -1,5 +1,5 @@ test_that("test-combo_plot_control 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) eilers_peeters <- eilers_peeters_modified(eilers_peeters_generate_regression_ETR_I(data)) diff --git a/src/tests/testthat/test-combo_plot_control_etr_II.R b/src/tests/testthat/test-combo_plot_control_etr_II.R index 798f8cd..47457e1 100644 --- a/src/tests/testthat/test-combo_plot_control_etr_II.R +++ b/src/tests/testthat/test-combo_plot_control_etr_II.R @@ -1,5 +1,5 @@ test_that("test-combo_plot_control 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) eilers_peeters <- eilers_peeters_modified(eilers_peeters_generate_regression_ETR_II(data)) diff --git a/src/tests/testthat/test-compare_regression_models_etr_I.R b/src/tests/testthat/test-compare_regression_models_etr_I.R index 5e54236..f8076a4 100644 --- a/src/tests/testthat/test-compare_regression_models_etr_I.R +++ b/src/tests/testthat/test-compare_regression_models_etr_I.R @@ -1,6 +1,6 @@ test_that("compare_regression_models etr I - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_dir <- testthat::test_path("data", "bulk") + test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") result <- compare_regression_models_ETR_I(test_data_dir, read_dual_pam_data) expect_equal(result[["eilers_peeters"]], 13) @@ -10,7 +10,7 @@ test_that("compare_regression_models etr I - linux", { }) test_that("compare_regression_models etr I", { - test_data_dir <- testthat::test_path("data", "bulk") + test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") result <- compare_regression_models_ETR_I(test_data_dir, read_dual_pam_data) expect_named(result, c("eilers_peeters", "platt", "vollenweider", "walsby"), ignore.order = TRUE) }) diff --git a/src/tests/testthat/test-compare_regression_models_etr_II.R b/src/tests/testthat/test-compare_regression_models_etr_II.R index 919d238..ea84675 100644 --- a/src/tests/testthat/test-compare_regression_models_etr_II.R +++ b/src/tests/testthat/test-compare_regression_models_etr_II.R @@ -1,7 +1,7 @@ test_that("compare_regression_models etr II - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_dir <- testthat::test_path("data", "bulk") + test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") result <- compare_regression_models_ETR_II(test_data_dir, read_dual_pam_data) expect_equal(result[["eilers_peeters"]], 37) @@ -11,7 +11,7 @@ test_that("compare_regression_models etr II - linux", { }) test_that("compare_regression_models etr II", { - test_data_dir <- testthat::test_path("data", "bulk") + test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") result <- compare_regression_models_ETR_II(test_data_dir, read_dual_pam_data) expect_named(result, c("eilers_peeters", "platt", "vollenweider", "walsby"), ignore.order = TRUE) }) diff --git a/src/tests/testthat/test-compare_regression_models_total.R b/src/tests/testthat/test-compare_regression_models_total.R index 3c6f43a..21adb47 100644 --- a/src/tests/testthat/test-compare_regression_models_total.R +++ b/src/tests/testthat/test-compare_regression_models_total.R @@ -1,6 +1,6 @@ test_that("compare_regression_models etr I + II - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_dir <- testthat::test_path("data", "bulk") + test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") model_points_etr_I <- compare_regression_models_ETR_I(test_data_dir, read_dual_pam_data) model_points_etr_II <- compare_regression_models_ETR_II(test_data_dir, read_dual_pam_data) @@ -16,7 +16,7 @@ test_that("compare_regression_models etr I + II - linux", { }) test_that("compare_regression_models etr I + II", { - test_data_dir <- testthat::test_path("data", "bulk") + test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") model_points_etr_I <- compare_regression_models_ETR_I(test_data_dir, read_dual_pam_data) expect_named(model_points_etr_I, c("eilers_peeters", "platt", "vollenweider", "walsby"), ignore.order = TRUE) diff --git a/src/tests/testthat/test-eilers_peeters_etr_I.R b/src/tests/testthat/test-eilers_peeters_etr_I.R index b8d0fe2..d4e0275 100644 --- a/src/tests/testthat/test-eilers_peeters_etr_I.R +++ b/src/tests/testthat/test-eilers_peeters_etr_I.R @@ -1,6 +1,6 @@ test_that("test-eilers_peeters_etr_I generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_I(data) @@ -16,14 +16,14 @@ test_that("test-eilers_peeters_etr_I generate regression 20240925.csv - linux", }) test_that("test-eilers_peeters_etr_I generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_I(data) expect_no_error(validate_model_result(model_result)) }) test_that("test-eilers_peeters_etr_I control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_I(data) @@ -44,7 +44,7 @@ test_that("test-eilers_peeters_etr_I control plot 20240925.csv", { test_that("test-eilers_peeters_etr_I generate regression modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_I(data) model_result <- eilers_peeters_modified(model_result) @@ -67,7 +67,7 @@ test_that("test-eilers_peeters_etr_I generate regression modified 20240925.csv - }) test_that("test-eilers_peeters_etr_I generate regression modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_I(data) @@ -78,7 +78,7 @@ test_that("test-eilers_peeters_etr_I generate regression modified 20240925.csv", }) test_that("test-eilers_peeters_etr_I modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_I(data) model_result <- eilers_peeters_modified(model_result) diff --git a/src/tests/testthat/test-eilers_peeters_etr_II.R b/src/tests/testthat/test-eilers_peeters_etr_II.R index 0dc92b6..f9210fb 100644 --- a/src/tests/testthat/test-eilers_peeters_etr_II.R +++ b/src/tests/testthat/test-eilers_peeters_etr_II.R @@ -1,6 +1,6 @@ test_that("test-eilers_peeters_etr_II generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_II(data) @@ -16,7 +16,7 @@ test_that("test-eilers_peeters_etr_II generate regression 20240925.csv - linux", }) test_that("test-eilers_peeters_etr_II generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_II(data) expect_no_error(validate_model_result(model_result)) @@ -25,7 +25,7 @@ test_that("test-eilers_peeters_etr_II generate regression 20240925.csv", { test_that("test-eilers_peeters_etr_II modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_II(data) model_result <- eilers_peeters_modified(model_result) @@ -48,7 +48,7 @@ test_that("test-eilers_peeters_etr_II modified 20240925.csv - linux", { }) test_that("test-eilers_peeters_etr_II modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_II(data) expect_no_error(validate_model_result(model_result)) @@ -58,7 +58,7 @@ test_that("test-eilers_peeters_etr_II modified 20240925.csv", { }) test_that("test-eilers_peeters_etr_II modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_II(data) model_result <- model_result <- eilers_peeters_modified(model_result) diff --git a/src/tests/testthat/test-get_etr_data_for_par_values.R b/src/tests/testthat/test-get_etr_data_for_par_values.R index 7e8022a..2705898 100644 --- a/src/tests/testthat/test-get_etr_data_for_par_values.R +++ b/src/tests/testthat/test-get_etr_data_for_par_values.R @@ -1,5 +1,5 @@ test_that("test-get_etr_data_for_par_values.R", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) etr_regression_data <- get_etr_regression_data_from_model_result(model_result) diff --git a/src/tests/testthat/test-platt_etr_I.R b/src/tests/testthat/test-platt_etr_I.R index dded5b9..419101e 100644 --- a/src/tests/testthat/test-platt_etr_I.R +++ b/src/tests/testthat/test-platt_etr_I.R @@ -1,7 +1,7 @@ test_that("test-platt_etr_I generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_I(data) @@ -17,7 +17,7 @@ test_that("test-platt_etr_I generate regression 20240925.csv - linux", { }) test_that("test-platt_etr_I generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_I(data) expect_no_error(validate_model_result(model_result)) @@ -26,7 +26,7 @@ test_that("test-platt_etr_I generate regression 20240925.csv", { test_that("test-platt_etr_I generate regression modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_I(data) model_result <- platt_modified(model_result) @@ -49,7 +49,7 @@ test_that("test-platt_etr_I generate regression modified 20240925.csv - linux", }) test_that("test-platt_etr_I generate regression modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_I(data) @@ -60,7 +60,7 @@ test_that("test-platt_etr_I generate regression modified 20240925.csv", { }) test_that("test-platt_etr_I modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_I(data) model_result <- platt_modified(model_result) diff --git a/src/tests/testthat/test-platt_etr_II.R b/src/tests/testthat/test-platt_etr_II.R index f5d7c93..c8b0db6 100644 --- a/src/tests/testthat/test-platt_etr_II.R +++ b/src/tests/testthat/test-platt_etr_II.R @@ -1,7 +1,7 @@ test_that("test-platt_etr_II generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_II(data) @@ -17,14 +17,14 @@ test_that("test-platt_etr_II generate regression 20240925.csv - linux", { }) test_that("test-platt_etr_II generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_II(data) expect_no_error(validate_model_result(model_result)) }) test_that("test-platt_etr_II control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_II(data) @@ -45,7 +45,7 @@ test_that("test-platt_etr_II control plot 20240925.csv", { test_that("test-platt_etr_II generate regression modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_II(data) model_result <- platt_modified(model_result) @@ -68,7 +68,7 @@ test_that("test-platt_etr_II generate regression modified 20240925.csv - linux", }) test_that("test-platt_etr_II generate regression modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_II(data) expect_no_error(validate_model_result(model_result)) @@ -78,7 +78,7 @@ test_that("test-platt_etr_II generate regression modified 20240925.csv", { }) test_that("test-platt_etr_II modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- platt_generate_regression_ETR_II(data) diff --git a/src/tests/testthat/test-read_dual_pam_data.R b/src/tests/testthat/test-read_dual_pam_data.R index bcb9dc1..1f556d4 100644 --- a/src/tests/testthat/test-read_dual_pam_data.R +++ b/src/tests/testthat/test-read_dual_pam_data.R @@ -1,5 +1,5 @@ test_that("read_dual_pam_data 20240925.csv - default", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) par <- data$par @@ -99,7 +99,7 @@ test_that("read_dual_pam_data 20240925.csv - default", { }) test_that("read_dual_pam_data 20240925.csv - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -199,12 +199,12 @@ test_that("read_dual_pam_data 20240925.csv - etr_factor 0.5", { }) test_that("read_dual_pam_data 20240925.csv - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") expect_error(read_dual_pam_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_dual_pam_data 20240925.csv - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par @@ -304,11 +304,11 @@ test_that("read_dual_pam_data 20240925.csv - fraction_photosystem_I = 0.2, fract }) test_that("20260130_01_efeutute_dual_pam_only_p700.csv - expect fm missing", { - test_data_file <- testthat::test_path("data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") expect_error(read_dual_pam_data(test_data_file)) }) test_that("20260130_efeutute_dual_pam_only_fluo.csv - expect pm missing", { - test_data_file <- testthat::test_path("data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") expect_error(read_dual_pam_data(test_data_file)) }) diff --git a/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R b/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R index fda729a..61cd47a 100644 --- a/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R +++ b/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R @@ -1,5 +1,5 @@ test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - default", { - test_data_file <- testthat::test_path("data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") data <- read_dual_pam_single_channel_fluo_data(test_data_file) par <- data$par @@ -69,7 +69,7 @@ test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_onl }) test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") data <- read_dual_pam_single_channel_fluo_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -139,12 +139,12 @@ test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_onl }) test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") expect_error(read_dual_pam_single_channel_fluo_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") data <- read_dual_pam_single_channel_fluo_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par diff --git a/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R b/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R index d486edf..4a5fdb8 100644 --- a/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R +++ b/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R @@ -1,5 +1,5 @@ test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - default", { - test_data_file <- testthat::test_path("data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") data <- read_dual_pam_single_channel_p700_data(test_data_file) par <- data$par @@ -89,7 +89,7 @@ test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_ }) test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") data <- read_dual_pam_single_channel_p700_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -179,12 +179,12 @@ test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_ }) test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") expect_error(read_dual_pam_single_channel_p700_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") data <- read_dual_pam_single_channel_p700_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par diff --git a/src/tests/testthat/test-read_junior_pam_data.R b/src/tests/testthat/test-read_junior_pam_data.R index 30c8982..0286f22 100644 --- a/src/tests/testthat/test-read_junior_pam_data.R +++ b/src/tests/testthat/test-read_junior_pam_data.R @@ -1,5 +1,5 @@ test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - default", { - test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") + test_data_file <- testthat::test_path("data", "junior_pam_data", "2026_04_22_junior_pam.csv") data <- read_junior_pam_data(test_data_file) par <- data$par @@ -79,7 +79,7 @@ test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - default", { }) test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") + test_data_file <- testthat::test_path("data", "junior_pam_data", "2026_04_22_junior_pam.csv") data <- read_junior_pam_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -159,12 +159,12 @@ test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - etr_factor 0.5", { }) test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") + test_data_file <- testthat::test_path("data", "junior_pam_data", "2026_04_22_junior_pam.csv") expect_error(read_junior_pam_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_junior_pam_data 2026_04_22_junior_pam.csv - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "2026_04_22_junior_pam.csv") + test_data_file <- testthat::test_path("data", "junior_pam_data", "2026_04_22_junior_pam.csv") data <- read_junior_pam_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par diff --git a/src/tests/testthat/test-read_pam_2500_data.R b/src/tests/testthat/test-read_pam_2500_data.R index d288fb4..d916676 100644 --- a/src/tests/testthat/test-read_pam_2500_data.R +++ b/src/tests/testthat/test-read_pam_2500_data.R @@ -1,5 +1,5 @@ test_that("read_pam_2500_data 20260422_pam_2500.CSV - default", { - test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") + test_data_file <- testthat::test_path("data", "pam_2500_data", "20260422_pam_2500.CSV") data <- read_pam_2500_data(test_data_file) par <- data$par @@ -64,7 +64,7 @@ test_that("read_pam_2500_data 20260422_pam_2500.CSV - default", { }) test_that("read_pam_2500_data 20260422_pam_2500.CSV - etr-factor 0.5", { - test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") + test_data_file <- testthat::test_path("data", "pam_2500_data", "20260422_pam_2500.CSV") data <- read_pam_2500_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -129,12 +129,12 @@ test_that("read_pam_2500_data 20260422_pam_2500.CSV - etr-factor 0.5", { }) test_that("read_pam_2500_data 20260422_pam_2500.CSV - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") + test_data_file <- testthat::test_path("data", "pam_2500_data", "20260422_pam_2500.CSV") expect_error(read_pam_2500_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_pam_2500_data 20260422_pam_2500.CSV - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "20260422_pam_2500.CSV") + test_data_file <- testthat::test_path("data", "pam_2500_data", "20260422_pam_2500.CSV") data <- read_pam_2500_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par diff --git a/src/tests/testthat/test-read_universal_data.R b/src/tests/testthat/test-read_universal_data.R index e07470e..ba3d7fb 100644 --- a/src/tests/testthat/test-read_universal_data.R +++ b/src/tests/testthat/test-read_universal_data.R @@ -1,5 +1,5 @@ test_that("read_universal_data universal_data.csv - default", { - test_data_file <- testthat::test_path("data", "universal_data.csv") + test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") data <- read_universal_data(test_data_file) par <- data$par @@ -99,7 +99,7 @@ test_that("read_universal_data universal_data.csv - default", { }) test_that("read_universal_data universal_data.csv - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "universal_data.csv") + test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") data <- read_universal_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -199,12 +199,12 @@ test_that("read_universal_data universal_data.csv - etr_factor 0.5", { }) test_that("read_universal_data universal_data.csv - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "universal_data.csv") + test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") expect_error(read_universal_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_universal_data universal_data.csv - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "universal_data.csv") + test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") data <- read_universal_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par diff --git a/src/tests/testthat/test-relative_root_mean_squared_error.R b/src/tests/testthat/test-relative_root_mean_squared_error.R index 026f461..938371b 100644 --- a/src/tests/testthat/test-relative_root_mean_squared_error.R +++ b/src/tests/testthat/test-relative_root_mean_squared_error.R @@ -1,7 +1,7 @@ test_that("test-relative_root_mean_squared_error - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) etr_regression_data <- get_etr_regression_data_from_model_result(model_result) @@ -13,7 +13,7 @@ test_that("test-relative_root_mean_squared_error - linux", { }) test_that("test-relative_root_mean_squared_error", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) etr_regression_data <- get_etr_regression_data_from_model_result(model_result) diff --git a/src/tests/testthat/test-root_mean_squared_error.R b/src/tests/testthat/test-root_mean_squared_error.R index 8606069..f29912d 100644 --- a/src/tests/testthat/test-root_mean_squared_error.R +++ b/src/tests/testthat/test-root_mean_squared_error.R @@ -1,7 +1,7 @@ test_that("test-root_mean_squared_error - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) etr_regression_data <- get_etr_regression_data_from_model_result(model_result) @@ -12,7 +12,7 @@ test_that("test-root_mean_squared_error - linux", { }) test_that("test-root_mean_squared_error", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) etr_regression_data <- get_etr_regression_data_from_model_result(model_result) diff --git a/src/tests/testthat/test-universal_data_etr_I.R b/src/tests/testthat/test-universal_data_etr_I.R index e1ac1e3..a2c9986 100644 --- a/src/tests/testthat/test-universal_data_etr_I.R +++ b/src/tests/testthat/test-universal_data_etr_I.R @@ -1,7 +1,7 @@ test_that("test-universal_data_etr_I - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "universal_data.csv") + test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") data <- read_universal_data(test_data_file) eilers_peeters <- eilers_peeters_modified(eilers_peeters_generate_regression_ETR_I(data)) @@ -75,7 +75,7 @@ test_that("test-universal_data_etr_I - linux", { }) test_that("test-universal_data_etr_I", { - test_data_file <- testthat::test_path("data", "universal_data.csv") + test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") data <- read_universal_data(test_data_file) eilers_peeters <- eilers_peeters_modified(eilers_peeters_generate_regression_ETR_I(data)) @@ -92,7 +92,7 @@ test_that("test-universal_data_etr_I", { }) test_that("test-universal_data_etr_I plot", { - test_data_file <- testthat::test_path("data", "universal_data.csv") + test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") data <- read_universal_data(test_data_file) eilers_peeters <- eilers_peeters_modified(eilers_peeters_generate_regression_ETR_I(data)) diff --git a/src/tests/testthat/test-vollenweider_etr_I.R b/src/tests/testthat/test-vollenweider_etr_I.R index 0c7bda5..e1c7772 100644 --- a/src/tests/testthat/test-vollenweider_etr_I.R +++ b/src/tests/testthat/test-vollenweider_etr_I.R @@ -1,7 +1,7 @@ test_that("test-vollenweider_etr_I generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_I(data) @@ -17,14 +17,14 @@ test_that("test-vollenweider_etr_I generate regression 20240925.csv - linux", { }) test_that("test-vollenweider_etr_I generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_I(data) expect_no_error(validate_model_result(model_result)) }) test_that("test-vollenweider_etr_I control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_I(data) @@ -45,7 +45,7 @@ test_that("test-vollenweider_etr_I control plot 20240925.csv", { test_that("test-vollenweider_etr_I generate regression modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_I(data) model_result <- vollenweider_modified(model_result) @@ -68,7 +68,7 @@ test_that("test-vollenweider_etr_I generate regression modified 20240925.csv - l }) test_that("test-vollenweider_etr_I generate regression modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_I(data) expect_no_error(validate_model_result(model_result)) @@ -78,7 +78,7 @@ test_that("test-vollenweider_etr_I generate regression modified 20240925.csv", { }) test_that("test-vollenweider_etr_I modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_I(data) model_result <- vollenweider_modified(model_result) diff --git a/src/tests/testthat/test-vollenweider_etr_II.R b/src/tests/testthat/test-vollenweider_etr_II.R index ad71827..a892144 100644 --- a/src/tests/testthat/test-vollenweider_etr_II.R +++ b/src/tests/testthat/test-vollenweider_etr_II.R @@ -1,7 +1,7 @@ test_that("test-vollenweider_etr_II generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_II(data) @@ -17,14 +17,14 @@ test_that("test-vollenweider_etr_II generate regression 20240925.csv - linux", { }) test_that("test-vollenweider_etr_II generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_II(data) expect_no_error(validate_model_result(model_result)) }) test_that("test-vollenweider_etr_II control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_II(data) @@ -45,7 +45,7 @@ test_that("test-vollenweider_etr_II control plot 20240925.csv", { test_that("test-vollenweider_etr_II generate regression modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_II(data) model_result <- vollenweider_modified(model_result) @@ -68,7 +68,7 @@ test_that("test-vollenweider_etr_II generate regression modified 20240925.csv - }) test_that("test-vollenweider_etr_II generate regression modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_II(data) @@ -79,7 +79,7 @@ test_that("test-vollenweider_etr_II generate regression modified 20240925.csv", }) test_that("test-vollenweider_etr_II modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- vollenweider_generate_regression_ETR_II(data) model_result <- vollenweider_modified(model_result) diff --git a/src/tests/testthat/test-walsby_etr_I.R b/src/tests/testthat/test-walsby_etr_I.R index 6da7dad..319fa25 100644 --- a/src/tests/testthat/test-walsby_etr_I.R +++ b/src/tests/testthat/test-walsby_etr_I.R @@ -1,7 +1,7 @@ test_that("test-walsby_etr_I generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_I(data) @@ -12,14 +12,14 @@ test_that("test-walsby_etr_I generate regression 20240925.csv - linux", { }) test_that("test-walsby_etr_I generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_I(data) expect_no_error(validate_model_result(model_result)) }) test_that("test-walsby_etr_I control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_I(data) @@ -40,7 +40,7 @@ test_that("test-walsby_etr_I control plot 20240925.csv", { test_that("test-walsby_etr_I generate regression modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_I(data) model_result <- walsby_modified(model_result) @@ -63,7 +63,7 @@ test_that("test-walsby_etr_I generate regression modified 20240925.csv - linux", }) test_that("test-walsby_etr_I generate regression modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_I(data) @@ -74,7 +74,7 @@ test_that("test-walsby_etr_I generate regression modified 20240925.csv", { }) test_that("test-walsby_etr_I modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_I(data) model_result <- walsby_modified(model_result) diff --git a/src/tests/testthat/test-walsby_etr_II.R b/src/tests/testthat/test-walsby_etr_II.R index 55d94c5..f2dfda3 100644 --- a/src/tests/testthat/test-walsby_etr_II.R +++ b/src/tests/testthat/test-walsby_etr_II.R @@ -1,7 +1,7 @@ test_that("test-walsby_etr_II generate regression 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) @@ -12,14 +12,14 @@ test_that("test-walsby_etr_II generate regression 20240925.csv - linux", { }) test_that("test-walsby_etr_II generate regression 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) expect_no_error(validate_model_result(model_result)) }) test_that("test-walsby_etr_II control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) @@ -40,7 +40,7 @@ test_that("test-walsby_etr_II control plot 20240925.csv", { test_that("test-walsby_etr_II generate regression modified 20240925.csv - linux", { skip_if_not(is_debian_or_ubuntu()) - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) model_result <- walsby_modified(model_result) @@ -63,7 +63,7 @@ test_that("test-walsby_etr_II generate regression modified 20240925.csv - linux" }) test_that("test-walsby_etr_II generate regression modified 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) @@ -74,7 +74,7 @@ test_that("test-walsby_etr_II generate regression modified 20240925.csv", { }) test_that("test-walsby_etr_II modified control plot 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) model_result <- walsby_modified(model_result) diff --git a/src/tests/testthat/test-write_model_result_csv.R b/src/tests/testthat/test-write_model_result_csv.R index a968478..2e51656 100644 --- a/src/tests/testthat/test-write_model_result_csv.R +++ b/src/tests/testthat/test-write_model_result_csv.R @@ -1,5 +1,5 @@ test_that("test-write_model_result_csv - walsby_modified - 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) model_result <- walsby_modified(model_result) @@ -52,7 +52,7 @@ test_that("test-write_model_result_csv - walsby_modified - 20240925.csv", { }) test_that("test-write_model_result_csv - walsby - 20240925.csv", { - test_data_file <- testthat::test_path("data", "20240925.csv") + test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- walsby_generate_regression_ETR_II(data) From b123237f9575b96f7c8869c53b1be773553579f0 Mon Sep 17 00:00:00 2001 From: Phi-S <926151+Phi-S@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:46:36 +0200 Subject: [PATCH 5/6] updated read function and validate structure --- src/R/compare_regression_models.R | 2 +- src/R/device_dual_pam.R | 170 +++++ src/R/device_dual_pam_single_channel_fluo.R | 164 ++++ src/R/device_dual_pam_single_channel_p700.R | 162 ++++ src/R/device_junior_pam.R | 125 +++ src/R/device_pam_2500.R | 133 ++++ src/R/device_universal_data.R | 93 +++ ...ilers_peeters.R => model_eilers_peeters.R} | 2 +- src/R/{platt.R => model_platt.R} | 2 +- .../{vollenweider.R => model_vollenweider.R} | 2 +- src/R/{walsby.R => model_walsby.R} | 2 +- src/R/{combo_plot_control.R => plot.R} | 212 +++++- src/R/read_pam_data.R | 711 ------------------ src/R/util.R | 309 +------- src/R/validation.R | 228 +----- src/R/write_model_result_csv.R | 75 ++ ...uo.csv => 20260130_dual_pam_only_fluo.csv} | 0 ...csv => 20260130_01_dual_pam_only_p700.csv} | 0 src/man/combo_plot_control.Rd | 2 +- .../eilers_peeters_default_start_value_a.Rd | 2 +- .../eilers_peeters_default_start_value_b.Rd | 2 +- .../eilers_peeters_default_start_value_c.Rd | 2 +- ...ilers_peeters_generate_regression_ETR_I.Rd | 2 +- ...lers_peeters_generate_regression_ETR_II.Rd | 2 +- src/man/eilers_peeters_modified.Rd | 2 +- src/man/platt_default_start_value_alpha.Rd | 2 +- src/man/platt_default_start_value_beta.Rd | 2 +- src/man/platt_default_start_value_ps.Rd | 2 +- src/man/platt_generate_regression_ETR_I.Rd | 2 +- src/man/platt_generate_regression_ETR_II.Rd | 2 +- src/man/platt_modified.Rd | 2 +- src/man/plot_control.Rd | 2 +- src/man/read_dual_pam_data.Rd | 110 +-- .../read_dual_pam_single_channel_fluo_data.Rd | 4 +- .../read_dual_pam_single_channel_p700_data.Rd | 4 +- src/man/read_junior_pam_data.Rd | 2 +- src/man/read_pam_2500_data.Rd | 2 +- src/man/read_universal_data.Rd | 2 +- src/man/vollenweider_default_start_value_a.Rd | 2 +- .../vollenweider_default_start_value_alpha.Rd | 2 +- src/man/vollenweider_default_start_value_n.Rd | 2 +- .../vollenweider_default_start_value_pmax.Rd | 2 +- .../vollenweider_generate_regression_ETR_I.Rd | 2 +- ...vollenweider_generate_regression_ETR_II.Rd | 2 +- src/man/vollenweider_modified.Rd | 2 +- src/man/walsby_default_start_value_alpha.Rd | 2 +- src/man/walsby_default_start_value_beta.Rd | 2 +- src/man/walsby_default_start_value_etr_max.Rd | 2 +- src/man/walsby_generate_regression_ETR_I.Rd | 2 +- src/man/walsby_generate_regression_ETR_II.Rd | 2 +- src/man/walsby_modified.Rd | 2 +- src/man/write_model_result_csv.Rd | 2 +- ...uo.csv => 20260130_dual_pam_only_fluo.csv} | 0 ...csv => 20260130_01_dual_pam_only_p700.csv} | 0 src/tests/testthat/test-read_dual_pam_data.R | 8 +- ...t-read_dual_pam_single_channel_fluo_data.R | 8 +- ...t-read_dual_pam_single_channel_p700_data.R | 8 +- 57 files changed, 1269 insertions(+), 1327 deletions(-) create mode 100644 src/R/device_dual_pam.R create mode 100644 src/R/device_dual_pam_single_channel_fluo.R create mode 100644 src/R/device_dual_pam_single_channel_p700.R create mode 100644 src/R/device_junior_pam.R create mode 100644 src/R/device_pam_2500.R create mode 100644 src/R/device_universal_data.R rename src/R/{eilers_peeters.R => model_eilers_peeters.R} (99%) rename src/R/{platt.R => model_platt.R} (99%) rename src/R/{vollenweider.R => model_vollenweider.R} (99%) rename src/R/{walsby.R => model_walsby.R} (99%) rename src/R/{combo_plot_control.R => plot.R} (52%) delete mode 100644 src/R/read_pam_data.R create mode 100644 src/R/write_model_result_csv.R rename src/inst/extdata/dual_pam_single_channel_fluo_data/{20260130_efeutute_dual_pam_only_fluo.csv => 20260130_dual_pam_only_fluo.csv} (100%) rename src/inst/extdata/dual_pam_single_channel_p700_data/{20260130_01_efeutute_dual_pam_only_p700.csv => 20260130_01_dual_pam_only_p700.csv} (100%) rename src/tests/testthat/data/dual_pam_single_channel_fluo_data/{20260130_efeutute_dual_pam_only_fluo.csv => 20260130_dual_pam_only_fluo.csv} (100%) rename src/tests/testthat/data/dual_pam_single_channel_p700_data/{20260130_01_efeutute_dual_pam_only_p700.csv => 20260130_01_dual_pam_only_p700.csv} (100%) diff --git a/src/R/compare_regression_models.R b/src/R/compare_regression_models.R index facb739..59832d2 100644 --- a/src/R/compare_regression_models.R +++ b/src/R/compare_regression_models.R @@ -116,7 +116,7 @@ compare_regression_models <- function(data_dir, etr_type, read_func) { for (file in csv_files) { title <- basename(file) data <- do.call(read_func, list(csv_path = file)) - validate_data(data) + validate_intermediate_data(data) tryCatch( { diff --git a/src/R/device_dual_pam.R b/src/R/device_dual_pam.R new file mode 100644 index 0000000..57d7677 --- /dev/null +++ b/src/R/device_dual_pam.R @@ -0,0 +1,170 @@ +#' Read and Process DualPAM Data +#' +#' Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values, and returns a universal dataset. +#' +#' @param csv_path File path to the CSV file. +#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. +#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. +#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. +#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. +#' +#' @details +#' Calculates ETR using: +#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I or II)} \cdot \text{Yield (I or II)}} +#' +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} +#' +#' @return A \code{data.table} containing: +#' \itemize{ +#' \item \code{par}: Photosynthetically active radiation. +#' \item \code{yield_1}: Yield for photosystem I. +#' \item \code{yield_2}: Yield for photosystem II. +#' \item \code{etr_1}: Calculated ETR for photosystem I. +#' \item \code{etr_2}: Calculated ETR for photosystem II. +#' } +#' +#' @references{ +#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} +#' Heinz Walz GmbH, Effeltrich, Germany. +#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} +#' } +#' @examples +#' path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") +#' data <- read_dual_pam_data(path) +#' @export +read_dual_pam_data <- function( + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { + if (fraction_photosystem_I + fraction_photosystem_II != 1) { + stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") + } + + tryCatch( + { + data <- utils::read.csv(csv_path, sep = ";", dec = ".") + data <- data.table::as.data.table(data) + + validate_dual_pam_data(data) + data <- data[data$ID == "SP", ] + + date_time_col_values <- c() + for (i in seq_len(nrow(data))) { + row <- data[i, ] + + date_time_row_value <- as.POSIXct( + paste(row$Date, row$Time, sep = " "), + tz = "GMT", "%d.%m.%y %H:%M:%S" + ) + date_time_col_values <- c(date_time_col_values, date_time_row_value) + } + + data$DateTime <- date_time_col_values + data <- data[order(data$DateTime), ] + + pm_det_row <- subset(data, data$PAR == 0 & data$Action == "Pm.-Det.") + yield_1_first <- pm_det_row$Y.I. + recalc_etr_1 <- calc_etr(yield_1_first, 0, etr_factor, fraction_photosystem_I) + + fm_det_row <- subset(data, data$PAR == 0 & data$Action == "Fm-Det.") + yield_2_first <- fm_det_row$Y.II. + recalc_etr_2 <- calc_etr(yield_2_first, 0, etr_factor, fraction_photosystem_II) + + + result <- data.table::data.table( + par = numeric(), + yield_1 = numeric(), + yield_2 = numeric(), + etr_1 = numeric(), + etr_2 = numeric() + ) + new_row <- list( + par = 0, + yield_1 = yield_1_first, + yield_2 = yield_2_first, + etr_1 = recalc_etr_1, + etr_2 = recalc_etr_2 + ) + result <- rbind(result, new_row) + + last_par <- as.numeric(0) + for (i in seq_len(nrow(data))) { + row <- data[i, ] + current_par <- row$PAR + + if (row$Action != "P.+F. SP") { + next + } + + if (remove_recovery && last_par != 0 && current_par < last_par) { + break + } + + yield_1 <- row$Y.I. + recalc_etr_1 <- calc_etr(yield_1, current_par, etr_factor, fraction_photosystem_I) + + yield_2 <- row$Y.II. + recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) + + new_row <- list( + par = current_par, + yield_1 = yield_1, + yield_2 = yield_2, + etr_1 = recalc_etr_1, + etr_2 = recalc_etr_2 + ) + result <- rbind(result, new_row) + + last_par <- current_par + } + + validate_intermediate_data(result) + return(result) + }, + warning = function(w) { + stop("Warning in file: ", csv_path, " Warning: ", w) + }, + error = function(e) { + stop("Error in file: ", csv_path, " Error: ", e) + } + ) +} + +validate_dual_pam_data <- function(data) { + validate_data_not_empty(data) + + if (!"ID" %in% colnames(data)) { + stop("required col 'ID' not found") + } + + if (!"PAR" %in% colnames(data)) { + stop("required col 'PAR' not found") + } + + if (!"Y.I." %in% colnames(data) && !"Y.II." %in% colnames(data)) { + stop("required col 'Y(I)' and 'Y(II)' not found") + } + + if (!"Action" %in% colnames(data)) { + stop("required col 'Action' not found") + } + + if (!"Date" %in% colnames(data)) { + stop("required col 'Date' not found") + } + + if (!"Time" %in% colnames(data)) { + stop("required col 'Time' not found") + } + + if (!"Pm.-Det." %in% data[["Action"]]) { + stop("required value 'Pm' not found in column 'Action'") + } + + if (!"Fm-Det." %in% data[["Action"]]) { + stop("required value 'Fm' not found in column 'Action'") + } +} diff --git a/src/R/device_dual_pam_single_channel_fluo.R b/src/R/device_dual_pam_single_channel_fluo.R new file mode 100644 index 0000000..176c3e4 --- /dev/null +++ b/src/R/device_dual_pam_single_channel_fluo.R @@ -0,0 +1,164 @@ +#' Read and Process DualPAM Data Single Chanel Mode Fluo +#' +#' Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values for Photosystem II, and returns a universal dataset. +#' +#' @param csv_path File path to the CSV file. +#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. +#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. +#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. +#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. +#' +#' @details +#' Calculates ETR using: +#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (II)} \cdot \text{Yield (II)}} +#' +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} +#' +#' @return A \code{data.table} containing: +#' \itemize{ +#' \item \code{par}: Photosynthetically active radiation. +#' \item \code{yield_1}: NA +#' \item \code{yield_2}: Yield for photosystem II. +#' \item \code{etr_1}: NA +#' \item \code{etr_2}: Calculated ETR for photosystem II. +#' } +#' +#' @references{ +#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} +#' Heinz Walz GmbH, Effeltrich, Germany. +#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} +#' } +#' @examples +#' path <- file.path( +#' system.file("extdata/dual_pam_single_channel_fluo_data", package = "pam"), +#' "20260130_dual_pam_only_fluo.csv" +#' ) +#' data <- read_dual_pam_single_channel_fluo_data(path) +#' @export +read_dual_pam_single_channel_fluo_data <- function( + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { + if (fraction_photosystem_I + fraction_photosystem_II != 1) { + stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") + } + + tryCatch( + { + data <- utils::read.csv(csv_path, sep = ";", dec = ".") + data <- data.table::as.data.table(data) + + validate_dual_pam_single_channel_fluo_data(data) + data <- data[data$ID == "SP", ] + + date_time_col_values <- c() + for (i in seq_len(nrow(data))) { + row <- data[i, ] + + date_time_row_value <- as.POSIXct( + paste(row$Date, row$Time, sep = " "), + tz = "GMT", "%d.%m.%y %H:%M:%S" + ) + date_time_col_values <- c(date_time_col_values, date_time_row_value) + } + + data$DateTime <- date_time_col_values + data <- data[order(data$DateTime), ] + + fm_det_row <- subset(data, data$PAR == 0 & data$Action == "Fm-Det.") + yield_2_first <- fm_det_row$Y.II. + recalc_etr_2 <- calc_etr( + yield_2_first, 0, etr_factor, fraction_photosystem_II + ) + + + result <- data.table::data.table( + par = numeric(), + yield_1 = numeric(), + yield_2 = numeric(), + etr_1 = numeric(), + etr_2 = numeric() + ) + new_row <- list( + par = 0, + yield_1 = NA_real_, + yield_2 = yield_2_first, + etr_1 = NA_real_, + etr_2 = recalc_etr_2 + ) + result <- rbind(result, new_row) + + last_par <- as.numeric(0) + for (i in seq_len(nrow(data))) { + row <- data[i, ] + current_par <- row$PAR + + if (row$Action != "Fluo. SP") { + next + } + + if (remove_recovery && last_par != 0 && current_par < last_par) { + break + } + + yield_2 <- row$Y.II. + recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) + + new_row <- list( + par = current_par, + yield_1 = NA_real_, + yield_2 = yield_2, + etr_1 = NA_real_, + etr_2 = recalc_etr_2 + ) + result <- rbind(result, new_row) + + last_par <- current_par + } + + validate_intermediate_data(result) + return(result) + }, + warning = function(w) { + stop("Warning in file: ", csv_path, " Warning: ", w) + }, + error = function(e) { + stop("Error in file: ", csv_path, " Error: ", e) + } + ) +} + +validate_dual_pam_single_channel_fluo_data <- function(data) { + validate_data_not_empty(data) + + if (!"ID" %in% colnames(data)) { + stop("required col 'ID' not found") + } + + if (!"PAR" %in% colnames(data)) { + stop("required col 'PAR' not found") + } + + if (!"Y.II." %in% colnames(data)) { + stop("required col 'Y(II)' not found") + } + + if (!"Action" %in% colnames(data)) { + stop("required col 'Action' not found") + } + + if (!"Date" %in% colnames(data)) { + stop("required col 'Date' not found") + } + + if (!"Time" %in% colnames(data)) { + stop("required col 'Time' not found") + } + + if (!"Fm-Det." %in% data[["Action"]]) { + stop("required value 'Fm' not found in column 'Action'") + } +} diff --git a/src/R/device_dual_pam_single_channel_p700.R b/src/R/device_dual_pam_single_channel_p700.R new file mode 100644 index 0000000..0f6ff75 --- /dev/null +++ b/src/R/device_dual_pam_single_channel_p700.R @@ -0,0 +1,162 @@ +#' Read and Process DualPAM Data Single Chanel Mode P700 +#' +#' Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values for Photosystem I, and returns a universal dataset. +#' +#' @param csv_path File path to the CSV file. +#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. +#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. +#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. +#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. +#' +#' @details +#' Calculates ETR using: +#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I)} \cdot \text{Yield (I)}} +#' +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} +#' +#' @return A \code{data.table} containing: +#' \itemize{ +#' \item \code{par}: Photosynthetically active radiation. +#' \item \code{yield_1}: Yield for photosystem I +#' \item \code{yield_2}: NA +#' \item \code{etr_1}: Calculated ETR for photosystem I +#' \item \code{etr_2}: NA +#' } +#' +#' @references{ +#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} +#' Heinz Walz GmbH, Effeltrich, Germany. +#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} +#' } +#' @examples +#' path <- file.path( +#' system.file("extdata/dual_pam_single_channel_p700_data", package = "pam"), +#' "20260130_01_dual_pam_only_p700.csv" +#' ) +#' data <- read_dual_pam_single_channel_p700_data(path) +#' @export +read_dual_pam_single_channel_p700_data <- function( + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { + if (fraction_photosystem_I + fraction_photosystem_II != 1) { + stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") + } + + tryCatch( + { + data <- utils::read.csv(csv_path, sep = ";", dec = ".") + data <- data.table::as.data.table(data) + + validate_dual_pam_single_channel_p700_data(data) + data <- data[data$ID == "SP", ] + + date_time_col_values <- c() + for (i in seq_len(nrow(data))) { + row <- data[i, ] + + date_time_row_value <- as.POSIXct( + paste(row$Date, row$Time, sep = " "), + tz = "GMT", "%d.%m.%y %H:%M:%S" + ) + date_time_col_values <- c(date_time_col_values, date_time_row_value) + } + + data$DateTime <- date_time_col_values + data <- data[order(data$DateTime), ] + + pm_det_row <- subset(data, data$PAR == 0 & data$Action == "Pm.-Det.") + yield_1_first <- pm_det_row$Y.I. + recalc_etr_1 <- calc_etr(yield_1_first, 0, etr_factor, fraction_photosystem_I) + + + result <- data.table::data.table( + par = numeric(), + yield_1 = numeric(), + yield_2 = numeric(), + etr_1 = numeric(), + etr_2 = numeric() + ) + new_row <- list( + par = 0, + yield_1 = yield_1_first, + yield_2 = NA_real_, + etr_1 = recalc_etr_1, + etr_2 = NA_real_ + ) + result <- rbind(result, new_row) + + last_par <- as.numeric(0) + for (i in seq_len(nrow(data))) { + row <- data[i, ] + current_par <- row$PAR + + if (row$Action != "P700 SP") { + next + } + + if (remove_recovery && last_par != 0 && current_par < last_par) { + break + } + + yield_1 <- row$Y.I. + recalc_etr_1 <- calc_etr(yield_1, current_par, etr_factor, fraction_photosystem_I) + + new_row <- list( + par = current_par, + yield_1 = yield_1, + yield_2 = NA_real_, + etr_1 = recalc_etr_1, + etr_2 = NA_real_ + ) + result <- rbind(result, new_row) + + last_par <- current_par + } + + validate_intermediate_data(result) + return(result) + }, + warning = function(w) { + stop("Warning in file: ", csv_path, " Warning: ", w) + }, + error = function(e) { + stop("Error in file: ", csv_path, " Error: ", e) + } + ) +} + +validate_dual_pam_single_channel_p700_data <- function(data) { + validate_data_not_empty(data) + + if (!"ID" %in% colnames(data)) { + stop("required col 'ID' not found") + } + + if (!"PAR" %in% colnames(data)) { + stop("required col 'PAR' not found") + } + + if (!"Y.I." %in% colnames(data)) { + stop("required col 'Y(I)' not found") + } + + if (!"Action" %in% colnames(data)) { + stop("required col 'Action' not found") + } + + if (!"Date" %in% colnames(data)) { + stop("required col 'Date' not found") + } + + if (!"Time" %in% colnames(data)) { + stop("required col 'Time' not found") + } + + if (!"Pm.-Det." %in% data[["Action"]]) { + stop("required value 'Pm.-Det.' not found in column 'Action'") + } +} diff --git a/src/R/device_junior_pam.R b/src/R/device_junior_pam.R new file mode 100644 index 0000000..92e8a5b --- /dev/null +++ b/src/R/device_junior_pam.R @@ -0,0 +1,125 @@ +#' Read and Process Junior PAM Data +#' +#' Reads raw CSV files generated by Junior PAM software, calculates electron transport rate (ETR) values, and returns a cleaned dataset. +#' +#' @param csv_path File path to the CSV file. +#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. +#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. +#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. +#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. +#' +#' @details +#' Calculates ETR II using: +#' \deqn{\text{ETR II} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (II)} \cdot \text{Yield (II)}} +#' +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file} +#' +#' @return A \code{data.table} containing: +#' \itemize{ +#' \item \code{par}: Photosynthetically active radiation. +#' \item \code{yield_1}: Yield for photosystem I. +#' \item \code{yield_2}: Yield for photosystem II. +#' \item \code{etr_1}: Calculated ETR for photosystem I. +#' \item \code{etr_2}: Calculated ETR for photosystem II. +#' } +#' +#' @references{ +#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} +#' Heinz Walz GmbH, Effeltrich, Germany. +#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} +#' } +#' @examples +#' path <- file.path( +#' system.file("extdata/junior_pam_data", package = "pam"), +#' "2026_04_22_junior_pam.csv" +#' ) +#' data <- read_junior_pam_data(path) +#' @export +read_junior_pam_data <- function( + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { + if (fraction_photosystem_I + fraction_photosystem_II != 1) { + stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") + } + + tryCatch( + { + data <- utils::read.csv(csv_path, sep = ";", dec = ".", skip = 1, header = TRUE) + data <- data.table::as.data.table(data) + + validate_junior_pam_data(data) + + par_col <- grep("^.+\\.PAR$", names(data), value = TRUE)[1] + yield_2_col <- grep("^.+\\.Y\\.\\.II\\.$", names(data), value = TRUE)[1] + + data <- data[data$Type == "FO" | data$Type == "F", ] + data <- data[order(data$"Time..rel.ms."), ] + + result <- data.table::data.table( + par = numeric(), + yield_1 = numeric(), + yield_2 = numeric(), + etr_1 = numeric(), + etr_2 = numeric() + ) + last_par <- as.numeric(0) + for (i in seq_len(nrow(data))) { + row <- data[i, ] + current_par <- row[[par_col]] + + if (remove_recovery && last_par != 0 && current_par < last_par) { + break + } + + yield_2 <- row[[yield_2_col]] + recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) + + new_row <- list( + par = current_par, + yield_1 = NA_real_, + yield_2 = yield_2, + etr_1 = NA_real_, + etr_2 = recalc_etr_2 + ) + result <- rbind(result, new_row) + + last_par <- current_par + } + + validate_intermediate_data(result) + return(result) + }, + warning = function(w) { + stop("Warning in file: ", csv_path, " Warning: ", w) + }, + error = function(e) { + stop("Error in file: ", csv_path, " Error: ", e) + } + ) +} + +validate_junior_pam_data <- function(data) { + validate_data_not_empty(data) + + par_cols <- grep("^.+\\.PAR$", names(data), value = TRUE) + if (length(par_cols) == 0) { + stop("required col 'PAR' not found") + } else if (length(par_cols) > 1) { + stop(paste(length(par_cols), " 'PAR' cols found. Only supporting one 'PAR' column")) + } + + yield_cols <- grep("^.+\\.Y\\.\\.II\\.$", names(data), value = TRUE) + if (length(yield_cols) == 0) { + stop("required col 'Y (II)' not found") + } else if (length(yield_cols) > 1) { + stop(paste(length(yield_cols), " 'Y (II)' cols found. Only supporting one 'Y (II)' column")) + } + + if (!"Time..rel.ms." %in% colnames(data)) { + stop("required col 'Time (rel/ms)' not found") + } +} diff --git a/src/R/device_pam_2500.R b/src/R/device_pam_2500.R new file mode 100644 index 0000000..0389338 --- /dev/null +++ b/src/R/device_pam_2500.R @@ -0,0 +1,133 @@ +#' Read and Process PAM 2500 Data +#' +#' Reads raw CSV files generated by PAM 2500 software, calculates electron transport rate (ETR) values, and returns a cleaned dataset. +#' +#' @param csv_path File path to the CSV file. +#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. +#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. +#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. +#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. +#' +#' @details +#' Calculates ETR II using: +#' \deqn{\text{ETR II} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (II)} \cdot \text{Yield (II)}} +#' +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file} +#' +#' @return A \code{data.table} containing: +#' \itemize{ +#' \item \code{par}: Photosynthetically active radiation. +#' \item \code{yield_1}: Yield for photosystem I. +#' \item \code{yield_2}: Yield for photosystem II. +#' \item \code{etr_1}: Calculated ETR for photosystem I. +#' \item \code{etr_2}: Calculated ETR for photosystem II. +#' } +#' +#' @references{ +#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} +#' Heinz Walz GmbH, Effeltrich, Germany. +#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} +#' } +#' @examples +#' path <- file.path(system.file("extdata/pam_2500_data", package = "pam"), "20260422_pam_2500.CSV") +#' data <- read_pam_2500_data(path) +#' @export +read_pam_2500_data <- function( + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) { + if (fraction_photosystem_I + fraction_photosystem_II != 1) { + stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") + } + + tryCatch( + { + data <- utils::read.csv(csv_path, sep = ";", dec = ".") + data <- data.table::as.data.table(data) + + validate_pam_2500_data(data) + data <- data[grepl("^\\d+$", data$`No.`), ] + + date_time_col_values <- c() + for (i in seq_len(nrow(data))) { + row <- data[i, ] + + date_time_row_value <- as.POSIXct( + paste(row$Date, row$Time, sep = " "), + tz = "GMT", "%d.%m.%y %H:%M:%S" + ) + date_time_col_values <- c(date_time_col_values, date_time_row_value) + } + + data$DateTime <- date_time_col_values + data <- data[order(data$DateTime), ] + + result <- data.table::data.table( + par = numeric(), + yield_1 = numeric(), + yield_2 = numeric(), + etr_1 = numeric(), + etr_2 = numeric() + ) + last_par <- as.numeric(0) + for (i in seq_len(nrow(data))) { + row <- data[i, ] + current_par <- row$PAR + + if (remove_recovery && last_par != 0 && current_par < last_par) { + break + } + + yield_2 <- row$Y.II. + recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) + + new_row <- list( + par = current_par, + yield_1 = NA_real_, + yield_2 = yield_2, + etr_1 = NA_real_, + etr_2 = recalc_etr_2 + ) + result <- rbind(result, new_row) + + last_par <- current_par + } + + validate_intermediate_data(result) + return(result) + }, + warning = function(w) { + stop("Warning in file: ", csv_path, " Warning: ", w) + }, + error = function(e) { + stop("Error in file: ", csv_path, " Error: ", e) + } + ) +} + +validate_pam_2500_data <- function(data) { + validate_data_not_empty(data) + + if (!"No." %in% colnames(data)) { + stop("required col 'No.' not found") + } + + if (!"PAR" %in% colnames(data)) { + stop("required col 'PAR' not found") + } + + if (!"Date" %in% colnames(data)) { + stop("required col 'Date' not found") + } + + if (!"Time" %in% colnames(data)) { + stop("required col 'Time' not found") + } + + if (!"Y.II." %in% colnames(data)) { + stop("required col 'Y(II)' not found") + } +} diff --git a/src/R/device_universal_data.R b/src/R/device_universal_data.R new file mode 100644 index 0000000..ddc6941 --- /dev/null +++ b/src/R/device_universal_data.R @@ -0,0 +1,93 @@ +#' Read and Process Universal PAM Data +#' +#' Reads a standardized CSV file containing PAR and yield data for photosystem I and/or II, calculates electron transport rates (ETR), and returns a cleaned and validated dataset. The function is device-agnostic but requires a predefined column structure. +#' +#' @param csv_path File path to the CSV file. +#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. +#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR +#' to photosystem I. Default is \code{0.5}. +#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR +#' to photosystem II. Default is \code{0.5}. +#' +#' @details +#' Calculates ETR using: +#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I or II)} \cdot \text{Yield (I or II)}} +#' +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_universal_data} +#' +#' @return A \code{data.table} containing: +#' \itemize{ +#' \item \code{par}: Photosynthetically active radiation. +#' \item \code{yield_1}: Yield for photosystem I. +#' \item \code{yield_2}: Yield for photosystem II. +#' \item \code{etr_1}: Calculated ETR for photosystem I. +#' \item \code{etr_2}: Calculated ETR for photosystem II. +#' } +#' +#' @references{ +#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} +#' Heinz Walz GmbH, Effeltrich, Germany. +#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} +#' } +#' @examples +#' path <- file.path(system.file("extdata", package = "pam"), "universal_data", "universal_data.csv") +#' data <- read_universal_data(path) +#' @export +read_universal_data <- function(csv_path, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5) { + if (fraction_photosystem_I + fraction_photosystem_II != 1) { + stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") + } + + data <- utils::read.csv(csv_path, sep = ";", dec = ".") + data <- data.table::as.data.table(data) + validate_universal_data(data) + + result <- data.table::data.table( + par = numeric(), + yield_1 = numeric(), + yield_2 = numeric(), + etr_1 = numeric(), + etr_2 = numeric() + ) + for (i in seq_len(nrow(data))) { + row <- data[i, ] + current_par <- row$par + + yield_1 <- row$yield_1 + recalc_etr_1 <- calc_etr(yield_1, current_par, etr_factor, fraction_photosystem_I) + + yield_2 <- row$yield_2 + recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) + + new_row <- list( + par = current_par, + yield_1 = yield_1, + yield_2 = yield_2, + etr_1 = recalc_etr_1, + etr_2 = recalc_etr_2 + ) + result <- rbind(result, new_row) + } + + validate_intermediate_data(result) + return(result) +} + +validate_universal_data <- function(data) { + validate_data_not_empty(data) + + if (!"par" %in% colnames(data)) { + stop("required col 'par' not found") + } + + if (!"yield_1" %in% colnames(data)) { + stop("required col 'yield_1' not found") + } + + if (!"yield_2" %in% colnames(data)) { + stop("required col 'yield_2' not found") + } +} diff --git a/src/R/eilers_peeters.R b/src/R/model_eilers_peeters.R similarity index 99% rename from src/R/eilers_peeters.R rename to src/R/model_eilers_peeters.R index d122966..db50ac0 100644 --- a/src/R/eilers_peeters.R +++ b/src/R/model_eilers_peeters.R @@ -132,7 +132,7 @@ eilers_peeters_generate_regression_internal <- function( ) { tryCatch( { - validate_data(data) + validate_intermediate_data(data) validate_etr_type(etr_type) if (!is.numeric(a_start_value)) { diff --git a/src/R/platt.R b/src/R/model_platt.R similarity index 99% rename from src/R/platt.R rename to src/R/model_platt.R index 19435ab..9fab2ed 100644 --- a/src/R/platt.R +++ b/src/R/model_platt.R @@ -137,7 +137,7 @@ platt_generate_regression_internal <- function( ) { tryCatch( { - validate_data(data) + validate_intermediate_data(data) validate_etr_type(etr_type) if (!is.numeric(alpha_start_value)) { diff --git a/src/R/vollenweider.R b/src/R/model_vollenweider.R similarity index 99% rename from src/R/vollenweider.R rename to src/R/model_vollenweider.R index aae0ece..485a3e8 100644 --- a/src/R/vollenweider.R +++ b/src/R/model_vollenweider.R @@ -147,7 +147,7 @@ vollenweider_generate_regression_internal <- function( tryCatch( { validate_etr_type(etr_type) - validate_data(data) + validate_intermediate_data(data) if (!is.numeric(pmax_start_value)) { stop("pmax start value is not a valid number") diff --git a/src/R/walsby.R b/src/R/model_walsby.R similarity index 99% rename from src/R/walsby.R rename to src/R/model_walsby.R index 341d0f2..b321458 100644 --- a/src/R/walsby.R +++ b/src/R/model_walsby.R @@ -136,7 +136,7 @@ walsby_generate_regression_internal <- function( beta_start_value = walsby_default_start_value_beta) { tryCatch( { - validate_data(data) + validate_intermediate_data(data) validate_etr_type(etr_type) if (!is.numeric(etr_max_start_value)) { diff --git a/src/R/combo_plot_control.R b/src/R/plot.R similarity index 52% rename from src/R/combo_plot_control.R rename to src/R/plot.R index c2c12ea..a3a88e3 100644 --- a/src/R/combo_plot_control.R +++ b/src/R/plot.R @@ -36,7 +36,7 @@ combo_plot_control <- function( name_list, color_list ) { - validate_data(data) + validate_intermediate_data(data) if (length(model_results) <= 0) { stop("empty model_results") @@ -228,3 +228,213 @@ combo_plot_control <- function( return(plot) } + + +plot_table <- function(model_result, entries_per_row) { + validate_model_result(model_result) + + custom_theme <- gridExtra::ttheme_minimal( + core = list( + fg_params = list( + cex = 0.7, + fontface = 3 + ), + bg_params = list( + fill = "lightgray", + col = "black" + ) + ), # font size for cell text + colhead = list( + fg_params = list(cex = 0.7), + bg_params = list( + fill = "lightgray", + col = "black" + ) + ), # font size for column headers + rowhead = list( + fg_params = list(cex = 0.7), + bg_params = list( + fill = "lightgray", + col = "black" + ) + ), # font size for row headers + ) + + tbl_list <- list() + row <- NULL + + row_count <- 1 + count <- 1 + + for (i in names(model_result)) { + if (i == "etr_type" || i == "etr_regression_data") { + next() + } + + value <- model_result[[i]] + + if (is.null(row)) { + row <- data.frame(tmp = NA) + } + + row[[i]] <- c(value) + + if (count == entries_per_row) { + row$tmp <- NULL + tbl_list[[row_count]] <- gridExtra::tableGrob( + row, + rows = NULL, + theme = custom_theme + ) + + row <- NULL + row_count <- row_count + 1 + count <- 1 + } else { + count <- count + 1 + } + } + + if (is.null(row) == FALSE) { + row$tmp <- NULL + tbl_list[[row_count]] <- gridExtra::tableGrob( + row, + rows = NULL, + theme = custom_theme + ) + } + + tbl <- cowplot::plot_grid( + plotlist = tbl_list, + ncol = 1 + ) + return(tbl) +} + +#' @title Plot Control +#' @description This function creates a control plot for the used model based on the provided data and model results. +#' +#' @param data A `data.table` containing the original ETR and yield data for the plot. +#' @param model_result A list containing the fitting results of the used model and the calculated parameters. +#' @param title A character string that specifies the title of the plot. +#' @param color A color specification for the regression line in the plot. +#' +#' @details +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#plot_control} +#' +#' @return A plot displaying the original ETR and Yield values and the regression data. A table below the plot shows the calculated data. +#' +#' @examples +#' path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") +#' data <- read_dual_pam_data(path) +#' +#' result <- eilers_peeters_generate_regression_ETR_I(data) +#' plot_control(data, result, "Control Plot") +#' +#' @export +plot_control <- function( + data, + model_result, + title, + color = "black" +) { + validate_intermediate_data(data) + validate_model_result(model_result) + + etr_type <- get_etr_type_from_model_result(model_result) + validate_etr_type(etr_type) + + yield <- NA_real_ + yield_name <- "" + if (etr_type == etr_1_type) { + yield <- "yield_1" + yield_name <- "Y(I)" + } else { + yield <- "yield_2" + yield_name <- "Y(II)" + } + + etr_regression_data <- get_etr_regression_data_from_model_result(model_result) + validate_etr_regression_data(etr_regression_data) + + max_etr <- max(etr_regression_data$prediction) + + plot <- ggplot2::ggplot(data, ggplot2::aes(x = data$par, y = get(etr_type))) + + ggplot2::geom_point() + + ggplot2::geom_line( + data = etr_regression_data, + ggplot2::aes( + x = etr_regression_data$par, + y = etr_regression_data$prediction + ), + color = color + ) + + ggplot2::geom_point(data = data, shape = 17, ggplot2::aes(y = get(yield) * max_etr)) + + ggplot2::geom_line(data = data, ggplot2::aes(y = get(yield) * max_etr)) + + ggplot2::labs(x = par_label, y = etr_label, title = eval(title)) + + ggplot2::scale_y_continuous( + sec.axis = ggplot2::sec_axis(~ . / max_etr, name = yield_name) + ) + + ggthemes::theme_base() + + ggplot2::theme( + plot.background = ggplot2::element_rect(fill = "white", color = NA), + panel.background = ggplot2::element_rect(fill = "white", color = NA) + ) + + + tbl <- plot_table(model_result, 4) + + plot <- cowplot::plot_grid( + plot, + tbl, + ncol = 1, + rel_heights = c(0.7, 0.3) + ) + return(plot) +} + +create_modified_model_result <- function( + etr_type, + etr_regression_data, + residual_sum_of_squares, + root_mean_squared_error, + relative_root_mean_squared_error, + a, + b, + c, + d, + alpha, + beta, + etrmax_with_photoinhibition, + etrmax_without_photoinhibition, + ik_with_photoinhibition, + ik_without_photoinhibition, + im_with_photoinhibition, + w, + ib, + etrmax_without_with_ratio +) { + result <- list( + etr_type = etr_type, + etr_regression_data = etr_regression_data, + residual_sum_of_squares = residual_sum_of_squares, + root_mean_squared_error = root_mean_squared_error, + relative_root_mean_squared_error = relative_root_mean_squared_error, + a = a, + b = b, + c = c, + d = d, + alpha = alpha, + beta = beta, + etrmax_with_photoinhibition = etrmax_with_photoinhibition, + etrmax_without_photoinhibition = etrmax_without_photoinhibition, + ik_with_photoinhibition = ik_with_photoinhibition, + ik_without_photoinhibition = ik_without_photoinhibition, + im_with_photoinhibition = im_with_photoinhibition, + w = w, + ib = ib, + etrmax_without_with_ratio = etrmax_without_with_ratio + ) + validate_modified_model_result(result) + return(result) +} diff --git a/src/R/read_pam_data.R b/src/R/read_pam_data.R deleted file mode 100644 index 139288b..0000000 --- a/src/R/read_pam_data.R +++ /dev/null @@ -1,711 +0,0 @@ -#' Read and Process Universal PAM Data -#' -#' Reads a standardized CSV file containing PAR and yield data for photosystem I and/or II, calculates electron transport rates (ETR), and returns a cleaned and validated dataset. The function is device-agnostic but requires a predefined column structure. -#' -#' @param csv_path File path to the CSV file. -#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. -#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR -#' to photosystem I. Default is \code{0.5}. -#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR -#' to photosystem II. Default is \code{0.5}. -#' -#' @details -#' Calculates ETR using: -#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I or II)} \cdot \text{Yield (I or II)}} -#' -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_universal_data} -#' -#' @return A \code{data.table} containing: -#' \itemize{ -#' \item \code{par}: Photosynthetically active radiation. -#' \item \code{yield_1}: Yield for photosystem I. -#' \item \code{yield_2}: Yield for photosystem II. -#' \item \code{etr_1}: Calculated ETR for photosystem I. -#' \item \code{etr_2}: Calculated ETR for photosystem II. -#' } -#' -#' @references{ -#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} -#' Heinz Walz GmbH, Effeltrich, Germany. -#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} -#' } -#' @examples -#' path <- file.path(system.file("extdata", package = "pam"), "universal_data", "universal_data.csv") -#' data <- read_universal_data(path) -#' @export -read_universal_data <- function(csv_path, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5) { - if (fraction_photosystem_I + fraction_photosystem_II != 1) { - stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") - } - - data <- utils::read.csv(csv_path, sep = ";", dec = ".") - data <- data.table::as.data.table(data) - validate_raw_intermediate_csv(data) - - result <- data.table::data.table( - par = numeric(), - yield_1 = numeric(), - yield_2 = numeric(), - etr_1 = numeric(), - etr_2 = numeric() - ) - for (i in seq_len(nrow(data))) { - row <- data[i, ] - current_par <- row$par - - yield_1 <- row$yield_1 - recalc_etr_1 <- calc_etr(yield_1, current_par, etr_factor, fraction_photosystem_I) - - yield_2 <- row$yield_2 - recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) - - new_row <- list( - par = current_par, - yield_1 = yield_1, - yield_2 = yield_2, - etr_1 = recalc_etr_1, - etr_2 = recalc_etr_2 - ) - result <- rbind(result, new_row) - } - - validate_data(result) - return(result) -} - -#' Read and Process DualPAM Data -#' -#' Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values, and returns a universal dataset. -#' -#' @param csv_path File path to the CSV file. -#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. -#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. -#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. -#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. -#' -#' @details -#' Calculates ETR using: -#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I or II)} \cdot \text{Yield (I or II)}} -#' -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} -#' -#' @return A \code{data.table} containing: -#' \itemize{ -#' \item \code{par}: Photosynthetically active radiation. -#' \item \code{yield_1}: Yield for photosystem I. -#' \item \code{yield_2}: Yield for photosystem II. -#' \item \code{etr_1}: Calculated ETR for photosystem I. -#' \item \code{etr_2}: Calculated ETR for photosystem II. -#' } -#' -#' @references{ -#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} -#' Heinz Walz GmbH, Effeltrich, Germany. -#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} -#' } -#' @examples -#' path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") -#' data <- read_dual_pam_data(path) -#' @export -read_dual_pam_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { - if (fraction_photosystem_I + fraction_photosystem_II != 1) { - stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") - } - - tryCatch( - { - data <- utils::read.csv(csv_path, sep = ";", dec = ".") - data <- data.table::as.data.table(data) - - validate_dual_pam_data(data) - data <- data[data$ID == "SP", ] - - date_time_col_values <- c() - for (i in seq_len(nrow(data))) { - row <- data[i, ] - - date_time_row_value <- as.POSIXct( - paste(row$Date, row$Time, sep = " "), - tz = "GMT", "%d.%m.%y %H:%M:%S" - ) - date_time_col_values <- c(date_time_col_values, date_time_row_value) - } - - data$DateTime <- date_time_col_values - data <- data[order(data$DateTime), ] - - pm_det_row <- subset(data, data$PAR == 0 & data$Action == "Pm.-Det.") - yield_1_first <- pm_det_row$Y.I. - recalc_etr_1 <- calc_etr(yield_1_first, 0, etr_factor, fraction_photosystem_I) - - fm_det_row <- subset(data, data$PAR == 0 & data$Action == "Fm-Det.") - yield_2_first <- fm_det_row$Y.II. - recalc_etr_2 <- calc_etr(yield_2_first, 0, etr_factor, fraction_photosystem_II) - - - result <- data.table::data.table( - par = numeric(), - yield_1 = numeric(), - yield_2 = numeric(), - etr_1 = numeric(), - etr_2 = numeric() - ) - new_row <- list( - par = 0, - yield_1 = yield_1_first, - yield_2 = yield_2_first, - etr_1 = recalc_etr_1, - etr_2 = recalc_etr_2 - ) - result <- rbind(result, new_row) - - last_par <- as.numeric(0) - for (i in seq_len(nrow(data))) { - row <- data[i, ] - current_par <- row$PAR - - if (row$Action != "P.+F. SP") { - next - } - - if (remove_recovery && last_par != 0 && current_par < last_par) { - break - } - - yield_1 <- row$Y.I. - recalc_etr_1 <- calc_etr(yield_1, current_par, etr_factor, fraction_photosystem_I) - - yield_2 <- row$Y.II. - recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) - - new_row <- list( - par = current_par, - yield_1 = yield_1, - yield_2 = yield_2, - etr_1 = recalc_etr_1, - etr_2 = recalc_etr_2 - ) - result <- rbind(result, new_row) - - last_par <- current_par - } - - validate_data(result) - return(result) - }, - warning = function(w) { - stop("Warning in file: ", csv_path, " Warning: ", w) - }, - error = function(e) { - stop("Error in file: ", csv_path, " Error: ", e) - } - ) -} - -#' Read and Process DualPAM Data Single Chanel Mode P700 -#' -#' Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values for Photosystem I, and returns a universal dataset. -#' -#' @param csv_path File path to the CSV file. -#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. -#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. -#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. -#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. -#' -#' @details -#' Calculates ETR using: -#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I)} \cdot \text{Yield (I)}} -#' -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} -#' -#' @return A \code{data.table} containing: -#' \itemize{ -#' \item \code{par}: Photosynthetically active radiation. -#' \item \code{yield_1}: Yield for photosystem I -#' \item \code{yield_2}: NA -#' \item \code{etr_1}: Calculated ETR for photosystem I -#' \item \code{etr_2}: NA -#' } -#' -#' @references{ -#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} -#' Heinz Walz GmbH, Effeltrich, Germany. -#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} -#' } -#' @examples -#' path <- file.path( -#' system.file("extdata/dual_pam_single_channel_p700_data", package = "pam"), -#' "20260130_01_efeutute_dual_pam_only_p700.csv" -#' ) -#' data <- read_dual_pam_single_channel_p700_data(path) -#' @export -read_dual_pam_single_channel_p700_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { - if (fraction_photosystem_I + fraction_photosystem_II != 1) { - stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") - } - - tryCatch( - { - data <- utils::read.csv(csv_path, sep = ";", dec = ".") - data <- data.table::as.data.table(data) - - validate_dual_pam_single_channel_p700_data(data) - data <- data[data$ID == "SP", ] - - date_time_col_values <- c() - for (i in seq_len(nrow(data))) { - row <- data[i, ] - - date_time_row_value <- as.POSIXct( - paste(row$Date, row$Time, sep = " "), - tz = "GMT", "%d.%m.%y %H:%M:%S" - ) - date_time_col_values <- c(date_time_col_values, date_time_row_value) - } - - data$DateTime <- date_time_col_values - data <- data[order(data$DateTime), ] - - pm_det_row <- subset(data, data$PAR == 0 & data$Action == "Pm.-Det.") - yield_1_first <- pm_det_row$Y.I. - recalc_etr_1 <- calc_etr(yield_1_first, 0, etr_factor, fraction_photosystem_I) - - - result <- data.table::data.table( - par = numeric(), - yield_1 = numeric(), - yield_2 = numeric(), - etr_1 = numeric(), - etr_2 = numeric() - ) - new_row <- list( - par = 0, - yield_1 = yield_1_first, - yield_2 = NA_real_, - etr_1 = recalc_etr_1, - etr_2 = NA_real_ - ) - result <- rbind(result, new_row) - - last_par <- as.numeric(0) - for (i in seq_len(nrow(data))) { - row <- data[i, ] - current_par <- row$PAR - - if (row$Action != "P700 SP") { - next - } - - if (remove_recovery && last_par != 0 && current_par < last_par) { - break - } - - yield_1 <- row$Y.I. - recalc_etr_1 <- calc_etr(yield_1, current_par, etr_factor, fraction_photosystem_I) - - new_row <- list( - par = current_par, - yield_1 = yield_1, - yield_2 = NA_real_, - etr_1 = recalc_etr_1, - etr_2 = NA_real_ - ) - result <- rbind(result, new_row) - - last_par <- current_par - } - - validate_data(result) - return(result) - }, - warning = function(w) { - stop("Warning in file: ", csv_path, " Warning: ", w) - }, - error = function(e) { - stop("Error in file: ", csv_path, " Error: ", e) - } - ) -} - -#' Read and Process DualPAM Data Single Chanel Mode Fluo -#' -#' Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values for Photosystem II, and returns a universal dataset. -#' -#' @param csv_path File path to the CSV file. -#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. -#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. -#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. -#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. -#' -#' @details -#' Calculates ETR using: -#' \deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (II)} \cdot \text{Yield (II)}} -#' -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} -#' -#' @return A \code{data.table} containing: -#' \itemize{ -#' \item \code{par}: Photosynthetically active radiation. -#' \item \code{yield_1}: NA -#' \item \code{yield_2}: Yield for photosystem II. -#' \item \code{etr_1}: NA -#' \item \code{etr_2}: Calculated ETR for photosystem II. -#' } -#' -#' @references{ -#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} -#' Heinz Walz GmbH, Effeltrich, Germany. -#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} -#' } -#' @examples -#' path <- file.path( -#' system.file("extdata/dual_pam_single_channel_fluo_data", package = "pam"), -#' "20260130_efeutute_dual_pam_only_fluo.csv" -#' ) -#' data <- read_dual_pam_single_channel_fluo_data(path) -#' @export -read_dual_pam_single_channel_fluo_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { - if (fraction_photosystem_I + fraction_photosystem_II != 1) { - stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") - } - - tryCatch( - { - data <- utils::read.csv(csv_path, sep = ";", dec = ".") - data <- data.table::as.data.table(data) - - validate_dual_pam_single_channel_fluo_data(data) - data <- data[data$ID == "SP", ] - - date_time_col_values <- c() - for (i in seq_len(nrow(data))) { - row <- data[i, ] - - date_time_row_value <- as.POSIXct( - paste(row$Date, row$Time, sep = " "), - tz = "GMT", "%d.%m.%y %H:%M:%S" - ) - date_time_col_values <- c(date_time_col_values, date_time_row_value) - } - - data$DateTime <- date_time_col_values - data <- data[order(data$DateTime), ] - - fm_det_row <- subset(data, data$PAR == 0 & data$Action == "Fm-Det.") - yield_2_first <- fm_det_row$Y.II. - recalc_etr_2 <- calc_etr( - yield_2_first, 0, etr_factor, fraction_photosystem_II - ) - - - result <- data.table::data.table( - par = numeric(), - yield_1 = numeric(), - yield_2 = numeric(), - etr_1 = numeric(), - etr_2 = numeric() - ) - new_row <- list( - par = 0, - yield_1 = NA_real_, - yield_2 = yield_2_first, - etr_1 = NA_real_, - etr_2 = recalc_etr_2 - ) - result <- rbind(result, new_row) - - last_par <- as.numeric(0) - for (i in seq_len(nrow(data))) { - row <- data[i, ] - current_par <- row$PAR - - if (row$Action != "Fluo. SP") { - next - } - - if (remove_recovery && last_par != 0 && current_par < last_par) { - break - } - - yield_2 <- row$Y.II. - recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) - - new_row <- list( - par = current_par, - yield_1 = NA_real_, - yield_2 = yield_2, - etr_1 = NA_real_, - etr_2 = recalc_etr_2 - ) - result <- rbind(result, new_row) - - last_par <- current_par - } - - validate_data(result) - return(result) - }, - warning = function(w) { - stop("Warning in file: ", csv_path, " Warning: ", w) - }, - error = function(e) { - stop("Error in file: ", csv_path, " Error: ", e) - } - ) -} - -calc_etr <- function(yield, par, etr_factor, p_ratio) { - if (is.na(yield)) { - return(NA_real_) - } - - if (!is.numeric(yield)) { - stop("yield is not numeric") - } - - if (!is.numeric(par)) { - stop("par is not numeric") - } - - if (!is.numeric(etr_factor)) { - stop("etr_factor is not numeric") - } - - if (!is.numeric(p_ratio)) { - stop("p_ratio is not numeric") - } - - return(yield * par * etr_factor * p_ratio) -} - -#' Read and Process Junior PAM Data -#' -#' Reads raw CSV files generated by Junior PAM software, calculates electron transport rate (ETR) values, and returns a cleaned dataset. -#' -#' @param csv_path File path to the CSV file. -#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. -#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. -#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. -#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. -#' -#' @details -#' Calculates ETR II using: -#' \deqn{\text{ETR II} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (II)} \cdot \text{Yield (II)}} -#' -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file} -#' -#' @return A \code{data.table} containing: -#' \itemize{ -#' \item \code{par}: Photosynthetically active radiation. -#' \item \code{yield_1}: Yield for photosystem I. -#' \item \code{yield_2}: Yield for photosystem II. -#' \item \code{etr_1}: Calculated ETR for photosystem I. -#' \item \code{etr_2}: Calculated ETR for photosystem II. -#' } -#' -#' @references{ -#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} -#' Heinz Walz GmbH, Effeltrich, Germany. -#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} -#' } -#' @examples -#' path <- file.path( -#' system.file("extdata/junior_pam_data", package = "pam"), -#' "2026_04_22_junior_pam.csv" -#' ) -#' data <- read_junior_pam_data(path) -#' @export -read_junior_pam_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { - if (fraction_photosystem_I + fraction_photosystem_II != 1) { - stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") - } - - tryCatch( - { - data <- utils::read.csv(csv_path, sep = ";", dec = ".", skip = 1, header = TRUE) - data <- data.table::as.data.table(data) - - validate_junior_pam_data(data) - - par_col <- grep("^.+\\.PAR$", names(data), value = TRUE)[1] - yield_2_col <- grep("^.+\\.Y\\.\\.II\\.$", names(data), value = TRUE)[1] - - data <- data[data$Type == "FO" | data$Type == "F", ] - data <- data[order(data$"Time..rel.ms."), ] - - result <- data.table::data.table( - par = numeric(), - yield_1 = numeric(), - yield_2 = numeric(), - etr_1 = numeric(), - etr_2 = numeric() - ) - last_par <- as.numeric(0) - for (i in seq_len(nrow(data))) { - row <- data[i, ] - current_par <- row[[par_col]] - - if (remove_recovery && last_par != 0 && current_par < last_par) { - break - } - - yield_2 <- row[[yield_2_col]] - recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) - - new_row <- list( - par = current_par, - yield_1 = NA_real_, - yield_2 = yield_2, - etr_1 = NA_real_, - etr_2 = recalc_etr_2 - ) - result <- rbind(result, new_row) - - last_par <- current_par - } - - return(result) - }, - warning = function(w) { - stop("Warning in file: ", csv_path, " Warning: ", w) - }, - error = function(e) { - stop("Error in file: ", csv_path, " Error: ", e) - } - ) -} - -#' Read and Process PAM 2500 Data -#' -#' Reads raw CSV files generated by PAM 2500 software, calculates electron transport rate (ETR) values, and returns a cleaned dataset. -#' -#' @param csv_path File path to the CSV file. -#' @param remove_recovery Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}. -#' @param etr_factor Numeric. Factor for ETR calculation. Default is \code{0.84}. -#' @param fraction_photosystem_I Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}. -#' @param fraction_photosystem_II Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}. -#' -#' @details -#' Calculates ETR II using: -#' \deqn{\text{ETR II} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (II)} \cdot \text{Yield (II)}} -#' -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file} -#' -#' @return A \code{data.table} containing: -#' \itemize{ -#' \item \code{par}: Photosynthetically active radiation. -#' \item \code{yield_1}: Yield for photosystem I. -#' \item \code{yield_2}: Yield for photosystem II. -#' \item \code{etr_1}: Calculated ETR for photosystem I. -#' \item \code{etr_2}: Calculated ETR for photosystem II. -#' } -#' -#' @references{ -#' Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} -#' Heinz Walz GmbH, Effeltrich, Germany. -#' Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} -#' } -#' @examples -#' path <- file.path(system.file("extdata/pam_2500_data", package = "pam"), "20260422_pam_2500.CSV") -#' data <- read_pam_2500_data(path) -#' @export -read_pam_2500_data <- function( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) { - if (fraction_photosystem_I + fraction_photosystem_II != 1) { - stop("The sum of fraction_photosystem_I and fraction_photosystem_II must be equal 1.") - } - - tryCatch( - { - data <- utils::read.csv(csv_path, sep = ";", dec = ".") - data <- data.table::as.data.table(data) - - validate_pam_2500_data(data) - data <- data[grepl("^\\d+$", data$`No.`), ] - - date_time_col_values <- c() - for (i in seq_len(nrow(data))) { - row <- data[i, ] - - date_time_row_value <- as.POSIXct( - paste(row$Date, row$Time, sep = " "), - tz = "GMT", "%d.%m.%y %H:%M:%S" - ) - date_time_col_values <- c(date_time_col_values, date_time_row_value) - } - - data$DateTime <- date_time_col_values - data <- data[order(data$DateTime), ] - - result <- data.table::data.table( - par = numeric(), - yield_1 = numeric(), - yield_2 = numeric(), - etr_1 = numeric(), - etr_2 = numeric() - ) - last_par <- as.numeric(0) - for (i in seq_len(nrow(data))) { - row <- data[i, ] - current_par <- row$PAR - - if (remove_recovery && last_par != 0 && current_par < last_par) { - break - } - - yield_2 <- row$Y.II. - recalc_etr_2 <- calc_etr(yield_2, current_par, etr_factor, fraction_photosystem_II) - - new_row <- list( - par = current_par, - yield_1 = NA_real_, - yield_2 = yield_2, - etr_1 = NA_real_, - etr_2 = recalc_etr_2 - ) - result <- rbind(result, new_row) - - last_par <- current_par - } - return(result) - }, - warning = function(w) { - stop("Warning in file: ", csv_path, " Warning: ", w) - }, - error = function(e) { - stop("Error in file: ", csv_path, " Error: ", e) - } - ) -} diff --git a/src/R/util.R b/src/R/util.R index 1afb041..852dc93 100644 --- a/src/R/util.R +++ b/src/R/util.R @@ -30,291 +30,8 @@ get_residual_sum_of_squares_from_model_result <- function(model_result) { return(model_result[["residual_sum_of_squares"]]) } -plot_table <- function(model_result, entries_per_row) { - validate_model_result(model_result) - - custom_theme <- gridExtra::ttheme_minimal( - core = list( - fg_params = list( - cex = 0.7, - fontface = 3 - ), - bg_params = list( - fill = "lightgray", - col = "black" - ) - ), # font size for cell text - colhead = list( - fg_params = list(cex = 0.7), - bg_params = list( - fill = "lightgray", - col = "black" - ) - ), # font size for column headers - rowhead = list( - fg_params = list(cex = 0.7), - bg_params = list( - fill = "lightgray", - col = "black" - ) - ), # font size for row headers - ) - - tbl_list <- list() - row <- NULL - - row_count <- 1 - count <- 1 - - for (i in names(model_result)) { - if (i == "etr_type" || i == "etr_regression_data") { - next() - } - - value <- model_result[[i]] - - if (is.null(row)) { - row <- data.frame(tmp = NA) - } - - row[[i]] <- c(value) - - if (count == entries_per_row) { - row$tmp <- NULL - tbl_list[[row_count]] <- gridExtra::tableGrob( - row, - rows = NULL, - theme = custom_theme - ) - - row <- NULL - row_count <- row_count + 1 - count <- 1 - } else { - count <- count + 1 - } - } - - if (is.null(row) == FALSE) { - row$tmp <- NULL - tbl_list[[row_count]] <- gridExtra::tableGrob( - row, - rows = NULL, - theme = custom_theme - ) - } - - tbl <- cowplot::plot_grid( - plotlist = tbl_list, - ncol = 1 - ) - return(tbl) -} - -#' @title Plot Control -#' @description This function creates a control plot for the used model based on the provided data and model results. -#' -#' @param data A `data.table` containing the original ETR and yield data for the plot. -#' @param model_result A list containing the fitting results of the used model and the calculated parameters. -#' @param title A character string that specifies the title of the plot. -#' @param color A color specification for the regression line in the plot. -#' -#' @details -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#plot_control} -#' -#' @return A plot displaying the original ETR and Yield values and the regression data. A table below the plot shows the calculated data. -#' -#' @examples -#' path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") -#' data <- read_dual_pam_data(path) -#' -#' result <- eilers_peeters_generate_regression_ETR_I(data) -#' plot_control(data, result, "Control Plot") -#' -#' @export -plot_control <- function( - data, - model_result, - title, - color = "black") { - validate_data(data) - validate_model_result(model_result) - - etr_type <- get_etr_type_from_model_result(model_result) - validate_etr_type(etr_type) - - yield <- NA_real_ - yield_name <- "" - if (etr_type == etr_1_type) { - yield <- "yield_1" - yield_name <- "Y(I)" - } else { - yield <- "yield_2" - yield_name <- "Y(II)" - } - - etr_regression_data <- get_etr_regression_data_from_model_result(model_result) - validate_etr_regression_data(etr_regression_data) - - max_etr <- max(etr_regression_data$prediction) - - plot <- ggplot2::ggplot(data, ggplot2::aes(x = data$par, y = get(etr_type))) + - ggplot2::geom_point() + - ggplot2::geom_line( - data = etr_regression_data, - ggplot2::aes( - x = etr_regression_data$par, - y = etr_regression_data$prediction - ), - color = color - ) + - ggplot2::geom_point(data = data, shape = 17, ggplot2::aes(y = get(yield) * max_etr)) + - ggplot2::geom_line(data = data, ggplot2::aes(y = get(yield) * max_etr)) + - ggplot2::labs(x = par_label, y = etr_label, title = eval(title)) + - ggplot2::scale_y_continuous( - sec.axis = ggplot2::sec_axis(~ . / max_etr, name = yield_name) - ) + - ggthemes::theme_base() + - ggplot2::theme( - plot.background = ggplot2::element_rect(fill = "white", color = NA), - panel.background = ggplot2::element_rect(fill = "white", color = NA) - ) - - - tbl <- plot_table(model_result, 4) - - plot <- cowplot::plot_grid( - plot, - tbl, - ncol = 1, - rel_heights = c(0.7, 0.3) - ) - return(plot) -} - -create_modified_model_result <- function( - etr_type, - etr_regression_data, - residual_sum_of_squares, - root_mean_squared_error, - relative_root_mean_squared_error, - a, - b, - c, - d, - alpha, - beta, - etrmax_with_photoinhibition, - etrmax_without_photoinhibition, - ik_with_photoinhibition, - ik_without_photoinhibition, - im_with_photoinhibition, - w, - ib, - etrmax_without_with_ratio) { - result <- list( - etr_type = etr_type, - etr_regression_data = etr_regression_data, - residual_sum_of_squares = residual_sum_of_squares, - root_mean_squared_error = root_mean_squared_error, - relative_root_mean_squared_error = relative_root_mean_squared_error, - a = a, - b = b, - c = c, - d = d, - alpha = alpha, - beta = beta, - etrmax_with_photoinhibition = etrmax_with_photoinhibition, - etrmax_without_photoinhibition = etrmax_without_photoinhibition, - ik_with_photoinhibition = ik_with_photoinhibition, - ik_without_photoinhibition = ik_without_photoinhibition, - im_with_photoinhibition = im_with_photoinhibition, - w = w, - ib = ib, - etrmax_without_with_ratio = etrmax_without_with_ratio - ) - validate_modified_model_result(result) - return(result) -} - -#' Write Model Result CSV -#' @description -#' This function exports the intermediate data table, regression data, and model parameters into separate CSV files for easy access and further analysis. -#' -#' @param dest_dir A character string specifying the directory where the CSV files will be saved. -#' @param name A character string specifying the base name for the output files. -#' @param data A data.table containing the intermediate data used in the model. -#' @param model_result A list containing the model results, including parameter values and regression data. -#' -#' @details -#' This function generates three CSV files: -#' \enumerate{ -#' \item \strong{raw_data.csv:} Contains the original raw data used in the model. -#' \item \strong{regression_data.csv:} Includes the regression data with predicted electron transport rate (ETR) values. -#' \item \strong{model_result.csv:} Summarizes the parameter values derived from the model results (excluding regression data), such as \code{alpha} or \code{beta}. -#' } -#' The `name` parameter serves as a prefix for each file, ensuring clarity and organization in the output directory. -#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#write_model_result_csv} -#' -#' @return No return value, called for side effects -#' -#' @examples -#' path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") -#' data <- read_dual_pam_data(path) -#' -#' result <- eilers_peeters_generate_regression_ETR_I(data) -#' write_model_result_csv(tempdir(), "20240925", data, result) -#' -#' @export -write_model_result_csv <- function(dest_dir, name, data, model_result) { - data_dest <- file.path(dest_dir, paste(name, "_raw_data.csv", sep = "")) - regression_data_dest <- file.path(dest_dir, paste(name, "_regression_data.csv", sep = "")) - model_result_dest <- file.path(dest_dir, paste(name, "_model_result.csv", sep = "")) - - utils::write.csv( - data, - file = data_dest, - quote = TRUE, - row.names = FALSE - ) - - utils::write.csv( - get_etr_regression_data_from_model_result(model_result), - file = regression_data_dest, - quote = TRUE, - row.names = FALSE - ) - - df <- data.frame() - df[1, ] <- NA - - for (n in names(model_result)) { - if (n == "etr_regression_data" || n == "etr_type") { - next() - } - - entry <- data.frame( - stats::setNames( - list( - c(model_result[[n]]) - ), - c(n) - ) - ) - - df <- cbind(df, NewCol = entry) - } - - utils::write.csv( - df, - file = model_result_dest, - quote = TRUE, - row.names = FALSE - ) -} - get_etr_data_for_par_values <- function(data, etr_regression_data, etr_type) { - validate_data(data) + validate_intermediate_data(data) validate_etr_regression_data(etr_regression_data) validate_etr_type(etr_type) @@ -345,3 +62,27 @@ relative_root_mean_squared_error <- function(measured_predicted_etr_data) { relative_root_mean_squared_error <- root_mean_squared_error / mean(predicted_etr) return(relative_root_mean_squared_error) } + +calc_etr <- function(yield, par, etr_factor, p_ratio) { + if (is.na(yield)) { + return(NA_real_) + } + + if (!is.numeric(yield)) { + stop("yield is not numeric") + } + + if (!is.numeric(par)) { + stop("par is not numeric") + } + + if (!is.numeric(etr_factor)) { + stop("etr_factor is not numeric") + } + + if (!is.numeric(p_ratio)) { + stop("p_ratio is not numeric") + } + + return(yield * par * etr_factor * p_ratio) +} diff --git a/src/R/validation.R b/src/R/validation.R index 8fdce1a..cd45ac3 100644 --- a/src/R/validation.R +++ b/src/R/validation.R @@ -1,4 +1,4 @@ -validate_data <- function(data) { +validate_intermediate_data <- function(data) { if (is.null(data)) { stop("data is null") } @@ -28,7 +28,7 @@ validate_data <- function(data) { } } -validate_raw_intermediate_csv <- function(data) { +validate_data_not_empty <- function(data) { if (is.null(data)) { stop("data is null") } @@ -37,233 +37,13 @@ validate_raw_intermediate_csv <- function(data) { stop("data is not a valid data.table") } - if (!"par" %in% colnames(data)) { - stop("required col 'par' not found") - } - - if (!"yield_1" %in% colnames(data)) { - stop("required col 'yield_1' not found") - } - - if (!"yield_2" %in% colnames(data)) { - stop("required col 'yield_2' not found") - } -} - -validate_dual_pam_data <- function(data) { - if (is.null(data)) { - stop("data is null") - } - - if (!data.table::is.data.table(data)) { - stop("data is not a valid data.table") - } - - if (nrow(data) < 2) { - stop("no data rows") + if (nrow(data) == 0) { + stop("no rows in data") } if (ncol(data) == 0) { stop("no cols in data") } - - if (!"ID" %in% colnames(data)) { - stop("required col 'ID' not found") - } - - if (!"PAR" %in% colnames(data)) { - stop("required col 'PAR' not found") - } - - if (!"Y.I." %in% colnames(data) && !"Y.II." %in% colnames(data)) { - stop("required col 'Y(I)' and 'Y(II)' not found") - } - - if (!"Action" %in% colnames(data)) { - stop("required col 'Action' not found") - } - - if (!"Date" %in% colnames(data)) { - stop("required col 'Date' not found") - } - - if (!"Time" %in% colnames(data)) { - stop("required col 'Time' not found") - } - - if (!"Pm.-Det." %in% data[["Action"]]) { - stop("required value 'Pm' not found in column 'Action'") - } - - if (!"Fm-Det." %in% data[["Action"]]) { - stop("required value 'Fm' not found in column 'Action'") - } -} - -validate_dual_pam_single_channel_p700_data <- function(data) { - if (is.null(data)) { - stop("data is null") - } - - if (!data.table::is.data.table(data)) { - stop("data is not a valid data.table") - } - - if (nrow(data) < 2) { - stop("no data rows") - } - - if (ncol(data) == 0) { - stop("no cols in data") - } - - if (!"ID" %in% colnames(data)) { - stop("required col 'ID' not found") - } - - if (!"PAR" %in% colnames(data)) { - stop("required col 'PAR' not found") - } - - if (!"Y.I." %in% colnames(data)) { - stop("required col 'Y(I)' not found") - } - - if (!"Action" %in% colnames(data)) { - stop("required col 'Action' not found") - } - - if (!"Date" %in% colnames(data)) { - stop("required col 'Date' not found") - } - - if (!"Time" %in% colnames(data)) { - stop("required col 'Time' not found") - } - - if (!"Pm.-Det." %in% data[["Action"]]) { - stop("required value 'Pm.-Det.' not found in column 'Action'") - } -} - -validate_dual_pam_single_channel_fluo_data <- function(data) { - if (is.null(data)) { - stop("data is null") - } - - if (!data.table::is.data.table(data)) { - stop("data is not a valid data.table") - } - - if (nrow(data) < 2) { - stop("no data rows") - } - - if (ncol(data) == 0) { - stop("no cols in data") - } - - if (!"ID" %in% colnames(data)) { - stop("required col 'ID' not found") - } - - if (!"PAR" %in% colnames(data)) { - stop("required col 'PAR' not found") - } - - if (!"Y.II." %in% colnames(data)) { - stop("required col 'Y(II)' not found") - } - - if (!"Action" %in% colnames(data)) { - stop("required col 'Action' not found") - } - - if (!"Date" %in% colnames(data)) { - stop("required col 'Date' not found") - } - - if (!"Time" %in% colnames(data)) { - stop("required col 'Time' not found") - } - - if (!"Fm-Det." %in% data[["Action"]]) { - stop("required value 'Fm' not found in column 'Action'") - } -} - -validate_junior_pam_data <- function(data) { - if (is.null(data)) { - stop("data is null") - } - - if (!data.table::is.data.table(data)) { - stop("data is not a valid data.table") - } - - if (nrow(data) < 2) { - stop("no data rows") - } - - if (ncol(data) == 0) { - stop("no cols in data") - } - - par_cols <- grep("^.+\\.PAR$", names(data), value = TRUE) - if (length(par_cols) == 0) { - stop("required col 'PAR' not found") - } else if (length(par_cols) > 1) { - stop(paste(length(par_cols), " 'PAR' cols found. Only supporting one 'PAR' column")) - } - - yield_cols <- grep("^.+\\.Y\\.\\.II\\.$", names(data), value = TRUE) - if (length(yield_cols) == 0) { - stop("required col 'Y (II)' not found") - } else if (length(yield_cols) > 1) { - stop(paste(length(yield_cols), " 'Y (II)' cols found. Only supporting one 'Y (II)' column")) - } - - if (!"Time..rel.ms." %in% colnames(data)) { - stop("required col 'Time (rel/ms)' not found") - } -} - -validate_pam_2500_data <- function(data) { - if (is.null(data)) { - stop("data is null") - } - - if (!data.table::is.data.table(data)) { - stop("data is not a valid data.table") - } - - if (nrow(data) < 2) { - stop("no data rows") - } - - if (ncol(data) == 0) { - stop("no cols in data") - } - - if (!"No." %in% colnames(data)) { - stop("required col 'No.' not found") - } - - if (!"PAR" %in% colnames(data)) { - stop("required col 'PAR' not found") - } - - if (!"Date" %in% colnames(data)) { - stop("required col 'Date' not found") - } - - if (!"Time" %in% colnames(data)) { - stop("required col 'Time' not found") - } - - if (!"Y.II." %in% colnames(data)) { - stop("required col 'Y(II)' not found") - } } validate_etr_regression_data <- function(regression_data) { diff --git a/src/R/write_model_result_csv.R b/src/R/write_model_result_csv.R new file mode 100644 index 0000000..9331646 --- /dev/null +++ b/src/R/write_model_result_csv.R @@ -0,0 +1,75 @@ +#' Write Model Result CSV +#' @description +#' This function exports the intermediate data table, regression data, and model parameters into separate CSV files for easy access and further analysis. +#' +#' @param dest_dir A character string specifying the directory where the CSV files will be saved. +#' @param name A character string specifying the base name for the output files. +#' @param data A data.table containing the intermediate data used in the model. +#' @param model_result A list containing the model results, including parameter values and regression data. +#' +#' @details +#' This function generates three CSV files: +#' \enumerate{ +#' \item \strong{raw_data.csv:} Contains the original raw data used in the model. +#' \item \strong{regression_data.csv:} Includes the regression data with predicted electron transport rate (ETR) values. +#' \item \strong{model_result.csv:} Summarizes the parameter values derived from the model results (excluding regression data), such as \code{alpha} or \code{beta}. +#' } +#' The `name` parameter serves as a prefix for each file, ensuring clarity and organization in the output directory. +#' A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#write_model_result_csv} +#' +#' @return No return value, called for side effects +#' +#' @examples +#' path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") +#' data <- read_dual_pam_data(path) +#' +#' result <- eilers_peeters_generate_regression_ETR_I(data) +#' write_model_result_csv(tempdir(), "20240925", data, result) +#' +#' @export +write_model_result_csv <- function(dest_dir, name, data, model_result) { + data_dest <- file.path(dest_dir, paste(name, "_raw_data.csv", sep = "")) + regression_data_dest <- file.path(dest_dir, paste(name, "_regression_data.csv", sep = "")) + model_result_dest <- file.path(dest_dir, paste(name, "_model_result.csv", sep = "")) + + utils::write.csv( + data, + file = data_dest, + quote = TRUE, + row.names = FALSE + ) + + utils::write.csv( + get_etr_regression_data_from_model_result(model_result), + file = regression_data_dest, + quote = TRUE, + row.names = FALSE + ) + + df <- data.frame() + df[1, ] <- NA + + for (n in names(model_result)) { + if (n == "etr_regression_data" || n == "etr_type") { + next() + } + + entry <- data.frame( + stats::setNames( + list( + c(model_result[[n]]) + ), + c(n) + ) + ) + + df <- cbind(df, NewCol = entry) + } + + utils::write.csv( + df, + file = model_result_dest, + quote = TRUE, + row.names = FALSE + ) +} diff --git a/src/inst/extdata/dual_pam_single_channel_fluo_data/20260130_efeutute_dual_pam_only_fluo.csv b/src/inst/extdata/dual_pam_single_channel_fluo_data/20260130_dual_pam_only_fluo.csv similarity index 100% rename from src/inst/extdata/dual_pam_single_channel_fluo_data/20260130_efeutute_dual_pam_only_fluo.csv rename to src/inst/extdata/dual_pam_single_channel_fluo_data/20260130_dual_pam_only_fluo.csv diff --git a/src/inst/extdata/dual_pam_single_channel_p700_data/20260130_01_efeutute_dual_pam_only_p700.csv b/src/inst/extdata/dual_pam_single_channel_p700_data/20260130_01_dual_pam_only_p700.csv similarity index 100% rename from src/inst/extdata/dual_pam_single_channel_p700_data/20260130_01_efeutute_dual_pam_only_p700.csv rename to src/inst/extdata/dual_pam_single_channel_p700_data/20260130_01_dual_pam_only_p700.csv diff --git a/src/man/combo_plot_control.Rd b/src/man/combo_plot_control.Rd index 4833f14..fba2468 100644 --- a/src/man/combo_plot_control.Rd +++ b/src/man/combo_plot_control.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/combo_plot_control.R +% Please edit documentation in R/plot.R \name{combo_plot_control} \alias{combo_plot_control} \title{Combined ETR Plot and Summary Table} diff --git a/src/man/eilers_peeters_default_start_value_a.Rd b/src/man/eilers_peeters_default_start_value_a.Rd index 749d6b3..b90840f 100644 --- a/src/man/eilers_peeters_default_start_value_a.Rd +++ b/src/man/eilers_peeters_default_start_value_a.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/eilers_peeters.R +% Please edit documentation in R/model_eilers_peeters.R \docType{data} \name{eilers_peeters_default_start_value_a} \alias{eilers_peeters_default_start_value_a} diff --git a/src/man/eilers_peeters_default_start_value_b.Rd b/src/man/eilers_peeters_default_start_value_b.Rd index d4fd0ac..8ddf54f 100644 --- a/src/man/eilers_peeters_default_start_value_b.Rd +++ b/src/man/eilers_peeters_default_start_value_b.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/eilers_peeters.R +% Please edit documentation in R/model_eilers_peeters.R \docType{data} \name{eilers_peeters_default_start_value_b} \alias{eilers_peeters_default_start_value_b} diff --git a/src/man/eilers_peeters_default_start_value_c.Rd b/src/man/eilers_peeters_default_start_value_c.Rd index 87e74db..3bbd431 100644 --- a/src/man/eilers_peeters_default_start_value_c.Rd +++ b/src/man/eilers_peeters_default_start_value_c.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/eilers_peeters.R +% Please edit documentation in R/model_eilers_peeters.R \docType{data} \name{eilers_peeters_default_start_value_c} \alias{eilers_peeters_default_start_value_c} diff --git a/src/man/eilers_peeters_generate_regression_ETR_I.Rd b/src/man/eilers_peeters_generate_regression_ETR_I.Rd index a48a6d3..3981037 100644 --- a/src/man/eilers_peeters_generate_regression_ETR_I.Rd +++ b/src/man/eilers_peeters_generate_regression_ETR_I.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/eilers_peeters.R +% Please edit documentation in R/model_eilers_peeters.R \name{eilers_peeters_generate_regression_ETR_I} \alias{eilers_peeters_generate_regression_ETR_I} \title{Eilers-Peeters Regression for ETR I} diff --git a/src/man/eilers_peeters_generate_regression_ETR_II.Rd b/src/man/eilers_peeters_generate_regression_ETR_II.Rd index 4c08182..7ebaca4 100644 --- a/src/man/eilers_peeters_generate_regression_ETR_II.Rd +++ b/src/man/eilers_peeters_generate_regression_ETR_II.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/eilers_peeters.R +% Please edit documentation in R/model_eilers_peeters.R \name{eilers_peeters_generate_regression_ETR_II} \alias{eilers_peeters_generate_regression_ETR_II} \title{Eilers-Peeters Regression for ETR II} diff --git a/src/man/eilers_peeters_modified.Rd b/src/man/eilers_peeters_modified.Rd index 9a6fd2f..f2a25fc 100644 --- a/src/man/eilers_peeters_modified.Rd +++ b/src/man/eilers_peeters_modified.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/eilers_peeters.R +% Please edit documentation in R/model_eilers_peeters.R \name{eilers_peeters_modified} \alias{eilers_peeters_modified} \title{Eilers & Peeters Model Modification} diff --git a/src/man/platt_default_start_value_alpha.Rd b/src/man/platt_default_start_value_alpha.Rd index 15cb9e9..c6cb1c9 100644 --- a/src/man/platt_default_start_value_alpha.Rd +++ b/src/man/platt_default_start_value_alpha.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/platt.R +% Please edit documentation in R/model_platt.R \docType{data} \name{platt_default_start_value_alpha} \alias{platt_default_start_value_alpha} diff --git a/src/man/platt_default_start_value_beta.Rd b/src/man/platt_default_start_value_beta.Rd index 0acd762..20c3104 100644 --- a/src/man/platt_default_start_value_beta.Rd +++ b/src/man/platt_default_start_value_beta.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/platt.R +% Please edit documentation in R/model_platt.R \docType{data} \name{platt_default_start_value_beta} \alias{platt_default_start_value_beta} diff --git a/src/man/platt_default_start_value_ps.Rd b/src/man/platt_default_start_value_ps.Rd index f6f4dc2..402c3a2 100644 --- a/src/man/platt_default_start_value_ps.Rd +++ b/src/man/platt_default_start_value_ps.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/platt.R +% Please edit documentation in R/model_platt.R \docType{data} \name{platt_default_start_value_ps} \alias{platt_default_start_value_ps} diff --git a/src/man/platt_generate_regression_ETR_I.Rd b/src/man/platt_generate_regression_ETR_I.Rd index 1f5092e..8087ac7 100644 --- a/src/man/platt_generate_regression_ETR_I.Rd +++ b/src/man/platt_generate_regression_ETR_I.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/platt.R +% Please edit documentation in R/model_platt.R \name{platt_generate_regression_ETR_I} \alias{platt_generate_regression_ETR_I} \title{Platt Regression for ETR I} diff --git a/src/man/platt_generate_regression_ETR_II.Rd b/src/man/platt_generate_regression_ETR_II.Rd index 3166a75..32951e4 100644 --- a/src/man/platt_generate_regression_ETR_II.Rd +++ b/src/man/platt_generate_regression_ETR_II.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/platt.R +% Please edit documentation in R/model_platt.R \name{platt_generate_regression_ETR_II} \alias{platt_generate_regression_ETR_II} \title{Platt Regression for ETR II} diff --git a/src/man/platt_modified.Rd b/src/man/platt_modified.Rd index e383ddd..353f616 100644 --- a/src/man/platt_modified.Rd +++ b/src/man/platt_modified.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/platt.R +% Please edit documentation in R/model_platt.R \name{platt_modified} \alias{platt_modified} \title{Platt Model Modification} diff --git a/src/man/plot_control.Rd b/src/man/plot_control.Rd index 4423a9c..6441fbe 100644 --- a/src/man/plot_control.Rd +++ b/src/man/plot_control.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/util.R +% Please edit documentation in R/plot.R \name{plot_control} \alias{plot_control} \title{Plot Control} diff --git a/src/man/read_dual_pam_data.Rd b/src/man/read_dual_pam_data.Rd index c25aa42..70a36ef 100644 --- a/src/man/read_dual_pam_data.Rd +++ b/src/man/read_dual_pam_data.Rd @@ -1,55 +1,55 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_pam_data.R -\name{read_dual_pam_data} -\alias{read_dual_pam_data} -\title{Read and Process DualPAM Data} -\usage{ -read_dual_pam_data( - csv_path, - remove_recovery = TRUE, - etr_factor = 0.84, - fraction_photosystem_I = 0.5, - fraction_photosystem_II = 0.5 -) -} -\arguments{ -\item{csv_path}{File path to the CSV file.} - -\item{remove_recovery}{Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}.} - -\item{etr_factor}{Numeric. Factor for ETR calculation. Default is \code{0.84}.} - -\item{fraction_photosystem_I}{Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}.} - -\item{fraction_photosystem_II}{Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}.} -} -\value{ -A \code{data.table} containing: -\itemize{ - \item \code{par}: Photosynthetically active radiation. - \item \code{yield_1}: Yield for photosystem I. - \item \code{yield_2}: Yield for photosystem II. - \item \code{etr_1}: Calculated ETR for photosystem I. - \item \code{etr_2}: Calculated ETR for photosystem II. -} -} -\description{ -Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values, and returns a universal dataset. -} -\details{ -Calculates ETR using: -\deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I or II)} \cdot \text{Yield (I or II)}} - -A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} -} -\examples{ -path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") -data <- read_dual_pam_data(path) -} -\references{ -{ - Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} - Heinz Walz GmbH, Effeltrich, Germany. - Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} -} -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/device_dual_pam.R +\name{read_dual_pam_data} +\alias{read_dual_pam_data} +\title{Read and Process DualPAM Data} +\usage{ +read_dual_pam_data( + csv_path, + remove_recovery = TRUE, + etr_factor = 0.84, + fraction_photosystem_I = 0.5, + fraction_photosystem_II = 0.5 +) +} +\arguments{ +\item{csv_path}{File path to the CSV file.} + +\item{remove_recovery}{Logical. Removes recovery measurements if \code{TRUE}. Default is \code{TRUE}.} + +\item{etr_factor}{Numeric. Factor for ETR calculation. Default is \code{0.84}.} + +\item{fraction_photosystem_I}{Numeric. Relative distribution of absorbed PAR to photosystem I. Default is \code{0.5}.} + +\item{fraction_photosystem_II}{Numeric. Relative distribution of absorbed PAR to photosystem II. Default is \code{0.5}.} +} +\value{ +A \code{data.table} containing: +\itemize{ + \item \code{par}: Photosynthetically active radiation. + \item \code{yield_1}: Yield for photosystem I. + \item \code{yield_2}: Yield for photosystem II. + \item \code{etr_1}: Calculated ETR for photosystem I. + \item \code{etr_2}: Calculated ETR for photosystem II. +} +} +\description{ +Reads raw CSV files generated by DualPAM software, calculates electron transport rate (ETR) values, and returns a universal dataset. +} +\details{ +Calculates ETR using: +\deqn{\text{ETR} = \text{PAR} \cdot \text{ETR-Factor} \cdot \text{Fraction of Photosystem (I or II)} \cdot \text{Yield (I or II)}} + +A detailed documentation can be found under \url{https://github.com/biotoolbox/pam?tab=readme-ov-file#read_dual_pam_data} +} +\examples{ +path <- file.path(system.file("extdata/dual_pam_data", package = "pam"), "20240925.csv") +data <- read_dual_pam_data(path) +} +\references{ +{ + Heinz Walz GmbH. (2024). \emph{DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172).} + Heinz Walz GmbH, Effeltrich, Germany. + Available at: \url{https://www.walz.com/files/downloads/dualpamed05.pdf} +} +} diff --git a/src/man/read_dual_pam_single_channel_fluo_data.Rd b/src/man/read_dual_pam_single_channel_fluo_data.Rd index 2567b81..d9f6fe0 100644 --- a/src/man/read_dual_pam_single_channel_fluo_data.Rd +++ b/src/man/read_dual_pam_single_channel_fluo_data.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_pam_data.R +% Please edit documentation in R/device_dual_pam_single_channel_fluo.R \name{read_dual_pam_single_channel_fluo_data} \alias{read_dual_pam_single_channel_fluo_data} \title{Read and Process DualPAM Data Single Chanel Mode Fluo} @@ -45,7 +45,7 @@ A detailed documentation can be found under \url{https://github.com/biotoolbox/p \examples{ path <- file.path( system.file("extdata/dual_pam_single_channel_fluo_data", package = "pam"), - "20260130_efeutute_dual_pam_only_fluo.csv" + "20260130_dual_pam_only_fluo.csv" ) data <- read_dual_pam_single_channel_fluo_data(path) } diff --git a/src/man/read_dual_pam_single_channel_p700_data.Rd b/src/man/read_dual_pam_single_channel_p700_data.Rd index 7d766bb..be58956 100644 --- a/src/man/read_dual_pam_single_channel_p700_data.Rd +++ b/src/man/read_dual_pam_single_channel_p700_data.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_pam_data.R +% Please edit documentation in R/device_dual_pam_single_channel_p700.R \name{read_dual_pam_single_channel_p700_data} \alias{read_dual_pam_single_channel_p700_data} \title{Read and Process DualPAM Data Single Chanel Mode P700} @@ -45,7 +45,7 @@ A detailed documentation can be found under \url{https://github.com/biotoolbox/p \examples{ path <- file.path( system.file("extdata/dual_pam_single_channel_p700_data", package = "pam"), - "20260130_01_efeutute_dual_pam_only_p700.csv" + "20260130_01_dual_pam_only_p700.csv" ) data <- read_dual_pam_single_channel_p700_data(path) } diff --git a/src/man/read_junior_pam_data.Rd b/src/man/read_junior_pam_data.Rd index f233dff..c4d1e3d 100644 --- a/src/man/read_junior_pam_data.Rd +++ b/src/man/read_junior_pam_data.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_pam_data.R +% Please edit documentation in R/device_junior_pam.R \name{read_junior_pam_data} \alias{read_junior_pam_data} \title{Read and Process Junior PAM Data} diff --git a/src/man/read_pam_2500_data.Rd b/src/man/read_pam_2500_data.Rd index 5fdd444..ce8e5b6 100644 --- a/src/man/read_pam_2500_data.Rd +++ b/src/man/read_pam_2500_data.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_pam_data.R +% Please edit documentation in R/device_pam_2500.R \name{read_pam_2500_data} \alias{read_pam_2500_data} \title{Read and Process PAM 2500 Data} diff --git a/src/man/read_universal_data.Rd b/src/man/read_universal_data.Rd index ba63970..f877222 100644 --- a/src/man/read_universal_data.Rd +++ b/src/man/read_universal_data.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_pam_data.R +% Please edit documentation in R/device_universal_data.R \name{read_universal_data} \alias{read_universal_data} \title{Read and Process Universal PAM Data} diff --git a/src/man/vollenweider_default_start_value_a.Rd b/src/man/vollenweider_default_start_value_a.Rd index c3a2479..0f9e605 100644 --- a/src/man/vollenweider_default_start_value_a.Rd +++ b/src/man/vollenweider_default_start_value_a.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vollenweider.R +% Please edit documentation in R/model_vollenweider.R \docType{data} \name{vollenweider_default_start_value_a} \alias{vollenweider_default_start_value_a} diff --git a/src/man/vollenweider_default_start_value_alpha.Rd b/src/man/vollenweider_default_start_value_alpha.Rd index 698faa7..f896c6d 100644 --- a/src/man/vollenweider_default_start_value_alpha.Rd +++ b/src/man/vollenweider_default_start_value_alpha.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vollenweider.R +% Please edit documentation in R/model_vollenweider.R \docType{data} \name{vollenweider_default_start_value_alpha} \alias{vollenweider_default_start_value_alpha} diff --git a/src/man/vollenweider_default_start_value_n.Rd b/src/man/vollenweider_default_start_value_n.Rd index 9cb6ba8..ad79912 100644 --- a/src/man/vollenweider_default_start_value_n.Rd +++ b/src/man/vollenweider_default_start_value_n.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vollenweider.R +% Please edit documentation in R/model_vollenweider.R \docType{data} \name{vollenweider_default_start_value_n} \alias{vollenweider_default_start_value_n} diff --git a/src/man/vollenweider_default_start_value_pmax.Rd b/src/man/vollenweider_default_start_value_pmax.Rd index acf98e1..b10dfb6 100644 --- a/src/man/vollenweider_default_start_value_pmax.Rd +++ b/src/man/vollenweider_default_start_value_pmax.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vollenweider.R +% Please edit documentation in R/model_vollenweider.R \docType{data} \name{vollenweider_default_start_value_pmax} \alias{vollenweider_default_start_value_pmax} diff --git a/src/man/vollenweider_generate_regression_ETR_I.Rd b/src/man/vollenweider_generate_regression_ETR_I.Rd index aa5b47c..224e1d5 100644 --- a/src/man/vollenweider_generate_regression_ETR_I.Rd +++ b/src/man/vollenweider_generate_regression_ETR_I.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vollenweider.R +% Please edit documentation in R/model_vollenweider.R \name{vollenweider_generate_regression_ETR_I} \alias{vollenweider_generate_regression_ETR_I} \title{Vollenweider Regression for ETR I} diff --git a/src/man/vollenweider_generate_regression_ETR_II.Rd b/src/man/vollenweider_generate_regression_ETR_II.Rd index 0cd386c..c1c0bde 100644 --- a/src/man/vollenweider_generate_regression_ETR_II.Rd +++ b/src/man/vollenweider_generate_regression_ETR_II.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vollenweider.R +% Please edit documentation in R/model_vollenweider.R \name{vollenweider_generate_regression_ETR_II} \alias{vollenweider_generate_regression_ETR_II} \title{Vollenweider Regression for ETR II} diff --git a/src/man/vollenweider_modified.Rd b/src/man/vollenweider_modified.Rd index 5747da4..8fde27b 100644 --- a/src/man/vollenweider_modified.Rd +++ b/src/man/vollenweider_modified.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vollenweider.R +% Please edit documentation in R/model_vollenweider.R \name{vollenweider_modified} \alias{vollenweider_modified} \title{Vollenweider Model Modification} diff --git a/src/man/walsby_default_start_value_alpha.Rd b/src/man/walsby_default_start_value_alpha.Rd index 0756ff4..43bcffc 100644 --- a/src/man/walsby_default_start_value_alpha.Rd +++ b/src/man/walsby_default_start_value_alpha.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/walsby.R +% Please edit documentation in R/model_walsby.R \docType{data} \name{walsby_default_start_value_alpha} \alias{walsby_default_start_value_alpha} diff --git a/src/man/walsby_default_start_value_beta.Rd b/src/man/walsby_default_start_value_beta.Rd index 9885fe7..95e0360 100644 --- a/src/man/walsby_default_start_value_beta.Rd +++ b/src/man/walsby_default_start_value_beta.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/walsby.R +% Please edit documentation in R/model_walsby.R \docType{data} \name{walsby_default_start_value_beta} \alias{walsby_default_start_value_beta} diff --git a/src/man/walsby_default_start_value_etr_max.Rd b/src/man/walsby_default_start_value_etr_max.Rd index def9308..3754373 100644 --- a/src/man/walsby_default_start_value_etr_max.Rd +++ b/src/man/walsby_default_start_value_etr_max.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/walsby.R +% Please edit documentation in R/model_walsby.R \docType{data} \name{walsby_default_start_value_etr_max} \alias{walsby_default_start_value_etr_max} diff --git a/src/man/walsby_generate_regression_ETR_I.Rd b/src/man/walsby_generate_regression_ETR_I.Rd index 6d7222d..560e7af 100644 --- a/src/man/walsby_generate_regression_ETR_I.Rd +++ b/src/man/walsby_generate_regression_ETR_I.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/walsby.R +% Please edit documentation in R/model_walsby.R \name{walsby_generate_regression_ETR_I} \alias{walsby_generate_regression_ETR_I} \title{Walsby Regression for ETR I} diff --git a/src/man/walsby_generate_regression_ETR_II.Rd b/src/man/walsby_generate_regression_ETR_II.Rd index 0767416..4549376 100644 --- a/src/man/walsby_generate_regression_ETR_II.Rd +++ b/src/man/walsby_generate_regression_ETR_II.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/walsby.R +% Please edit documentation in R/model_walsby.R \name{walsby_generate_regression_ETR_II} \alias{walsby_generate_regression_ETR_II} \title{Walsby Regression for ETR II} diff --git a/src/man/walsby_modified.Rd b/src/man/walsby_modified.Rd index 8b40c68..cad11c3 100644 --- a/src/man/walsby_modified.Rd +++ b/src/man/walsby_modified.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/walsby.R +% Please edit documentation in R/model_walsby.R \name{walsby_modified} \alias{walsby_modified} \title{Walsby Model Modification} diff --git a/src/man/write_model_result_csv.Rd b/src/man/write_model_result_csv.Rd index 75c3281..bc6a2d2 100644 --- a/src/man/write_model_result_csv.Rd +++ b/src/man/write_model_result_csv.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/util.R +% Please edit documentation in R/write_model_result_csv.R \name{write_model_result_csv} \alias{write_model_result_csv} \title{Write Model Result CSV} diff --git a/src/tests/testthat/data/dual_pam_single_channel_fluo_data/20260130_efeutute_dual_pam_only_fluo.csv b/src/tests/testthat/data/dual_pam_single_channel_fluo_data/20260130_dual_pam_only_fluo.csv similarity index 100% rename from src/tests/testthat/data/dual_pam_single_channel_fluo_data/20260130_efeutute_dual_pam_only_fluo.csv rename to src/tests/testthat/data/dual_pam_single_channel_fluo_data/20260130_dual_pam_only_fluo.csv diff --git a/src/tests/testthat/data/dual_pam_single_channel_p700_data/20260130_01_efeutute_dual_pam_only_p700.csv b/src/tests/testthat/data/dual_pam_single_channel_p700_data/20260130_01_dual_pam_only_p700.csv similarity index 100% rename from src/tests/testthat/data/dual_pam_single_channel_p700_data/20260130_01_efeutute_dual_pam_only_p700.csv rename to src/tests/testthat/data/dual_pam_single_channel_p700_data/20260130_01_dual_pam_only_p700.csv diff --git a/src/tests/testthat/test-read_dual_pam_data.R b/src/tests/testthat/test-read_dual_pam_data.R index 1f556d4..61c12c8 100644 --- a/src/tests/testthat/test-read_dual_pam_data.R +++ b/src/tests/testthat/test-read_dual_pam_data.R @@ -303,12 +303,12 @@ test_that("read_dual_pam_data 20240925.csv - fraction_photosystem_I = 0.2, fract expect_equal(etr_2[17], 62.0256) }) -test_that("20260130_01_efeutute_dual_pam_only_p700.csv - expect fm missing", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") +test_that("20260130_01_dual_pam_only_p700.csv - expect fm missing", { + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_dual_pam_only_p700.csv") expect_error(read_dual_pam_data(test_data_file)) }) -test_that("20260130_efeutute_dual_pam_only_fluo.csv - expect pm missing", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") +test_that("20260130_dual_pam_only_fluo.csv - expect pm missing", { + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_dual_pam_only_fluo.csv") expect_error(read_dual_pam_data(test_data_file)) }) diff --git a/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R b/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R index 61cd47a..2c865b1 100644 --- a/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R +++ b/src/tests/testthat/test-read_dual_pam_single_channel_fluo_data.R @@ -1,5 +1,5 @@ test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - default", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_dual_pam_only_fluo.csv") data <- read_dual_pam_single_channel_fluo_data(test_data_file) par <- data$par @@ -69,7 +69,7 @@ test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_onl }) test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_dual_pam_only_fluo.csv") data <- read_dual_pam_single_channel_fluo_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -139,12 +139,12 @@ test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_onl }) test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_dual_pam_only_fluo.csv") expect_error(read_dual_pam_single_channel_fluo_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_dual_pam_single_channel_fluo_data 20260130_efeutute_dual_pam_only_fluo - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_efeutute_dual_pam_only_fluo.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_fluo_data", "20260130_dual_pam_only_fluo.csv") data <- read_dual_pam_single_channel_fluo_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par diff --git a/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R b/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R index 4a5fdb8..5b38fa3 100644 --- a/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R +++ b/src/tests/testthat/test-read_dual_pam_single_channel_p700_data.R @@ -1,5 +1,5 @@ test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - default", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_dual_pam_only_p700.csv") data <- read_dual_pam_single_channel_p700_data(test_data_file) par <- data$par @@ -89,7 +89,7 @@ test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_ }) test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - etr_factor 0.5", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_dual_pam_only_p700.csv") data <- read_dual_pam_single_channel_p700_data(test_data_file, etr_factor = 0.5) par <- data$par @@ -179,12 +179,12 @@ test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_ }) test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - fraction_photosystem > 1", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_dual_pam_only_p700.csv") expect_error(read_dual_pam_single_channel_p700_data(test_data_file, fraction_photosystem_I = 0.9, fraction_photosystem_II = 0.2)) }) test_that("read_dual_pam_single_channel_p700_data 20260130_01_efeutute_dual_pam_only_p700 - fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8", { - test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_efeutute_dual_pam_only_p700.csv") + test_data_file <- testthat::test_path("data", "dual_pam_single_channel_p700_data", "20260130_01_dual_pam_only_p700.csv") data <- read_dual_pam_single_channel_p700_data(test_data_file, fraction_photosystem_I = 0.2, fraction_photosystem_II = 0.8) par <- data$par From 95402a8b5480bb4546f8a46aa9f192d6c555f9f7 Mon Sep 17 00:00:00 2001 From: Phi-S <926151+Phi-S@users.noreply.github.com> Date: Thu, 23 Apr 2026 12:27:55 +0200 Subject: [PATCH 6/6] refactor OS detection functions and update test cases to use is_reference_platform --- src/tests/testthat/helper-os-detection.R | 61 +++++++------------ .../test-compare_regression_models_etr_I.R | 2 +- .../test-compare_regression_models_etr_II.R | 2 +- .../test-compare_regression_models_total.R | 2 +- .../testthat/test-eilers_peeters_etr_I.R | 4 +- .../testthat/test-eilers_peeters_etr_II.R | 4 +- src/tests/testthat/test-platt_etr_I.R | 4 +- src/tests/testthat/test-platt_etr_II.R | 4 +- .../test-relative_root_mean_squared_error.R | 2 +- .../testthat/test-root_mean_squared_error.R | 2 +- .../testthat/test-universal_data_etr_I.R | 2 +- src/tests/testthat/test-vollenweider_etr_I.R | 4 +- src/tests/testthat/test-vollenweider_etr_II.R | 4 +- src/tests/testthat/test-walsby_etr_I.R | 4 +- src/tests/testthat/test-walsby_etr_II.R | 4 +- 15 files changed, 45 insertions(+), 60 deletions(-) diff --git a/src/tests/testthat/helper-os-detection.R b/src/tests/testthat/helper-os-detection.R index d143fbc..95b89a7 100644 --- a/src/tests/testthat/helper-os-detection.R +++ b/src/tests/testthat/helper-os-detection.R @@ -1,51 +1,36 @@ -# Returns a string identifying the OS or distro -get_os_distro <- function() { +get_os_id <- function() { sys_name <- Sys.info()[["sysname"]] if (sys_name == "Linux") { - # If the file doesn't exist, we can't determine distro if (!file.exists("/etc/os-release")) { - return("unknown") + return(NA) } - - # Try reading the file safely - os_release <- tryCatch( - readLines("/etc/os-release"), - error = function(e) NULL - ) - - if (is.null(os_release)) { - return("unknown") + os_release <- readLines("/etc/os-release") + id_line <- grep("^ID=", os_release, value = TRUE) + if (length(id_line) == 0) { + return(NA) } + return(id_line) + } - # Extract ID_LIKE and ID - distro_id_like <- grep("^ID_LIKE=", os_release, value = TRUE) - distro_id_like <- if (length(distro_id_like) > 0) { - sub("^ID_LIKE=", "", distro_id_like) - } else { - "" - } + return(tolower(sys_name)) +} - distro_id <- grep("^ID=", os_release, value = TRUE) - distro_id <- if (length(distro_id) > 0) { - sub("^ID=", "", distro_id) - } else { - "" - } +is_reference_platform <- function() { + os <- get_os_id() + if (is.na(os) || !grepl("\\b(debian|ubuntu)\\b", os, ignore.case = TRUE)) { + return(FALSE) + } - distro_names <- paste(distro_id_like, distro_id, collapse = " ") - if (nchar(trimws(distro_names)) == 0) { - return("unknown") - } else { - return(distro_names) - } + blas <- tolower(extSoftVersion()[["BLAS"]]) + if (!grepl("openblas|mkl|atlas|flexiblas|accelerate", blas)) { + return(FALSE) } - # For non-Linux, just return the system name (e.g. "Windows", "Darwin") - return(tolower(sys_name)) -} + arch <- tolower(Sys.info()[["machine"]]) + if (!(arch %in% c("x86_64", "amd64", "i386", "i686"))) { + return(FALSE) + } -is_debian_or_ubuntu <- function() { - os <- get_os_distro() - grepl("\\b(debian|ubuntu)\\b", os, ignore.case = TRUE) + return(TRUE) } diff --git a/src/tests/testthat/test-compare_regression_models_etr_I.R b/src/tests/testthat/test-compare_regression_models_etr_I.R index f8076a4..5789053 100644 --- a/src/tests/testthat/test-compare_regression_models_etr_I.R +++ b/src/tests/testthat/test-compare_regression_models_etr_I.R @@ -1,5 +1,5 @@ test_that("compare_regression_models etr I - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") result <- compare_regression_models_ETR_I(test_data_dir, read_dual_pam_data) diff --git a/src/tests/testthat/test-compare_regression_models_etr_II.R b/src/tests/testthat/test-compare_regression_models_etr_II.R index ea84675..5c12d66 100644 --- a/src/tests/testthat/test-compare_regression_models_etr_II.R +++ b/src/tests/testthat/test-compare_regression_models_etr_II.R @@ -1,5 +1,5 @@ test_that("compare_regression_models etr II - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") result <- compare_regression_models_ETR_II(test_data_dir, read_dual_pam_data) diff --git a/src/tests/testthat/test-compare_regression_models_total.R b/src/tests/testthat/test-compare_regression_models_total.R index 21adb47..69d59c1 100644 --- a/src/tests/testthat/test-compare_regression_models_total.R +++ b/src/tests/testthat/test-compare_regression_models_total.R @@ -1,5 +1,5 @@ test_that("compare_regression_models etr I + II - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_dir <- testthat::test_path("data", "dual_pam_data", "bulk") model_points_etr_I <- compare_regression_models_ETR_I(test_data_dir, read_dual_pam_data) model_points_etr_II <- compare_regression_models_ETR_II(test_data_dir, read_dual_pam_data) diff --git a/src/tests/testthat/test-eilers_peeters_etr_I.R b/src/tests/testthat/test-eilers_peeters_etr_I.R index d4e0275..f9f1851 100644 --- a/src/tests/testthat/test-eilers_peeters_etr_I.R +++ b/src/tests/testthat/test-eilers_peeters_etr_I.R @@ -1,5 +1,5 @@ test_that("test-eilers_peeters_etr_I generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_I(data) @@ -42,7 +42,7 @@ test_that("test-eilers_peeters_etr_I control plot 20240925.csv", { }) test_that("test-eilers_peeters_etr_I generate regression modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-eilers_peeters_etr_II.R b/src/tests/testthat/test-eilers_peeters_etr_II.R index f9210fb..70f79d0 100644 --- a/src/tests/testthat/test-eilers_peeters_etr_II.R +++ b/src/tests/testthat/test-eilers_peeters_etr_II.R @@ -1,5 +1,5 @@ test_that("test-eilers_peeters_etr_II generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) model_result <- eilers_peeters_generate_regression_ETR_II(data) @@ -23,7 +23,7 @@ test_that("test-eilers_peeters_etr_II generate regression 20240925.csv", { }) test_that("test-eilers_peeters_etr_II modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-platt_etr_I.R b/src/tests/testthat/test-platt_etr_I.R index 419101e..4cd675d 100644 --- a/src/tests/testthat/test-platt_etr_I.R +++ b/src/tests/testthat/test-platt_etr_I.R @@ -1,5 +1,5 @@ test_that("test-platt_etr_I generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) @@ -24,7 +24,7 @@ test_that("test-platt_etr_I generate regression 20240925.csv", { }) test_that("test-platt_etr_I generate regression modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-platt_etr_II.R b/src/tests/testthat/test-platt_etr_II.R index c8b0db6..ff45605 100644 --- a/src/tests/testthat/test-platt_etr_II.R +++ b/src/tests/testthat/test-platt_etr_II.R @@ -1,5 +1,5 @@ test_that("test-platt_etr_II generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) @@ -43,7 +43,7 @@ test_that("test-platt_etr_II control plot 20240925.csv", { }) test_that("test-platt_etr_II generate regression modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-relative_root_mean_squared_error.R b/src/tests/testthat/test-relative_root_mean_squared_error.R index 938371b..430a398 100644 --- a/src/tests/testthat/test-relative_root_mean_squared_error.R +++ b/src/tests/testthat/test-relative_root_mean_squared_error.R @@ -1,5 +1,5 @@ test_that("test-relative_root_mean_squared_error - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-root_mean_squared_error.R b/src/tests/testthat/test-root_mean_squared_error.R index f29912d..a6066dc 100644 --- a/src/tests/testthat/test-root_mean_squared_error.R +++ b/src/tests/testthat/test-root_mean_squared_error.R @@ -1,5 +1,5 @@ test_that("test-root_mean_squared_error - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-universal_data_etr_I.R b/src/tests/testthat/test-universal_data_etr_I.R index a2c9986..d2592c3 100644 --- a/src/tests/testthat/test-universal_data_etr_I.R +++ b/src/tests/testthat/test-universal_data_etr_I.R @@ -1,5 +1,5 @@ test_that("test-universal_data_etr_I - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "universal_data", "universal_data.csv") data <- read_universal_data(test_data_file) diff --git a/src/tests/testthat/test-vollenweider_etr_I.R b/src/tests/testthat/test-vollenweider_etr_I.R index e1c7772..ac1fb8d 100644 --- a/src/tests/testthat/test-vollenweider_etr_I.R +++ b/src/tests/testthat/test-vollenweider_etr_I.R @@ -1,5 +1,5 @@ test_that("test-vollenweider_etr_I generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) @@ -43,7 +43,7 @@ test_that("test-vollenweider_etr_I control plot 20240925.csv", { }) test_that("test-vollenweider_etr_I generate regression modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-vollenweider_etr_II.R b/src/tests/testthat/test-vollenweider_etr_II.R index a892144..3aac649 100644 --- a/src/tests/testthat/test-vollenweider_etr_II.R +++ b/src/tests/testthat/test-vollenweider_etr_II.R @@ -1,5 +1,5 @@ test_that("test-vollenweider_etr_II generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) @@ -43,7 +43,7 @@ test_that("test-vollenweider_etr_II control plot 20240925.csv", { }) test_that("test-vollenweider_etr_II generate regression modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-walsby_etr_I.R b/src/tests/testthat/test-walsby_etr_I.R index 319fa25..f5b383c 100644 --- a/src/tests/testthat/test-walsby_etr_I.R +++ b/src/tests/testthat/test-walsby_etr_I.R @@ -1,5 +1,5 @@ test_that("test-walsby_etr_I generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) @@ -38,7 +38,7 @@ test_that("test-walsby_etr_I control plot 20240925.csv", { }) test_that("test-walsby_etr_I generate regression modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) diff --git a/src/tests/testthat/test-walsby_etr_II.R b/src/tests/testthat/test-walsby_etr_II.R index f2dfda3..e3b28fb 100644 --- a/src/tests/testthat/test-walsby_etr_II.R +++ b/src/tests/testthat/test-walsby_etr_II.R @@ -1,5 +1,5 @@ test_that("test-walsby_etr_II generate regression 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file) @@ -38,7 +38,7 @@ test_that("test-walsby_etr_II control plot 20240925.csv", { }) test_that("test-walsby_etr_II generate regression modified 20240925.csv - linux", { - skip_if_not(is_debian_or_ubuntu()) + skip_if_not(is_reference_platform()) test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv") data <- read_dual_pam_data(test_data_file)