# In-sample and across samples normalized expression

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

}

• 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) – llrs Sep 16 '19 at 9:12

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