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

Blocking #57

Merged
merged 7 commits into from
Oct 18, 2023
Merged
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
9 changes: 7 additions & 2 deletions R/accessory.R
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,10 @@ read_contrasts <-
# Read the contrasts

contrasts <- read_metadata(filename)
contrast_cols <- c(variable_column, reference_column, target_column, blocking_column)
contrast_cols <- c(variable_column, reference_column, target_column)
pinin4fjords marked this conversation as resolved.
Show resolved Hide resolved
WackerO marked this conversation as resolved.
Show resolved Hide resolved
if (! blocking_column %in% names(contrasts)){
contrasts[[blocking_column]] <- NA
}

# Check contrast headers are as expected

Expand All @@ -927,7 +930,9 @@ read_contrasts <-

success <- checkListIsSubset(contrasts$variable, colnames(samples), "contrast variables", "sample metadata")

blocking <- unlist(lapply(contrasts$blocking, function(x) simpleSplit(x, ";")))
# Check blocking variables, where supplied

blocking <- unlist(lapply(contrasts[[blocking_column]], function(x) simpleSplit(x, ";")))
blocking <- blocking[!is.na(blocking)]
if (length(blocking > 0)) {
success <- checkListIsSubset(blocking, colnames(samples), "blocking variables", "sample metadata")
Expand Down
Loading