Hi all,

Sorry I know that this question has been asked several times, but unfortunately I haven't been able to find the right answer, or didn't understand.

I'm trying to get TMM normalized counts thanks to edgeR.

I understand that I have to compute normalization factors :

    dgList <- calcNormFactors(dgList, method="TMM")

which gives me a normalization factor for all samples :

    head(dgList$samples)
    
    group lib.size norm.factors
    S1     1 21087314    0.9654794
    S2     1 16542810    1.1589117
    S3     1 18875473    0.8763291
    S4     1 15865414    1.0864038
    S5     1 19179795    1.0488230
    S6     1 15063992    1.0707007

But at this step I don't know what to do to get a matrix of normalized TMM counts.

I know that I can get CPM normalized counts thanks to :

    cpm(dgList)

But CPM and TMM are not the same, right ?

Thanks in advance for any of your input on this topic.



No, CPM and TMM are not exactly the same indeed.

perhaps try this snippet of code:

    dgList <- estimateCommonDisp(dgList)
    dgList <- estimateTagwiseDisp(dgList)
    norm_counts.table <- t(t(dgList$pseudo.counts)*(dgList$samples$norm.factors))
    write.table(norm_counts.table, file="./normalizedCounts.txt", sep="\t", quote=F)

