lgatto / synapter

Label-free data analysis pipeline for optimal identification and quantitation
https://lgatto.github.io/synapter/
4 stars 2 forks source link

modelIntensity and correctIntensities is counterintuitive #126

Closed sgibb closed 7 years ago

sgibb commented 7 years ago

The current workflow using modelIntensity and correctIntensities is counterintuitive. While modelRt build the rt model and corrects the retention times the modelIntensity functions just creates the model and a new column intensityCorrectionFactor. In contrast to the rt correction the user has to apply the correctIntensities functions manually on a MSnSet:

# synapter workflow
# ...

modelIntensity(synapterObj)

msnset <- as(synapterObj, "MSnSet")

## do stuff with msnset

correctedMSnSet <- correctIntensities(msnset)

I would suggest to correct the intensities automatically, create the intensityCorrectionFactor column and if the user wants to requantifiy the intensity correction could be undone and redone afterwards:

# synapter workflow
# ...

modelIntensity(synapterObj)
# and run: intensity = intensity * intensityCorrectionFactor 

msnset <- as(synapterObj, "MSnSet")

requantify(msnset, ...)
# intensity = intensity / intensityCorrectionFactor
# requantify
# intensity = intensity * intensityCorrectionFactor

This approach would completely remove the need to call correctIntensities manually (in the same manner as nobody needs to call correctRetentionTimes). IMHO the uncorrected intensities are just useful for requantify.

What is your opinion @pavel-shliaha ?

pavel-shliaha commented 7 years ago

very nice thinking! I completely agree with that!