sirius-ms / sirius

SIRIUS is a software for discovering a landscape of de-novo identification of metabolites using tandem mass spectrometry. This repository contains the code of the SIRIUS Software (GUI and CLI)
GNU Affero General Public License v3.0
78 stars 17 forks source link

InvalidException: Cannot find a proper ion mode/adduct type for the given spectrum #115

Closed JosieHong closed 1 year ago

JosieHong commented 1 year ago

When importing the following spectra into SIRIUS4 I got an InvalidException, but I can not find any error in the spectra. Additionally, I am not sure which codes lead to this exception, so I am kind of confused. Could you help me solve this exception? Thanks!

BEGIN IONS
TITLE=tmp
PEPMASS=350.20117
CHARGE=1+
PRECURSOR_TYPE=M+H
MSLEVEL=2
SOURCE_INSTRUMENT=ESI-QTOF
INSTRUMENT_TYPE=ESI-QTOF
COLLISION_ENERGY=20
IONMODE=POSITIVE
127.05268 8.1
155.04914 100.0
155.15756 4.1
156.05077 1.4
161.04403 1.8
223.14503 21.3
351.20844 87.9
END IONS

The detailed error message is:

Apr 12, 2023 4:38:41 PM de.unijena.bioinf.projectspace.MS2ExpInputIterator fetchNext
SEVERE: Error while parsing compound! Skipping entry
de.unijena.bioinf.ChemistryBase.ms.inputValidators.InvalidException: Cannot find a proper ion mode/adduct type for the given spectrum. Please specify the correct ion/adduct type.
    at de.unijena.bioinf.sirius.validation.Ms2Validator.searchForIon(Ms2Validator.java:314)
    at de.unijena.bioinf.sirius.validation.Ms2Validator.checkIonization(Ms2Validator.java:280)
    at de.unijena.bioinf.sirius.validation.Ms2Validator.validate(Ms2Validator.java:56)
    at de.unijena.bioinf.projectspace.MS2ExpInputIterator.fetchNext(MS2ExpInputIterator.java:151)
    at de.unijena.bioinf.projectspace.MS2ExpInputIterator.<init>(MS2ExpInputIterator.java:76)
    at de.unijena.bioinf.projectspace.InstanceImporter$ImportInstancesJJob.importMsParserInput(InstanceImporter.java:159)
    at de.unijena.bioinf.projectspace.InstanceImporter$ImportInstancesJJob.importMultipleSources(InstanceImporter.java:128)
    at de.unijena.bioinf.projectspace.InstanceImporter$ImportInstancesJJob.compute(InstanceImporter.java:117)
    at de.unijena.bioinf.projectspace.InstanceImporter$ImportInstancesJJob.compute(InstanceImporter.java:104)
    at de.unijena.bioinf.jjobs.BasicJJob.call(BasicJJob.java:117)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
kaibioinfo commented 1 year ago

Hi, can you try to use ION= instead of PRECURSOR_TYPE=?

Also, PEPMASS=350.20117 looks like the neutral mass. Please specify the ion mass instead.

In general, MGF is, unfortunately, not a standardized format for MS/MS in metabolomics, so there is no guarantee that an MGF file for tool X also works for tool Y. SIRIUS should work for most MGF files you will find in the GNPS database, though.

JosieHong commented 1 year ago

As @kaibioinfo suggested, it works well now. Thank you!