shubham1637 / DIAlignR

This is a R package for alignment of DIA mass-spec data
5 stars 1 forks source link

TODO: incorporate helpful error message for getLOESSfit #20

Open singjc opened 2 years ago

singjc commented 2 years ago

getLOESSfit returns an uninformative error when using non-optimal maxGlobalFdr for loess fit.

Error in vecseq(f__, len__, if (allow.cartesian || notjoin || !anyDuplicated(f__,  : 
  Join results in 5359 rows; more than 5228 = nrow(x)+nrow(i). Check for duplicate key values in i each of which join to the same group in x over and over again. If that's ok, try by=.EACHI to run j for each group to avoid the large allocation. If you are sure you wish to proceed, rerun with allow.cartesian=TRUE. Otherwise, please search for this error message in the FAQ, Wiki, Stack Overflow and data.table issue tracker for advice.

There is a check that increments the maxGlobalFdr by 10 times get_global_fit.R#L246, but in my case I had to decrease the FDR to 0.01 for one run pair, and even further 0.006 for another run pair. Might need to implement another check that decrements maxGlobalFdr.

shubham1637 commented 2 years ago

You may provide a lower fdr value to startwith params[["globalAlignmentFdr"]]

singjc commented 2 years ago

You may provide a lower fdr value to startwith params[["globalAlignmentFdr"]]

Yeah that's what I did, but I had to debug the code line by line to figure out what parameter I had to change. The internal error complains about a table join, so it wasn't as straight forward as what caused the error. Just leaving this issue as a self-reminder to put a more helpful error message, to direct the user what parameter they should adjust. I can add a message when I make an update.