@@ -65,20 +65,26 @@ def test_isolation_width(raw_file):
6565 assert reaction .isolation_width_offset == pytest .approx (0.0 ), f"Scan { scan_num } Reaction isolation width offset mismatch"
6666
6767
68- @pytest .fixture (scope = "session" )
69- def angiotensin_raw_file ():
70- path = os .path .join ("test_data" , "Angiotensin_AllScans.raw" )
71- if not os .path .exists (path ):
72- pytest .skip (f"Test file { path } not found" )
73- raw = RawFile (path )
74- yield raw
75- raw .close ()
76-
7768def test_isolation_width_angiotensin (angiotensin_raw_file ):
78- scan_event = angiotensin_raw_file .get_scan_event_for_scan_number (3 )
79- actual_width = scan_event .get_isolation_width (0 )
80- assert actual_width == pytest .approx (2.0 ), "Scan 3 ScanEvent isolation width mismatch"
81-
82- reaction = scan_event .get_reaction (0 )
83- assert reaction .isolation_width == pytest .approx (2.0 ), "Scan 3 Reaction isolation width mismatch"
84- assert reaction .isolation_width_offset == pytest .approx (0.0 ), "Scan 3 Reaction isolation width offset mismatch"
69+ # Check values on scan 3 (IW 2.0, CE 30.0)
70+ scan_event_3 = angiotensin_raw_file .get_scan_event_for_scan_number (3 )
71+ assert scan_event_3 .get_isolation_width (0 ) == pytest .approx (2.0 ), "Scan 3 ScanEvent isolation width mismatch"
72+ reaction_3 = scan_event_3 .get_reaction (0 )
73+ assert reaction_3 .isolation_width == pytest .approx (2.0 ), "Scan 3 Reaction isolation width mismatch"
74+ assert reaction_3 .isolation_width_offset == pytest .approx (0.0 ), "Scan 3 Reaction isolation width offset mismatch"
75+ assert reaction_3 .collision_energy == pytest .approx (30.0 ), "Scan 3 CE mismatch"
76+ assert reaction_3 .precursor_mass == pytest .approx (432.9000244140625 )
77+
78+ # Check values on scan 10 (Different CE)
79+ scan_event_10 = angiotensin_raw_file .get_scan_event_for_scan_number (10 )
80+ reaction_10 = scan_event_10 .get_reaction (0 )
81+ assert reaction_10 .isolation_width == pytest .approx (2.0 )
82+ assert reaction_10 .collision_energy == pytest .approx (53.98562240600586 )
83+ assert reaction_10 .precursor_mass == pytest .approx (433.90216064453125 )
84+
85+ # Check values on scan 1000 (IW 1.6, Different CE)
86+ scan_event_1000 = angiotensin_raw_file .get_scan_event_for_scan_number (1000 )
87+ reaction_1000 = scan_event_1000 .get_reaction (0 )
88+ assert reaction_1000 .isolation_width == pytest .approx (1.600000023841858 )
89+ assert reaction_1000 .collision_energy == pytest .approx (121.46764373779297 )
90+ assert reaction_1000 .precursor_mass == pytest .approx (649.8494262695312 )
0 commit comments