Hi,
from what I understand then (note: this is a follow up to a question asked on the tximport github) the cpm counts calculated in the last line of the tximport edgeR vignette, that is:
cpms <- edgeR::cpm(y, offset = y$offset, log = FALSE)
cannot be used directly (I mean as they are) to calculate logFC between expression levels of a gene of interest in two different samples (say I have only two samples, pre and post-treatment). Instead one should further process y using something like:
y <- estimateDisp(y)
et <- exactTest(y)
In other words, neither the cmps calculated as above nor the count values found in y can be used as they are for between samples comparisons, is that correct?
Thank you very much for your help with this matter! Marco
Apologies, I should have been more expansive in my first post. I understand that 1 vs 1 cannot give you e.g. reliable p-values for differences but my goal here is simply to create a heatmap of pre vs post treatment logFC across individual patients. My question about cmps is linked to this snippet of code from the tximport vignette:
where the calcNormFactors function is used to calculate the TMM effective library size given that the default 'method' argument in calcNormFactor appears to be "TMM". In fact from what I understand TMM counts can be obtained by simply running:
where y is a DGEList object. If what I just wrote is correct (which might not be) then the 'cpms' calculated in the tximport vignette are not the classic CPMs, but rather more akin to TMMs. Also I don't really understand why not using simply the two lines of code above (calcNormFactors+cpm) to get from tximport$counts (run with the option countsFromAbundance="no") to a y object that can be used in downstream analysis.
My impression is that for what I want (that is, a heatmap of pre vs post treatment logFC where columns are patients and rows are genes from a list of genes of interest, I could just run the following:
and then take the difference between the log values in the TMM_log_counts matrix.
Does this sound reasonable or am I (very possibly) missing something?
Thanks for your help! Marco