well.info: Extract ID, Prefix, Well, Row and Column Label

View source: R/well.info.R

well.infoR Documentation

Extract ID, Prefix, Well, Row and Column Label

Description

Create a uniform representation for a multi-titer well with an optional prefix extracted as prefix.

Usage

well.info(w, format = NULL, upper = TRUE, drop.levels = TRUE)

Arguments

w

label (tag) for the well (coerced to a character)

format

character string as sprintf format for the column, default value of NULL pads the column value with zeros as needed such as "%02d" for more than 9 columns

upper

use upper case for row labels if TRUE

drop.levels

drop unused levels in row and column otherwise the respective levels for row and column are the letters A to P and numbers 1 to 384.

Details

This function will parse the character string in w into an optional "harmonized" tag with an arbitrary character prefix, (typically used to designate plate number), followed by a single character for the well ending with the column number formatted as per the sprintf formatted format. The code will fail if the row value is not one of the 16 letters from A to P or if the column number is not in the range of 1 to 384.

The prefix must contain only alphanumeric characters (0-9, a-z, A-Z), the underscore character or the hyphen.

This function is also used to harmonize well information generated by different processes that may differ by the lower or upper case or the use of leading zeros for the column number.

Value

A named list of length three or five. A value for tag and prefix will be returned only if a prefix is identified.

  • tag, harmonized character representation of the entire well name including any prefix if present, otherwise this is not returned

  • prefix, prefix as a character string if present, otherwise this is not returned

  • well, harmonized well name as a factor

  • row, row as a factor with levels A-P (or a-p)

  • column, column number as a factor with levels 1-24

Examples

  well.info("a6") # default settings
  well.info("a6", format = "%d", upper = TRUE)
  well.info("Plate_2b92", format = "%05d")
  well.info("Plate_2b92", format = "%05d", drop.levels = FALSE)


ornelles/virustiter documentation built on Oct. 13, 2024, 7:58 a.m.