R/well_parser.R

Defines functions well_parser

Documented in well_parser

#' Function to toggle between a well ID and a well location number (useful for use with the Beckmann robot)
#' @param well well ID (e.g  A01 or F05)
#' @param size size of plate (96 or 384)
#' @return A well number (e.g. 1 or 65)
#' @export
#'

well_parser <- function(well, size = 96) {
  row <- substring(well, 1, 1)
  column <- as.numeric(substring(well, 2, 3))
  num_row <- match(row, LETTERS)
  if (size == 96) {
    output <- 12 * (num_row - 1) + column
  } else if (size == 384) {
    output <- 24 * (num_row - 1) + column
  }
  return(output)
}
econtijoch/FaithLabTools documentation built on July 21, 2022, 8:34 a.m.