This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Confused with EdgeR TMM normalization

Call me stupid but I don't have a solid mathematics basis and I'm new to edgeR.

As I understood, edgeR uses M value (log FC) in the form of log relative risk for normalization, since we don't know the actual gene expression.

Variance of M is calculated with delta method and 'inverse of these is used to weight the average' according to the paper.

So by calculating the weighted average of M, we want to see the average log FC between sample and reference and use it as the norm.factor (log2 TMM).

but isn't the weight (Nk-Ygk)/(NkYgk)+(Nr-Ygr)/(NrYgr) the same as the variance of M which is 1/Ygk-1/Nk+1/Ygr-1/Nr according to delta method ??

If the variance itself is used as weight, Mgk with high variance (low precision) would have more impact on weighted average, so it should be the inverse of the variance as the paper says, but to my stupid eyes, the variance seems to be the weight.

What am I missing??

Also, I didn't fully read the following parts but as I know the read counts are not normalized during EdgeR.

So after calculating the effective library size by norm.factor*original library size, the sum of read counts would be larger than effective library size?

edger normalization tmm rnaseq

1 answer

Where did you get the statement M = 1/Ygk-1/Nk+1/Ygr-1/Nr from? There is no expression 1/Ygk-1/Nk+1/Ygr-1/Nr anywhere in the published TMM paper, and it is not the definition of the M-value.

The raw library sizes (sum of read counts) are not systematically larger than the effective library size. I am not clear from your post why you would think that. In reality, the geometric mean of the effective library sizes in the same as the geometric mean of the raw library sizes.

Thank you for your time and contribution to the world. What I meant was the variance of Mgk would be 1/Ygk-1/Nk+1/Ygr-1/Nr according to the delta method and it is the same as wgk which is (Nk-Ygk)/(NkYgk)+(Nr-Ygr)/(NrYgr). Is it not?

Also library sizes are scaled down or upwards by norm.factor*library size in to effective library sizes. If a norm.factor is below 1 and library is scaled down, it's 'analogous to scaling the counts upwards in that library'. I'm not clear with that.

For example if the count of gene1 was 50, gene2 was 10, rest of the genes is 40 and the total count was 100, and the effective library size is 50, effective library size of a sample would be smaller than the sum of read counts since the read counts are not normalized. Isn't it? If so, it means gene 2 is upscaled from 0.1 to 0.2 proportionwise?

I think I'm confused because I understand why normalization is needed but not sure how effective library size is used later on. I just assume it's used for estimating the proper negative binomial distribution for Ygk? I will spend more time to read about the following parts but I am struggling to understand one by one I'm sorry.

Thanks for editing the question. I can now parse your question about the weights.

Yes, you are correct. The formula that Robinson & Oshlack (2010) give for w_gk on page 7 of their paper is actually the variance rather than the weight. The weight is the inverse of the variance, i.e., the reciprocal of the formula that is given. It is just a mis-statement in the paper -- the calculations are correct in the code.

The logarithms of the effective library sizes are used as offsets in the generalized linear models fitted by edgeR. This is not the same as scaling the counts.

Reference

Robinson, M.D., Oshlack, A. A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biol 11, R25 (2010). https://doi.org/10.1186/gb-2010-11-3-r25

Thank you so much now I can pursue reading EdgeR documents!

Log in to answer this question.