cbroeckl / RAMClustR

Assigning precursor-product ion relationships in indiscriminant MS/MS data
MIT License
12 stars 16 forks source link

Run error in RAMClustR #5

Closed dwalke04 closed 6 years ago

dwalke04 commented 8 years ago

Hello, Excellent work on RAMClustR. I've been running into an error when trying to use RAMClustR. Both data from apLCMS and the data provided with the package have caused the same error. I was attempting to use MS1 data only to deconvolute isotopes, in-source fragments and additional adducts. I've been running the following:

res1<- ramclustR (xcmsObj = NULL, ms = "MSdata.csv", idmsms = NULL, taglocation = "filepaths", MStag = NULL, idMSMStag = NULL, featdelim = "", timepos = 2, st = 20, sr = 0.5, maxt = 20, deepSplit = FALSE, blocksize = 2000, mult = 5, hmax = 0.3, sampNameCol = 1, collapse = TRUE, mspout = FALSE, mslev = 1, ExpDes = NULL, normalize = "TIC", minModuleSize = 2, linkage="average")

The function will run through the following steps: calculating ramclustR similarity: nblocks = 6 finished:1 2 3 4 5 6 RAMClust feature similarity matrix calculated and stored: 0.3 minutes RAMClust distances converted to distance object: 0.1 minutes fastcluster based clustering complete: 0 minutes

And then produce the following error: Error in .subset2(x, i, exact = exact) : subscript out of bounds

My R session information is below. Thank you in advance for your help.

R version 3.1.2 (2014-10-31) Platform: x86_64-apple-darwin13.4.0 (64-bit)

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] parallel stats graphics grDevices utils datasets methods
[8] base

other attached packages: [1] ff_2.2-13 bit_1.1-12 CAMERA_1.22.0
[4] igraph_1.0.1 BiocInstaller_1.16.5 dynamicTreeCut_1.62 [7] fastcluster_1.1.16 xcms_1.42.0 Biobase_2.26.0
[10] BiocGenerics_0.12.1 mzR_2.0.0 Rcpp_0.12.0
[13] RAMClustR_0.2 devtools_1.9.1

loaded via a namespace (and not attached): [1] acepack_1.3-3.3 cluster_2.0.3 codetools_0.2-14
[4] colorspace_1.2-6 curl_0.9.1 digest_0.6.8
[7] foreign_0.8-65 Formula_1.2-1 ggplot2_1.0.1
[10] graph_1.44.1 grid_3.1.2 gridExtra_2.0.0
[13] gtable_0.1.2 Hmisc_3.16-0 httr_1.0.0
[16] lattice_0.20-33 latticeExtra_0.6-26 magrittr_1.5
[19] MASS_7.3-43 memoise_0.2.1 munsell_0.4.2
[22] nnet_7.3-10 plyr_1.8.3 proto_0.3-10
[25] R6_2.1.0 RBGL_1.42.0 RColorBrewer_1.1-2 [28] reshape2_1.4.1 rpart_4.1-10 scales_0.2.5
[31] splines_3.1.2 stats4_3.1.2 stringi_0.5-5
[34] stringr_1.0.0 survival_2.38-3 tcltk_3.1.2
[37] tools_3.1.2

dwalke04 commented 8 years ago

Update: I tried running your function directly from the source code, and it was successful. The only alteration I had to make was to paste the paramset list into R. Otherwise there were no problems. I then tried re-starting R, loading the paramset list and running the function from the package. The same error popped up.

sneumann commented 8 years ago

Hi dwalke04, thanks for trying RAMClustR. Could you provide us with a self-contained test case and attach the res_1<- ramclustR(xcms = "MSdata.csv",...) so @cbroeckl and I can try to reproduce the issue ? Yours, Steffen

dwalke04 commented 8 years ago

Hi Steffen, Thanks for the response. When I run the function, it does not finish and produce res_1. However, when I cut and paste the runscript for the ramclustR function it is able to finish (with the results stored in RC). I've attached the MSdata.csv file as well as the RC list, runscript and the msp_out results. Thanks again for your help, Doug RAMClust_r_files_20150102.zip

sneumann commented 8 years ago

Hi, I can confirm the issue with the code snippet

library(RAMClustR)
load("RC_out_RAMCLustR_20150102.RData")

res_1 <- ramclustR (xcmsObj = NULL, ms = "MSdata.csv",
                    idmsms = NULL,
                    taglocation = "filepaths",
                    MStag = NULL, idMSMStag = NULL, featdelim = "_", timepos = 2,
                    st = 20, sr = 0.5, maxt = 20, deepSplit = FALSE,
                    blocksize = 2000, mult = 5, hmax = 0.3, sampNameCol = 1,
                    collapse = TRUE, mspout = FALSE, mslev = 1, ExpDes = NULL,
                    normalize = "TIC", minModuleSize = 2, linkage="average")

using the version cbroeckl-RAMClustR-ea68215 and "MSdata.csv" from RAMClust_r_files_20150102.zip in this function:

> traceback()
4: (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x, 
       i, exact = exact))(x, ..., exact = exact)
3: `[[.data.frame`(ExpDes, 2)
2: ExpDes[[2]]
1: ramclustR(xcmsObj = NULL, ms = "MSdata.csv", idmsms = NULL, taglocation = "filepaths", 
       MStag = NULL, idMSMStag = NULL, featdelim = "_", timepos = 2, 
       st = 20, sr = 0.5, maxt = 20, deepSplit = FALSE, blocksize = 2000, 
       mult = 5, hmax = 0.3, sampNameCol = 1, collapse = TRUE, mspout = FALSE, 
       mslev = 1, ExpDes = NULL, normalize = "TIC", minModuleSize = 2, 
       linkage = "average") 

If you fake an ExpDes like this:

e1=data.frame(values="1")
rownames(e1) <- "MSlevs"

e2=data.frame(values="2")
rownames(e2) <- "MSlevs"

ExpDes <- list(e1,e2)
ExpDes[[2]]["MSlevs", 1]

then it gets further, and breaks with:

Error in ramclustR(xcmsObj = NULL, ms = "MSdata.csv", idmsms = NULL, taglocation = "filepaths",  : 
  trying to get slot "phenoData" from an object of a basic class ("NULL") with no slots

so we need to make it more robust for data provided as ms = "MSdata.csv".

Yours, Steffen

cbroeckl commented 8 years ago

Hello Doug,

I’ll take a look and try to get this working.

Corey

From: dwalke04 [mailto:notifications@github.com] Sent: Saturday, January 2, 2016 12:34 PM To: sneumann/RAMClustR RAMClustR@noreply.github.com Cc: Broeckling,Corey Corey.Broeckling@ColoState.EDU Subject: Re: [RAMClustR] Run error in RAMClustR (#5)

Hi Steffen, Thanks for the response. When I run the function, it does not finish and produce res_1. However, when I cut and paste the runscript for the ramclustR function it is able to finish (with the results stored in RC). I've attached the MSdata.csv file as well as the RC list, runscript and the msp_out results. Thanks again for your help, Doug RAMClust_r_files_20150102.ziphttps://github.com/sneumann/RAMClustR/files/76368/RAMClust_r_files_20150102.zip

— Reply to this email directly or view it on GitHubhttps://github.com/sneumann/RAMClustR/issues/5#issuecomment-168422046.

cbroeckl commented 8 years ago

Doug,

sorry for the delay. I think I have fixed this problem. I have a script in ‘RAMClustR\inst\exampledata’ which can be used to test the function for the example datasets, and I have a bit more example data in that directory as well. Let me know if you continue to have problems.

Corey

From: Broeckling,Corey Sent: Saturday, January 02, 2016 6:30 PM To: sneumann/RAMClustR reply@reply.github.com; sneumann/RAMClustR RAMClustR@noreply.github.com Subject: RE: [RAMClustR] Run error in RAMClustR (#5)

Hello Doug,

I’ll take a look and try to get this working.

Corey

From: dwalke04 [mailto:notifications@github.com] Sent: Saturday, January 2, 2016 12:34 PM To: sneumann/RAMClustR RAMClustR@noreply.github.com<mailto:RAMClustR@noreply.github.com> Cc: Broeckling,Corey Corey.Broeckling@ColoState.EDU<mailto:Corey.Broeckling@ColoState.EDU> Subject: Re: [RAMClustR] Run error in RAMClustR (#5)

Hi Steffen, Thanks for the response. When I run the function, it does not finish and produce res_1. However, when I cut and paste the runscript for the ramclustR function it is able to finish (with the results stored in RC). I've attached the MSdata.csv file as well as the RC list, runscript and the msp_out results. Thanks again for your help, Doug RAMClust_r_files_20150102.ziphttps://github.com/sneumann/RAMClustR/files/76368/RAMClust_r_files_20150102.zip

— Reply to this email directly or view it on GitHubhttps://github.com/sneumann/RAMClustR/issues/5#issuecomment-168422046.

cbroeckl commented 8 years ago

Doug,

this time for real...

I think I have a functional script up on my (cbroeckl/RAMClustR) github repository.

Corey

dwalke04 commented 8 years ago

Hi Corey, Thanks, I saw that the files had not been recently updated and assumed there was a lag period between upload and deposit. I am now able to access the newly uploaded files, and will let you know if I have any issues running the script. Thanks again for your help. Doug