jcapelladesto / geoRge

geoRge: a computational tool for stable isotope labelling detection in LC/MS-based untargeted metabolomics
GNU General Public License v3.0
10 stars 6 forks source link

Error message with basepeak_finder #14

Closed kaitlin-rempfert closed 3 years ago

kaitlin-rempfert commented 3 years ago

Hello, I am having an issue running basepeak_finder, even on the example dataset. I keep getting the error:

Error in xj[i] : only 0's may be mixed with negative subscripts In addition: Warning messages: 1: In temp$mzmed - mz0 : longer object length is not a multiple of shorter object length 2: In abs(temp$mzmed - mz0) * 1e+06/mz0 : longer object length is not a multiple of shorter object length'

running the following code:

library(xcms)
library(geoRge)
data(mtbls213)

s1 <- PuInc_seeker(XCMSet=mtbls213,ULtag="CELL_Glc12",Ltag="CELL_Glc13",sep.pos.front = TRUE)
s2 <- basepeak_finder(PuIncR=s1,XCMSet=mtbls213,UL.atomM=12.0,L.atomM=13.003355,
  ppm.s=6.5,Basepeak.minInt=2000)
jcapelladesto commented 3 years ago

It seems that the last update broke some code. Let me look into it, I will fix this ASAP

jcapelladesto commented 3 years ago

Dear kaitlin, the issue should be solved, please try again after reinstalling

kaitlin-rempfert commented 3 years ago

Thank you! I've reinstalled and the issue has been resolved.

kaitlin-rempfert commented 3 years ago

Hi, Jordi. I’m running into some issues with the basepeak_finder function still. I can get the function to run using the parameters from the vignette, however, I receive the same error message as before “Error in xj[i] : only 0's may be mixed with negative subscripts. In addition: Warning message: In temp$mzmed - mz0 :longer object length is not a multiple of shorter object length” when adjusting some parameters.

An example I can reproduce with the mtbs213 xset:

data(mtbls213)

s1_1 <- PuInc_seeker(XCMSet=mtbls213,ULtag="CELL_Glc12",Ltag="CELL_Glc13",sep.pos.front =TRUE)

#this runs as expected 
s2_1 <- basepeak_finder(PuIncR = s1_1, XCMSet = mtbls213, UL.atomM=12.0, L.atomM=13.003355, rt.win.min = 5, ppm.s = 6.5, Basepeak.minInt=1000)

#this results in error
s2_1 <- basepeak_finder(PuIncR = s1_1, XCMSet = mtbls213, UL.atomM=12.0, L.atomM=13.003355, rt.win.min = 5, ppm.s = 10, Basepeak.minInt=1000)

When it comes to my data (I can send a .rds file of the xset if necessary), this can be ignored for some datasets by finding parameters that work by trial and error, but for one dataset I cannot get it to successfully run without this message. Can you take a look into this? Thank you!

jcapelladesto commented 3 years ago

Small update regarding this: I found the problem and solved it. I will also add some changes in the code and new functions.

I will update the package and close the issue ASAP Thank you for your input.

jcapelladesto commented 3 years ago

Hi, sorry for the delay.

I have done a revision of the code and hopefully solved all prior bugs. I have also added a new function to load data from MsnBase XCMSExp objects and a refinegeoRge() function to improve geoRge results according to desired results.

I will update the code right now