Erik,
Sadly, manually editing mzML (and mzXML files) almost never works out well. Some tools will be able to parse your mzML fine (those that don't use the wrapper index) but Comet expects an mzML with a valid scan index. And your manually edited file has a couple of issues with that scan index. If you want to pursue the single scan mzML route, read below for what I observe and the fix. If I were in your shoes, I would either (1) use the "
scan_range" parameter in Comet to search a single scan in your unedited, valid mzML file, e.g. "scan_range = 1 1" to search only spectrum 1. Or convert your data to mgf or ms2 and edit either of those formats to avoid the complexities of trying to make a valid mzML.
Here's why Comet doesn't like your mzML file:
Towards the end of your mzML, it has this line entry:
<offset idRef="scan=1">4375</offset>
That index offset value 4375 points to line 73 of test_spectra.mzML which is incorrect:
<spectrumList count="2" defaultDataProcessingRef="pwiz_Reader_conversion">
I'm no mzML expert but I believe the index offset value should point to line 74 which is the spectrum element that contains that "scan=1" id. The file offset for the beginning of this line is 4437. Here's line 74:
<spectrum index="0" id="scan=1" defaultArrayLength="82">
If I manually edit your test_spectra.mzML with the changes below in red, Comet searches it fine.
<indexList count="1">
<index name="spectrum">
<offset idRef="scan=1">4437</offset>
</index>
<index name="chromatogram">
</index>
</indexList>
<indexListOffset>9047</indexListOffset>
</indexedmzML>
Hope this helps. Thanks for using Comet and let me know if you have any follow-up questions!
Jimmy