Error SpectrumList_mzXML

Error SpectrumList_mzXML CoB  2023-02-03 02:47
Dear Skyline Team,

I am using Skyline and I have a problem with looking into the MS spectra of my imported files.

I have mzXml files that contain a subset of a given retention time window and m/z range (subsetted in MSconvert).
These files work just fine in Skyline.
After retention time alignment using an external tool, the files can be readily imported without error in Skyline again and I can evaluate these files. However, when I click on a peak to see the underlying MS information the error specified below occurs.

Thanks a lot for your help in this matter.


[SpectrumList_mzXML::spectrum()] Index out of bounds.
OK More Info
System.Exception: [SpectrumList_mzXML::spectrum()] Index out of bounds.
   at pwiz.CLI.msdata.SpectrumList.spectrum(Int32 index, DetailLevel detailLevel)
   at pwiz.ProteowizardWrapper.MsDataFileImpl.GetCachedSpectrum(Int32 scanIndex, DetailLevel detailLevel) in C:\proj\skyline_22_2\pwiz_tools\Shared\ProteowizardWrapper\MsDataFileImpl.cs:line 1232
   at pwiz.ProteowizardWrapper.MsDataFileImpl.GetSpectrum(Int32 spectrumIndex) in C:\proj\skyline_22_2\pwiz_tools\Shared\ProteowizardWrapper\MsDataFileImpl.cs:line 931
   at pwiz.Skyline.Model.Results.ScanProvider.GetMsDataFileSpectraWithCommonRetentionTime(Int32 internalScanIndex, Boolean ignoreZeroIntensityPoints, Nullable`1 centroidedMs1, Nullable`1 centroidedMs2) in C:\proj\skyline_22_2\pwiz_tools\Skyline\Model\Results\ScanProvider.cs:line 210
   at pwiz.Skyline.Model.Results.MsDataFileScanHelper.BackgroundScanProvider.Work() in C:\proj\skyline_22_2\pwiz_tools\Skyline\Model\Results\MsDataFileScanHelper.cs:line 441
Nick Shulman responded:  2023-02-03 07:03
It would be very helpful if you could send us your Skyline document and that mzXML file.
In Skyline you can use the menu item:
File > Share
to create a .zip file containing your Skyline document and extracted chromatograms.

If that .zip file and the .mzXML file are less than 50MB you can attach them to this support request.
You can upload larger files here:

I could imagine an error like this happening if you extracted chromatograms from one .mzXML file, but, then, when you were clicking on points along the chromatogram in Skyline, the file that Skyline was finding was a different file with the same name that had a different number of spectra in it.
It might be helpful if you could send us the .mzXML file from before when you did the retention time alignment.

-- Nick
CoB responded:  2023-02-03 08:06
Thanks for the quick reply.
I compiled the files you mentioned. Would it be possible to transfer the files via a more secure way than the file sharing folder?

Nick Shulman responded:  2023-02-03 08:15
I will send you an email.
-- Nick
Nick Shulman responded:  2023-02-03 14:40
Thank you for sending those files.
The problem is that the "index" in your file "alignedLin_10159.mzXML" has the wrong numbers in it.
I would recommend that you remove the index from that file so that it just ends with "</msRun></mzXML>".

The mzXML file format can have an index at the end of it which can tell tools the byte offset within the file to find each spectrum. The problem is probably that the tool which produced "alignedLin_10159.mzXML" from "raw_10159.mzXML" made changes which affected how many bytes were in the file, but it did not change the offset values within the index.

If you are using "msconvert" to create your mzXML or mzML file, then you can pass the "--noindex" commandline parameter (or uncheck the "Write Index" checkbox if you are using the MSConvert graphical user interface).
If you are going to be changing the mzXML or mzML file it is recommended that you tell msconvert not to write out the index.
-- Nick
CoB responded:  2023-02-06 03:58
Thanks for looking into my files.

Unfortunately, when I uncheck the "write index" box in MSConvert I directly end up with the "index out of bounds" error, even without retention time alignment.
If I manually delete the index lines at the end of the mzXML files so it ends with "</msRun></mzXML>", I also end up with the same error.

Nick Shulman responded:  2023-02-06 09:29
After you have created a mzXML which does not have an invalid index in it, it is conceivable that it would be necessary for you to tell Skyline to extract chromatograms again from that new file. That is, go to "Edit > Manage Results > Remove All" then "File > Save" and "File > Import > Results".

If you are still getting this error then you should send me your new mzXML files as well as the file that you get when you do "File > Share".
-- Nick
Nick Shulman responded:  2023-02-06 15:39
Thank you for sending that new set of files. I am not sure why I thought that removing the <index> fixed the problem for me. It could be that I was only looking at spectra which were early on in the spectrum list.
Part of the reason why this error is happening is that there are 715 spectra in the .mzXML file, and they are numbered 596 through 1310.
Normally, it is not a problem that the numbering does not start at 1 because there is usually a <index> at the end of the file which says where to find the spectrum with a particular number. Unfortunately, since that index is not there, ProteoWizard expects the numbering to start at 1.
One thing that you could do is tell MSConvert to convert the file from mzXML to mzXML and write out the index. The new file will have an index in it, the offsets in the index will all be the correct numbers and things will work.
(If you are using the MSConvert Graphical User Interface to convert the file then I think you need to tell it to write out the file to a different directory, since, otherwise, the file that it is converting to will be the same as the file that it was converting from).

I think there is a bug where Skyline cannot find the spectrum with a particular ID. I will ask around and try to find someone to fix this.
-- Nick
CoB responded:  2023-02-07 01:42
Hi Nick,

Re-writing of the mzXML with index in MSConvert solved the issue.

Thanks a lot for your effort!