ChiungTingWu / ncGTW

Profile Alignment by Neighbor-wise Compound-specific Graphical Time Warping with Misalignment Detection
8 stars 2 forks source link

Error in misalignDetect()/ exclusiveGroups() #1

Open hhabra opened 3 years ago

hhabra commented 3 years ago

I'm trying to use ncGTW to help fix misalignments in an 8 batch LC-MS metabolomics alignment (currently using the first 4 to test possible strategies), but I'm running into an error in the misalignDetect() function that says:

"Error in abs(groups[tempInd[i], "mzmed"] - groups[tempInd[j], "mzmed"])/min(groups[tempInd[i], : comparison (3) is possible only for atomic and list types"

Based on my limited investigation so far, the problem is traceable to the exclusiveGroups() function at line 17. Unfortunately haven't gotten too far in depth as to why exactly this may be happening, so I was wondering if you could assist me. I can upload or share xcmsSet objects if you wish.

Thanks for any assistance.

hhabra commented 3 years ago

Looks like I figured it out. Apparently I tried using the misalignDetect function without setting a value for ppm (I wrote ppm = ppm, without first running the line ppm <- 20), leading to the error in that step.

Based on this, I'd recommend adding a small validity check to check if the function arguments are appropriate. For example, a line or function that checks if ppm is a positive numeric value and gives an error if ppm is not numeric/ positive would be more informative than the error I was getting.