chhh / MSFTBX

MS File ToolBox - tools for parsing some mass-spectrometry related file formats (mzML, mzXML, pep.xml, prot.xml, etc.)
Apache License 2.0
12 stars 4 forks source link

Exception in thread "SetUp" java.lang.NullPointerException when parsing mzXML file. #8

Closed KenWifi closed 5 years ago

KenWifi commented 6 years ago

Hi,

When I tried the example codes to read one mzXML file, there was an error.

                        MZXMLFile mzxmlFile = new MZXMLFile("../../test.mzXML");

                        ScanCollectionDefault scans = new ScanCollectionDefault();

                        scans.setDefaultStorageStrategy(StorageStrategy.SOFT);

                        scans.isAutoloadSpectra(true);

                        scans.setDataSource(mzxmlFile);

                        mzxmlFile.setNumThreadsForParsing(threads);

                        try {
                            scans.loadData(LCMSDataSubset.MS2_WITH_SPECTRA);
                        } catch (FileParsingException e) {
                            e.printStackTrace();
                            System.exit(1);
                        }

And the error is : Exception in thread "SetUp" java.lang.NullPointerException at umich.ms.fileio.filetypes.mzxml.MZXMLRunHeaderParser.parse(MZXMLRunHeaderParser.java:97) at umich.ms.fileio.filetypes.mzxml.MZXMLFile.parseRunInfo(MZXMLFile.java:113) at umich.ms.fileio.filetypes.AbstractLCMSDataSource.fetchRunInfo(AbstractLCMSDataSource.java:74) at umich.ms.fileio.filetypes.xmlbased.AbstractXMLBasedDataSource.parse(AbstractXMLBasedDataSource.java:122) at umich.ms.datatypes.scancollection.impl.ScanCollectionDefault.loadData(ScanCollectionDefault.java:764) at umich.ms.datatypes.scancollection.impl.ScanCollectionDefault.loadData(ScanCollectionDefault.java:748) at PSMviewer.gui.utils.FileImport.DatabaseImportDialog$4.run(DatabaseImportDialog.java:493) What's more, I used BatMass to read it, there was same error as well. And I changed different mzXML files, it has same problem.

I wish you have idea about this problem.

Kai