Skip to content

Commit

Permalink
avoid error with empty contamination input
Browse files Browse the repository at this point in the history
  • Loading branch information
lakras authored Nov 12, 2023
1 parent b4743a4 commit c1857a4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/visualize_plate_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,13 @@ if(input_file_type == "contamination")
{
input_table$contamination_source_well <- input_table$potential_contaminating_sample_plate_position
}
input_table$Row0 <- as.numeric(lapply(gsub("[[:digit:]]","",input_table$contamination_source_well), FUN=row_letters_to_row_number)) # retrieves letters, converts to digits
input_table$Column0 <- as.numeric(gsub("[^[:digit:]]", "", input_table$contamination_source_well)) # retrieves digits
input_table$Row0 <- NULL
input_table$Column0 <- NULL
if(nrow(input_table) > 0)
{
input_table$Row0 <- as.numeric(lapply(gsub("[[:digit:]]","",input_table$contamination_source_well), FUN=row_letters_to_row_number)) # retrieves letters, converts to digits
input_table$Column0 <- as.numeric(gsub("[^[:digit:]]", "", input_table$contamination_source_well)) # retrieves digits
}

# determines amount to jitter--more jitter if more lines of potential cross-contamination
MIN_JITTER <- 0
Expand Down

0 comments on commit c1857a4

Please sign in to comment.