Skip to content

Commit

Permalink
relist plate scoring functions and only use the functions of the curr…
Browse files Browse the repository at this point in the history
…ent plate in the loop.
  • Loading branch information
julianesiebourg committed Nov 13, 2023
1 parent b8f506e commit a61c823
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions R/score_plates.R
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,8 @@ optimize_multi_plate_design <- function(batch_container, across_plates_variables

if (!is.null(within_plate_variables)) {
plate_levels <- unique(bc$get_locations()[[plate]])
scoring_funcs <- purrr::map(within_plate_variables, ~ mk_plate_scoring_functions(bc, plate = plate, row = row, column = column, group = .x)) %>%
unlist()
names(scoring_funcs) <- paste(rep(within_plate_variables, each = length(plate_levels)), names(scoring_funcs))

scoring_funcs <- purrr::map(within_plate_variables, ~ mk_plate_scoring_functions(bc, plate = plate, row = row, column = column, group = .x))
names(scoring_funcs) <- within_plate_variables

if (!quiet) {
message(
Expand All @@ -266,7 +264,7 @@ optimize_multi_plate_design <- function(batch_container, across_plates_variables
if (!quiet && length(plate_levels) > 1) cat(curr_plate, "... ")

bc <- optimize_design(bc,
scoring = scoring_funcs,
scoring = scoring_funcs %>% purrr::map(curr_plate) %>% rlang::set_names(paste(names(.), " Plate_", curr_plate)),
max_iter = max_iter,
quiet = TRUE,
shuffle_proposal_func = mk_subgroup_shuffling_function(
Expand Down

0 comments on commit a61c823

Please sign in to comment.