Hot answers tagged

32

First off, Don’t use RPKMs. They are truly deprecated because they’re confusing once it comes to paired-end reads. If anything, use FPKMs, which are mathematically the same but use a more correct name (do we count paired reads separately? No, we count fragments). Even better, use TPM (= transcripts per million), or an appropriate cross-library ...


9

RPKM is defined as: RPKM = numberOfReads / ( geneLength/1000 * totalNumReads/1,000,000 ) As you can see, you need to have gene lengths for every gene. Let's say geneLength is a vector which have the same number of rows as your data.frame, and every value of the vector corresponds to a gene (row) in expression. expression.rpkm <- data.frame(sapply(...


7

Here you can find some example R code to compute the gene length given a GTF file (it computes GC content too, which you don't need). This uses one of a number of ways of computing gene length, in this case the length of the "union gene model". In this method, the non-duplicated exons for each gene are simply summed up ("non-duplicated" in that no genomic ...


5

I assume you're familiar with the various issues surrounding FPKMs, so I'll not expound upon them. As a general rule, you should be using gene IDs rather than gene names, since the former are unique while the latter are not. If you only have access to data quantified on gene names, then the appropriate way to merge RPKMs is with a weighted sum: $FPKM_{gene}...


4

I have seen many posts regarding counts to RPKM and TPM. There’s your answer then: FPKM = RPKM. It’s simply a more accurate name. Speaking of RPKM for paired-end data is discouraged because the reference to “read” in this context lends itself to ambiguity. But mathematically the quantity is the same: we are counting fragments, not individual reads (of ...


4

Since Spearman is a rank-based test, it relies on you being able to accurately decide on the ranking of your observations by some metric (usually the magnitude of the numbers). If two observations have identical values (are tied), then they cannot be definitively ranked. Since the ranks are not unique, exact p-values cannot be determined. e.g. in your data, ...


4

FPKM are inherently experiment specific and can not be used to compare across samples. Let's consider the following two sequencing runs. Let $E1$ and $E2$ be the true, underlying expression in two samples of genes 1-6. Let $S1$ and $S2$ be the observed expression in our sequencing. $$ \begin{matrix} Gene & E1 & S1 & E2 & S2 \\ G1 & 100 &...


3

The best way to deal with this is to use unique gene IDs, for example ensembl accession numbers. So use the ensemble gtf annotation when quantifying the read counts and not the gene symbols. Just to illustrate, when I look for "5S_rRNA" in ensembl's annotation, i see 18 different "genes" with that gene symbol. But which 2 you have is unclear now. grep "...


2

You should never use RPKM. It’s simply obsolete in the age of paired-end sequencing, and has been replaced by FPKM (which is, strictly speaking, a synonym). The linked blog post explains more generally the problems that measures such as FPKM and CPM suffer from. A more robust measure is the TPM (transcripts per million), which scales CPM by the lengths of ...


2

You can use countToFPKM package. This package provides an easy to use function to convert the read count matrix into FPKM matrix; following the equation in The fpkm() function requires three inputs to return FPKM as numeric matrix normalized by library size and feature length: counts A numeric matrix of raw feature counts. featureLength A numeric ...


2

I did a comparison of cDNA count data against microarray data that was published a few years ago: For comparisons to published data (Fig. S2; Miller et al., 2012), a generalized linear model was fitted to the relationship between log-transformed microarray and VSTPk expression levels obtained from the ImmGen Project database, and was used to transform the ...


2

I think it is very hard to say which are the closest because they are not really comparable. But since you are using Spearman correlation, I guess RPKM, FPKM, and TPM do not change the order of gene expression levels. You might also want to normalize RNA-seq and microarray data so that they are more comparable.


1

The approach you are describing seems very strange. Crucially, the Vignette for DESeq2 states that the model only works correctly with unnormalized counts as input: It is important to provide count matrices as input for DESeq2’s statistical model (Love, Huber, and Anders 2014) to hold, as only the count values allow assessing the measurement precision ...


1

Yes, this is a standard way of obtaining RPKM/FPKM/CPM values for plotting. Not that you do not need to use a for loop for any of the computations in R. You have a matrix of normalized values and things like transcript length are constant across samples (at least unless you're using something like salmon...although then you'd have TPMs to begin with).


1

Is it ever meaningful to use FPKM values for analyzing across samples? One should never use FPKMs for anything important. They can occasionally be useful for plotting, but even in that case one needs to construct the FPKMs from properly normalized data and not use the original definition. It's becoming ever rarer to see people using FPKMs these days, ...


1

For visualization purposes, using log(cpm) is fine. But plot don't check if differences are significant or not, statistical tests do. You can certainly add the results of a proper statistical test to a plot - like adding asterisks to denote a significant difference, for example.


1

I assume you are mapping against the genome rather the transcriptome, since for the later the length would be trivial. Assuming the first, I think not only the coding sections should be included but also the UTR, since reads can map against them which is what we ultimately care about. In general, I found gene annotation files (e.g. gff or gtf) can be ...


1

If you are planning to do a differential expression analysis, you will probably don't need the RPKM calculation. RPK= No.of Mapped reads/ length of transcript in kb (transcript length/1000) RPKM = RPK/total no.of reads in million (total no of reads/ 1000000) The whole formula together: RPKM = (10^9 * C)/(N * L) Where, C = Number of reads mapped to a ...


Only top voted, non community-wiki answers of a minimum length are eligible