Skip to content

Commit

Permalink
bug: max doesn't work on factors
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiAragaki committed Oct 5, 2024
1 parent 2f3ed5c commit 96f5967
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/pcr_plan.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ pcr_plan <- function(data, n_primers, format = 384, exclude_border = TRUE,

with_primers <- gplate::gp_sec(plate, "primers", nrow = n_samples + ntc, ncol = reps, break_sections = FALSE, labels = pn)

max_sections <- max(with_primers$well_data$.sec, na.rm = TRUE)
max_sections <- max(as.numeric(with_primers$well_data$.sec), na.rm = TRUE)

if (max_sections < n_primers) {
with_primers <- gplate::gp_sec(plate, "primers", nrow = n_samples + ntc, ncol = reps, break_sections = FALSE, flow = "col", wrap = TRUE, labels = pn)
max_sections_wrap <- max(with_primers$well_data$.sec, na.rm = TRUE)
max_sections_wrap <- max(as.numeric(with_primers$well_data$.sec), na.rm = TRUE)

if (max_sections_wrap < n_primers)
rlang::abort("This experiment requires too many wells.")
Expand Down

0 comments on commit 96f5967

Please sign in to comment.