cremerlab / hplc-py

A Python utility for the processing and quantification of chromatography data
https://cremerlab.github.io/hplc-py/
GNU General Public License v3.0
19 stars 4 forks source link

Help with peak fitting parameters #9

Closed liquidcarbon closed 6 months ago

liquidcarbon commented 6 months ago

Hello, I'm having some difficulty understanding the hplc-py peak fitting parameters and tuning them appropriately. It could be helpful to offer more examples of how changing them affects the results.

What parameters would you suggest to integrate this chromatogram? Default: image

Using approx_peak_width=0.25 (uncommented the line in the above codeblock): image

Neither of the two examples seems to be visually valid, and I'm not finding a combination of parameters that would make sense.

For reference, this is what Chemstation returns: image

gchure commented 6 months ago

Thanks for posting. The parameters you're adjusting (approximate_peak_width and prominence) are important for inferring and fitting the background. As the peaks in the raw chromatogram appear to have significantly overlapping tails, your entire chromatogram is probably being clipped into a single window, and fitting that many peaks with broad parameters can be tough.

You can try directly adjusting the peak fitting parameters to more tightly constrain the fitting of the first peak.

You may also want to toy around with different approximate peak widths (as I think you have already) to get a good measure of the background. Given your first example, the raw chromatogram looks like it has a pretty stable baseline and there are many peaks close together. I think it's probably not the case that the background is substantial.

You can try enforcing peak positions at time points ≈ 10.5, 10.75, 11.5, 12.5, 13.25, and 14.25.

Let me know how it goes. If none of this seems to help, pass long a CSV with the raw chromatogram and I can poke around at it too.

gchure commented 6 months ago

Hey @liquidcarbon , I'm going to close this issue for now. Feel free to open it back up if you need more advice.