sgibb / MALDIquantForeign

Import/Export routines for MALDIquant
https://strimmerlab.github.io/software/maldiquant/
10 stars 4 forks source link

MALDIquantForeign generates and prints a warning for every spectrum when reading imzML #32

Open AlanRace opened 3 years ago

AlanRace commented 3 years ago

I have been evaluating multiple imzML parsers (see here https://imzml.github.io/) with publicly available imzML datasets (e.g. https://metaspace2020.eu/datasets?ds=2017-06-30_07h26m26s) and experienced some issues with MALDIquantForeign.

It seems that if a common 'error' is encountered for each spectrum, then this will flood the console with one message per spectrum (which for MSI Data is a lot!) eventually leading to a system crash. The error for the dataset linked above is given below. Perhaps it would be possible to just display the warning once per dataset, rather than per spectrum?

- Warning in .createMassObject(mass = mass, intensity = intensity, metaData = m, :
-    According to the metadata information the imported data are centroided, but they are treated as profile (MassSpectrum) data. Maybe you want to use 'centroided=TRUE'. See '?import' for details.
sgibb commented 3 years ago

I see your point. I could remove the immediate. argument but than it is not clear for which spectrum the warning was thrown. You are right that for imzML datasets a collected warning once per dataset would be more helpful but for other datasets every spectrum could contain different errors.

Does suppressWarnings(importImzMl(file)) works for you?