eugenemel/maven

Update peakdetector to support isotopic extraction - and fix related bugs

Closed this issue · 5 comments

Specifically, just need to add

group.pullIsotopes(isotopeParameters,
                   samples,
                   false //debug
                   );

and corresponding parameters to enable this (e.g., --extractIsotopes) and encoded isotopeParameters string. (--isotopeParameters)

In the main groups block. This can then fit nicely in a single R script pipeline for diff iso rescoring, e.g. via mzkitcpp.

There is no need to implement diff iso scoring, since this will just be rescored anyway via mzkitcpp and metisotopes.

Potentially implemented as of acc0a24, needs testing per https://github.com/calico/mass_spec/issues/1489

In order for this to work properly, need to read in ADDUCTS.csv, and associate the appropriate adduct with peak groups - otherwise, the isotopic extraction code will fall back to assuming the compound is unknown, and pull out slightly different isotopes (unknown compounds use the observed m/z directly, and compute mass shifts from there, while known compounds use the theoretical m/z from formula + adduct).

The resulting information should also be properly saved in the mzrollDB files:

from GUI:
gui_XMP_example

from peakdetector:
peakdetector_XMP_example

The search parameters in the GUI should always use the parameters specified in the dialog - not the global parameters.
the isotope parameters has a peakPickingAndGroupingParameters field, which is currently pulling from the main window - instead, should be from the dialog!

Another little bug in the GUI - the adduct should not be associated with unknown isotopes

Screenshot 2024-10-16 at 1 58 11 PM

Upon further investigation, there appears to be a bug in the isotope extraction code - it appears to be giving different results between two identical runs generated in the GUI, as well as two identical runs generated via peakdetector.