R/qc_positive_control.R

Defines functions qc_positive_control

#' qc_positive_control
#'
#' @param counts [[data.frame]] A `data.frame` with the count data.
#'
#' @keywords internal
#' @usage NULL
#' @noRd
#'
#' @return [[numeric]]
qc_positive_control <- function(counts) {
  measured <- log2(counts[["Count"]])
  known <- log2(as.numeric(sub("^[^(]*\\((.*)\\)$", "\\1", counts[["Name"]]))) # plexset value: "32"
  correlation <- stats::cor.test(known, measured)$estimate
  unname(round(correlation, 5))
}

Try the NACHO package in your browser

Any scripts or data that you put into this service are public.

NACHO documentation built on Dec. 6, 2022, 1:06 a.m.