Vitek-Lab / MSstats

R package - MSstats
72 stars 44 forks source link

check replicate still false #131

Open YoujiaMa opened 1 month ago

YoujiaMa commented 1 month ago

hi msstats team . I'm not sure this code is intended to confirm the existence of technical replicates of the data. But using all will return false for my result.

https://github.com/Vitek-Lab/MSstats/blob/6d3a9666bb19df199ba7de0a0d0df557b7afd237/R/utils_groupcomparison_checks.R#L65

RUN Protein ABUNDANCE originalRUN GROUP SUBJECT TotalGroupMeasurements NumMeasuredFeature MissingPercentage more50missing NumImputedFeature
2 A0A0A0MS15 21.70686 2 case1 1 27 3 0.0000000 FALSE 0
4 A0A0A0MS15 18.92387 4 case2 2 27 1 0.6666667 TRUE 2
5 A0A0A0MS15 21.20659 5 case2 2 27 2 0.3333333 FALSE 1
6 A0A0A0MS15 20.58170 6 case2 2 27 2 0.3333333 FALSE 1
8 A0A0A0MS15 21.30052 8 case3 3 27 3 0.0000000 FALSE 0
tonywu1999 commented 1 month ago

@YoujiaMa

Hi,

Thank you for bringing attention to this issue. I confirmed this should not be the behavior of this function as your example would cause a linear model to be fit, but that linear model assumes independence between each run, which is not true if there are technical replicates.

That line should be changed to any(run_counts$NumRuns != 1)

tonywu1999 commented 1 month ago

Merged into devel branch. Pending push to bioconductor