R/getWellName.R

Defines functions getWellName getWellName.WellLocation getWellName.WellData getWellName.ImageData getWellName.default

Documented in getWellName

#' Get the well name of a WellLocation object
#'
#' Given a WellLocation object, return the well name
#'
#' @param x A WellLocation object
#' 
#' @return The well name of the WellLocation object (as a string)
#' 
#' @examples
#' plate <- WellLocation("J101-2C", "B", 15)
#' well.name <- getWellName(plate)
#' 
#' @export
getWellName <- function(x) {
  UseMethod("getWellName", x)
}

#' @export
getWellName.WellLocation <- function(x) {
  return(paste0(x$row, x$column))
}

#' @export
getWellName.WellData <- function(x) {
  return(paste0(x$meta$well.row, x$meta$well.col))
}

#' @export
getWellName.ImageData <- function(x) {
  return(paste0(x$well.row, x$well.col))
}

#' @export
getWellName.default <- function(x) {
  stop("can only deal with WellLocation objects.")
}
nbenn/singleCellFeatures documentation built on May 23, 2019, 12:24 p.m.