counts2fpkm {Tmisc} | R Documentation |
Fragments per kilobase per million
Description
Takes a count matrix and a vector of gene lengths and returns an optionally log2
-transformed FPKM matrix. Modified from edgeR.
Usage
counts2fpkm(x, length, log = FALSE, prior.count = 0.25)
Arguments
x |
a matrix of counts |
length |
a vector of length |
log |
logical, if |
prior.count |
average count to be added to each observation to avoid
taking log of zero. Used only if |
Value
A matrix of FPKM values.
Examples
## Not run:
library(readr)
library(dplyr)
countdata <- read_csv("http://files.figshare.com/2439061/GSE37704_featurecounts.csv")
counts <- countdata %>% select(countdata, starts_with("SRR")) %>% as.matrix
counts2fpkm(counts, countdata$length)
## End(Not run)
[Package Tmisc version 1.0.1 Index]