xia-lab / OptiLCMS

R package for optimized LC-MS spectra processing
Other
21 stars 4 forks source link

bug in result_increasedoe function #5

Open adelabriere opened 3 years ago

adelabriere commented 3 years ago

Dear OptiLCMS developpers,

I was trying to use MetaboAnalystR package and encountered a something which is obviously a bug. I was running the PerformParamsOptimization function and encountered the following error message :

Defining peak areas for filling-in....Requesting 44 peaks from A_PSS_0_110.mzXML ... got 42.
Requesting 49 peaks from A_PSS_0_144.mzXML ... got 49.
Requesting 43 peaks from A_PSS_0_178.mzXML ... got 41.
. OK, Done!
Round 1 Finished !
Model Parsing...
Model Parsing Done !

Error: $ operator is invalid for atomic vectors

I looked at the incriminated funtion and something seems clearly off in the code:

resultIncreased_doe <- function (history) 
{
  index = length(history)
  if (**history[[index]]$PPS$PPS** == 0 & index == 1) {
    MessageOutput(paste("Error: No isotopes detected in your \n                        Intensive ROI of your data, Please manually customize the parameter!"), 
      "\n")
    return(NULL)
  }

It seems to me that the part in bold should definitely not be history[[index]]$PPS$PPS but history[[index]]$PPS. I guess it is a bug.

Would you be kind enough to fix it ?

bwyu-dayspring commented 3 years ago

I'm also getting a similar error running PerformParamsOptimization:

` Round:1 DoE Running Begin... Done!
Round 1 Finished ! Model Parsing... Gaussian peak ratio (%): 66.4. Model Parsing Done !

Round:2 DoE Running Begin... Done!
Round 2 Finished ! Model Parsing... Gaussian peak ratio (%): 66.4. Model Parsing Done !

Round:3 DoE Running Begin... Done!
Round 3 Finished ! Model Parsing... Model Parsing Done !

Error: $ operator is invalid for atomic vectors ` not sure if the line referenced in the previous comment is the offending line or whether this is due to something in my data?

adelabriere commented 3 years ago

Hi, @bwyu-dayspring. Just for your information. I contacted the developpers by emails and they are having a look at it.