R/counts_to_fpkm.R

Defines functions counts_to_fpkm

Documented in counts_to_fpkm

#' Convert read counts to FPKM
#'
#' @param counts numeric.
#' @param eff_len numeric.
#'
#' @return A numeric vector of FPKM values.
#' @export

counts_to_fpkm <- function(counts, eff_len) {
  N <- sum(counts)
  exp(log(counts) + log(1e9) - log(eff_len) - log(N))
}
genevol-usp/hlaseqlib documentation built on Aug. 24, 2022, 7:24 a.m.