0
$\begingroup$

I want to get the expression data that is in-sample normalized like FPKM and also across samples normalized as obtained using DESeq2 or else.

What I am currently doing is that I first normalize the data across samples (using DESeq) and from the resultant expression I calculate the FPKM. Does it make sense or am I missing something here?

This is how I am doing (not the exact code but the idea)

dds <- DESeqDataSetFromMatrix(countData, DataFrame(condition), ~ condition)
dds <- estimateSizeFactors(dds)
norm_data <- counts(dds, normalized=TRUE)

foreach sample
{
    foreach transcript
    {
        FPKM = (Normalized read count * 10^9) / (transcript length * total mapped normalized read count)
    }

}
$\endgroup$
1
  • $\begingroup$ Welcome to the site! Could you please post the code on how are you doing this ? (This could clarify things about the order and if it is correctly done) $\endgroup$
    – llrs
    Commented Sep 16, 2019 at 9:12

2 Answers 2

1
$\begingroup$

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).

$\endgroup$
4
  • $\begingroup$ Thanks @devon that I understand (R and loops) but I am not able to confirm if assessing FPKM from normalized read counts make sense. $\endgroup$
    – Rajinder
    Commented Sep 16, 2019 at 14:48
  • $\begingroup$ It makes more sense then using straight FPKMs. Inputting normalized values helps to negate the otherwise intrinsic issues with FPKMs (namely, that they're heavily affected by outlier genes). $\endgroup$
    – Devon Ryan
    Commented Sep 16, 2019 at 15:02
  • $\begingroup$ To expand on what @DevonRyan is saying, if you calculate FPKM neat (without sizefactor adjustment), you are normalizing by library size. If you use DESeq2 to normalize, it is median normalization. You have to choose one of these, depending on what makes sense. Then using the normalized counts, you divide by transcript length etc, same value across all samples to get the final normalized values. You don't need to loop. $\endgroup$
    – StupidWolf
    Commented Sep 17, 2019 at 10:52
  • $\begingroup$ Thanks So then if I apply these two normalization approaches in this order- median normalization using DESeq2 and then on normalized read counts library size normalization using FPKM; it is okay to do so $\endgroup$
    – Rajinder
    Commented Sep 17, 2019 at 13:33
0
$\begingroup$

You might want to check the EDASeq() package, which attempts to address both gene-specific and sample-specific effects (I believe this is what you are trying to achieve). From their vignette:

Following (Risso et al. 2011), we consider two main types of effects on gene-level counts: (1) within-lane gene-specific (and possibly lane-specific) effects, e.g., related to gene length or GC-content, and (2) effects related to between-lane distributional differences, e.g., sequencing depth. Accordingly, withinLaneNormalization and betweenLaneNormalization adjust for the first and second type of effects, respectively. We recommend to normalize for within-lane effects prior to between-lane normalization.

$\endgroup$
1
  • $\begingroup$ Thanks @haci But this is not what I am looking for. I have now added more information to my question. $\endgroup$
    – Rajinder
    Commented Sep 16, 2019 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.