Vitek-Lab / MSstats

R package - MSstats
74 stars 46 forks source link

BUG: groupComparison crashes if the first row has a missing value #2

Closed jamestwebber closed 10 years ago

jamestwebber commented 10 years ago

Ran into this when a particular file started crashing after performing all the comparisons. It's coming from this line where it checks whether the first abundance value is log2 transformed--if that value happens to be NA (which is going to happen occasionally) then it crashes with the error:

Error in if (abs(log2(temp[1, "INTENSITY"]) - temp[1, "ABUNDANCE"]) <  : 
  missing value where TRUE/FALSE needed
Calls: groupComparison

There are a couple reasonable solutions--just look for the first non-NA value here (it looks like it should be doing that anyway. I have no idea why it doesn't work!), or (probably better) keep track of the log transformation explicitly, rather than using this test to guess what it was.