R/loaders.R

#' Load data from Magellan ASCI export files
#' 
#' This function can be used as a source data \code{loader} in design files.  It
#' will parse .asc files generated by Tecan's Magellan software.
#' 
#' @param file Path to the file to read.
#' 
#' @details To use this read function to read data from files generated using
#'   Tecan's Magellen suite, use the following settings for ASCI export files in
#'   your method:
#' 
#' \describe{
#'   \item{Direction}{Horizontal}
#'   \item{Result}{Table (well data in columns)}
#'   \item{Add kinetic time stamps}{(checked)}
#' }
#' 
#' @return A data.frame in which the first column contains time stamps and 
#'   subsequent columns readings from wells, row-wise across the plate (eg
#'   A1..A12 then B1..B12, etc.).
#'   
#' @export
read.magellan <- function(file) {
  
  df <- read.table( file
                  , sep              = "\t"
                  , header           = FALSE
                  , stringsAsFactors = FALSE
                  )
  
  df[, 1]        <- as.numeric(gsub("s", "", df[, 1]))
  df[, ncol(df)] <- NULL
  df
  
}
whitwort/plateKinetics documentation built on May 4, 2019, 5:23 a.m.