IRS_normalization icon indicating copy to clipboard operation
IRS_normalization copied to clipboard

Error in IRS calculations in "understanding_IRS"

Open Arthfael opened this issue 11 months ago • 0 comments

Dear Phil,

I just wrote an implementation of IRS right now for one of my pipelines and I was checking for reference your code at: https://pwilmart.github.io/IRS_normalization/understanding_IRS.html I think there is a mistake, line:

irs <- tibble(rowSums(exp1_sl), rowSums(exp2_sl), rowSums(exp3_sl))

should be

irs <- tibble(apply(exp1_sl, 1, function(x) exp(mean(log(x)))),
              apply(exp2_sl, 1, function(x) exp(mean(log(x)))),
              apply(exp3_sl, 1, function(x) exp(mean(log(x)))))
      

that is, you want an average value, and more generally, the same averaging function used to calculate irs$average should be used. Otherwise, and unless I am missing something here (but it is very simple arithmetic, and the concept is very simple and clear), the calculations do not seem to make sense: we want to correct, row-wise, for each TMT batch by the ratio between the general dataset's average and the average of all of the batch's channels (or reference channels if there are any). Best,

Armel

Arthfael avatar May 23 '25 11:05 Arthfael