Closed sdrogers closed 3 years ago
We should also be careful: maybe one file just has a lower intensity than the other? Overcoming this might mean that we need to compute relative intensity at fragmentation (i.e. intensitity / max in that file) - more difficult, but do-able.
Re. point (5), we could also pick the precursor from the nearest ms1 scan. Or maybe try all 3 above.
Done, it's now part of the manuscript
Want to be able to find the intensity at which a particular signal was fragmented. We currently use this code to map picked peak boxes to ms2 scans: https://github.com/sdrogers/mass-spec-utils/blob/6dc3698876a98d0d66038c5096d37722c4959f06/mass_spec_utils/data_import/mzmine.py#L74-L98 This provides a pair of dictionaries: one for mapping boxes to scans, and one scans to boxes.
The scans come from a
MZMLFile
object, in which ms2 scans also store a reference to their previous and next ms1: https://github.com/sdrogers/mass-spec-utils/blob/6dc3698876a98d0d66038c5096d37722c4959f06/mass_spec_utils/data_import/mzml.py#L115-L181The
MZMLScan
objects have a handy method for extracting the mz and intensity of a particular mz value in a scan: https://github.com/sdrogers/mass-spec-utils/blob/6dc3698876a98d0d66038c5096d37722c4959f06/mass_spec_utils/data_import/mzml.py#L66-L76So, we need to:
ms2_scan.previous_ms1.get_precursor(ms2_scan.precursor_mz)
and store these for comparison between the methods.