text: user1759: 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)
      }
  
  }
  
  
  user77: 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).
  
original_text: 1759: <p>I want to get the expression data that is <strong><em>in-sample normalized</em></strong> like FPKM and also <strong><em>across samples normalized</em></strong> as obtained using DESeq2 or else.</p>
  
  <p>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?</p>
  
  <p>This is how I am doing (not the exact code but the idea)</p>
  
  <pre><code>dds &lt;- DESeqDataSetFromMatrix(countData, DataFrame(condition), ~ condition)
  dds &lt;- estimateSizeFactors(dds)
  norm_data &lt;- counts(dds, normalized=TRUE)
  
  foreach sample
  {
      foreach transcript
      {
          FPKM = (Normalized read count * 10^9) / (transcript length * total mapped normalized read count)
      }
  
  }
  </code></pre>
   77: <p>Yes, this is a standard way of obtaining RPKM/FPKM/CPM values for plotting. Not that you do not need to use a <code>for</code> 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).</p>
  