Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix plate wrapper #49

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions R/score_plates.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


#' Internal helper function to set up an (n m) x (n m) pairwise distance matrix for a plate with n rows and m columns
#'
#' @param plate_x Dimension of plate in x direction (i.e number of columns)
Expand Down Expand Up @@ -99,7 +97,6 @@ mk_plate_scoring_functions <- function(batch_container, plate = NULL, row, colum
)

plate_scoring_func <- function(samples, plate, plate_name, row, column, group) {

# Have to distinguish between empty positions on plate and NA-levels of experimental factors which may happen for real samples, too
nonempty_pos <- !is.na(samples[[".sample_id"]])

Expand Down Expand Up @@ -250,7 +247,13 @@ 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)) |>
scoring_funcs <- purrr::map(
within_plate_variables,
~ mk_plate_scoring_functions(bc,
plate = plate, row = row, column = column, group = .x,
p = 1, penalize_lines = "none"
)
) |>
unlist()
names(scoring_funcs) <- paste(rep(within_plate_variables, each = length(plate_levels)), names(scoring_funcs))

Expand Down
Loading