prafols / rMSI2

rMSI version two
GNU General Public License v3.0
2 stars 3 forks source link

Crash with METASPACE datasets #3

Closed enriquemartinezdev closed 1 year ago

enriquemartinezdev commented 1 year ago

When processing METASPACE datasets in peaklist mode, rMSI2 crashes.

Datasets: https://metaspace2020.eu/dataset/2023-03-25_05h07m36s https://metaspace2020.eu/dataset/2023-05-12_15h13m22s https://metaspace2020.eu/dataset/2023-06-02_23h41m00s

Execution script:

proc <- rMSI2::ProcessingParameters()
data <- rMSI2::ImzMLDataDescription()
proc$preprocessing$massCalibration <- F
data$appendImzMLDataPath("/path/to/input.imzML")
data$setOutputPath("/path/to/output")
data$data_is_peaklist <- T
rMSI2::ProcessImages(proc, data)

Output:

R version 4.2.2 Patched (2022-11-10 r83330) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> proc <- rMSI2::ProcessingParameters()
> data <- rMSI2::ImzMLDataDescription()
> proc$preprocessing$massCalibration <- F
> data$appendImzMLDataPath("/path/to/input.imzML")
> data$setOutputPath("/path/to/output")
> data$data_is_peaklist <- T
> rMSI2::ProcessImages(proc, data)
Parsing ROI info of imzML 1 of 1
Loading image 1 of 1
Parsing XML data in imzML file...
Checking ibd UUID...OK
WARNING: Checksum validation is disabled, data may be corrupt!
Binning peaks...
33%|=================================                                           66%|==================================================================                                  | 2/3
 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: CRunPeakBinning(img_lst_proc, numOfThreads, memoryPerThreadMB,     proc_params$preprocessing)
 2: RunPreProcessing(proc_params, data_description$outputpath, img_lst,     data_description$data_is_peaklist, numOfThreads, memoryPerThreadMB)
 3: rMSI2::ProcessImages(proc, data)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
100%|====================================================================================================| 3/3

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: CRunPeakBinning(img_lst_proc, numOfThreads, memoryPerThreadMB,     proc_params$preprocessing)
 2: RunPreProcessing(proc_params, data_description$outputpath, img_lst,     data_description$data_is_peaklist, numOfThreads, memoryPerThreadMB)
 3: rMSI2::ProcessImages(proc, data)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 

With the dataset "20230531_dv_lungatlas_nglyc_25um.imzML" this warning appears and it also fails, I'm not sure if it fails for the same reason or if it's an issue with the dataset: Warning in imzML parsing: No pixel size found!!!!!!!, assuming 1 um

prafols commented 1 year ago

Crash fixed with commit 0f87e67.

The warning messages related to pixel size has nothing to do with this. Some imzML files are malformed and miss some data (like the spatial resolution).