#' Tecan functions
#'
#' get.row.number
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.row.number <- function(workSheet, key.lookup) {
key <- workSheet[, 1]
return(which(key == key.lookup))
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.worksheet <- function(root) {
worksheet <- read.csv(file = root)
worksheet <-
read.csv(
file = root,
skip = which(worksheet[, 1] == 'Time [s]') - 1,
header = F
)
return(worksheet)
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.startTime <- function(workSheet) {
key <- workSheet[, 1]
time.string <- workSheet[which(key == 'Start Time:'),-1][[1]]
values <- strptime(time.string, format = "%m/%d/%Y %I:%M:%S %p")
if (is.na(values))
values = strptime('7/6/2016 6:55:00 PM', format = "%m/%d/%Y %I:%M:%S %p")
return(values)
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.time <-
function(workSheet, startTime = get.startTime(workSheet)) {
key <- workSheet[, 1]
time.string <- workSheet[which(key == 'Time [s]'),-1]
values <- startTime + as.integer(time.string)
values <- get.minutes(values, values[1])
return(values)
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.minutes <- function(timeVector, timeOrigin) {
t <- difftime(timeVector, timeOrigin, units = "mins")
return(as.integer(t))
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.times <- function(workSheet) {
key <- workSheet[, 1]
time.string <- workSheet[which(key == 'Time [s]'),-1]
values <- as.integer(as.character(time.string))
return(values)
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.interval <- function(workSheet) {
key <- workSheet[, 1]
time.string <- workSheet[which(key == 'Interval Time'),-1][[1]]
values <- as.integer(time.string)
return(values)
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.temperature <- function(workSheet) {
key <- workSheet[, 1]
tempareture.string <-
workSheet[which(key == 'Time [s]') + 1,-1]
values <- as.double(tempareture.string)
return(values)
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.intensity <- function(workSheet, row) {
key <- workSheet[, 1]
row.start <- which(key == 'Cycle Nr.') + 3
if (length(row.start) == 0)
return()
row.end <- row.start + min(which(key[-(1:row.start)] == '')) - 1
values <- workSheet[row.start:row.end,]
return(values[row,-1])
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.intensities <- function(workSheet) {
key <- workSheet[, 1]
row.start <- which(key == 'Time [s]') + 2
if (length(row.start) == 0)
return()
row.end <- row.start + min(which(key[-(1:row.start)] == '')) - 1
values <- workSheet[row.start:row.end,]
results <- as.data.frame(t(values[, -1]))
output <-
as.data.frame(sapply(results, function(x)
as.numeric(as.character(x))))
return(output)
}
#' Tecan functions
#'
#'
#' @param
#' @keywords
#' @export
#' @examples
#'
#'
get.wells <- function(workSheet) {
key <- workSheet[, 1]
row.start <- which(key == 'Cycle Nr.') + 3
if (length(row.start) == 0)
return()
row.end <- row.start + min(which(key[-(1:row.start)] == '')) - 1
values <- workSheet[row.start:row.end,]
return(values[, 1])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.