Missing peak in chrom.map_peaks() exits loop
Thanks for making this package - it's really well done!
I noticed that if a mapped peak is absent from the peak list, all subsequent mappings are ignored, even if they are present in the chromatogram. I traced the issue back to line 1060 of quant.py, where the loop breaks when an absent peak is identified. Changing from "break" to "continue" seems like a more intuitive outcome, where all present peaks are mapped and then a warning is raised for each absent peak. I don't really know how to use git so I thought I'd leave this here.
Hi @connor-pl-delaney, thanks for filing this issue! I will take a look at what's going on. In the mean time, could you please provide a minimal failing example? A sample chromatogram and a copy of a script where I could reproduce the failure will help me patch a fix.
Thanks for getting back to me! I don't have permission to share the data I am working with publically, so I will try to reproduce the issue with some synthetic data or my own chromatograms and get back to you soon.
Hi @connor-pl-delaney, hope you are doing well! Are you still interested in providing some synthetic data to test this? Alternatively, you could provide a raw chromatogram with obfuscated or absent metadata.
Thanks for the reminder. I have sanitized the data and written up a minimal example that reproduces the bug. I've attached the Jupyter notebook, test data, and a PDF printout of the outcome of the tests on my computer. The tests were run in a fresh conda environment with the latest install of hplc-py. I was able to resolve the issue by changing line 1070 of quant.py from "break" to "continue". Hope this helps!
Correction, I had it right the first time - the "break" occurs on line 1060
Great, thanks! I will take a look at this soon. If you'd like, feel free to open a PR with that change and I can check if the logic is correct and if the tests pass.
Hi @connor-pl-delaney, wanted to let you know I'm finally getting around to this (busy summer).