diff --git a/tests/conftest.py b/tests/conftest.py index bff6b011..7f505493 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -179,7 +179,13 @@ def _create_mzml(peptides, mzml_file, random_state=42): ) with writer.run(id=1, instrument_configuration="ic"): with writer.spectrum_list(len(peptides)): - for scan_nr, peptide in zip([17, 111], peptides): + for scan_id, peptide in zip( + [ + "scan=17", + "merged=11 frame=12 scanStart=763 scanEnd=787", + ], + peptides, + ): charge = rng.choice([2, 3]) precursor = writer.precursor_builder() @@ -193,7 +199,7 @@ def _create_mzml(peptides, mzml_file, random_state=42): writer.write_spectrum( mzs, intensities, - id=f"scan={scan_nr}", + id=scan_id, centroided=True, params=[{"ms level": 2}], precursor_information=precursor, diff --git a/tests/test_integration.py b/tests/test_integration.py index 47cee936..28fdf90a 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -75,7 +75,10 @@ def test_train_and_run( assert psms.loc[3, "sequence"] == "LESLLEK" assert psms.loc[3, "spectra_ref"] == "ms_run[2]:scan=17" assert psms.loc[4, "sequence"] == "PEPTLDEK" - assert psms.loc[4, "spectra_ref"] == "ms_run[2]:scan=111" + assert ( + psms.loc[4, "spectra_ref"] + == "ms_run[2]:merged=11 frame=12 scanStart=763 scanEnd=787" + ) # Finally, try evaluating: output_filename = tmp_path / "test-eval.mztab" diff --git a/tests/unit_tests/test_unit.py b/tests/unit_tests/test_unit.py index 120e341a..877f6a95 100644 --- a/tests/unit_tests/test_unit.py +++ b/tests/unit_tests/test_unit.py @@ -864,7 +864,7 @@ def test_spectrum_id_mgf(mgf_small, tmp_path): def test_spectrum_id_mzml(mzml_small, tmp_path): - """Test that spectra from mzML files are specified by their scan number.""" + """Test that spectra from mzML files are specified by their scan id.""" mzml_small2 = tmp_path / "mzml_small2.mzml" shutil.copy(mzml_small, mzml_small2) @@ -872,15 +872,15 @@ def test_spectrum_id_mzml(mzml_small, tmp_path): tmp_path / "index.hdf5", [mzml_small, mzml_small2], overwrite=True ) dataset = SpectrumDataset(index) - for i, (filename, scan_nr) in enumerate( + for i, (filename, scan_id) in enumerate( [ - (mzml_small, 17), - (mzml_small, 111), - (mzml_small2, 17), - (mzml_small2, 111), + (mzml_small, "scan=17"), + (mzml_small, "merged=11 frame=12 scanStart=763 scanEnd=787"), + (mzml_small2, "scan=17"), + (mzml_small2, "merged=11 frame=12 scanStart=763 scanEnd=787"), ] ): - spectrum_id = str(filename), f"scan={scan_nr}" + spectrum_id = str(filename), scan_id assert dataset.get_spectrum_id(i) == spectrum_id