View source: R/geneexpression.R
counts2fpkm | R Documentation |
Takes a count matrix and a vector of gene lengths and returns an optionally log2
-transformed FPKM matrix. Modified from edgeR.
counts2fpkm(x, length, log = FALSE, prior.count = 0.25)
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 |
A matrix of FPKM values.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.