hplc-py icon indicating copy to clipboard operation
hplc-py copied to clipboard

Parameter bounding logical error after baseline correction

Open ccourpalais opened this issue 1 year ago • 3 comments

Returning, "Each lower bound must be strictly less than each upper bound."

ccourpalais avatar Nov 07 '24 18:11 ccourpalais

Hi @ccourpalais, Thanks for the issue. To address this, please provide much more context on what is yielding the error. You can attach a copy of the chromatogram you're trying to fit here, along with your code that is failing. Additionally, please tell us what version of hplc-py you are running, as version 0.2.7 fixed a bug that would sometimes yield this.

gchure avatar Nov 07 '24 19:11 gchure

H5-2.csv

This is the csv file I am using. I have changed the column names from R.Time (min), Intensity to time, signal, but am met with errors in both cases.

HPLC-py_H5-2_1sttrial.pdf

This is a pdf of the code.

I am using version 0.2.7

ccourpalais avatar Nov 07 '24 21:11 ccourpalais

Hi, thanks for the quick response. I've changed the title of the issue to be more informative to the error.

I was able to reproduce your error, though I will need to dig a bit to understand exactly what aspect of your chromatogram is making this come up. I have found that disabling background correction (fit_peaks(correct_baseline=False)) yields a good reconstruction of the chromatogram:

Screenshot 2024-11-07 at 21 41 39

I also found that doing background subtraction on the peak between 2 and 6 min while giving a guess for two peaks also succeeds:

Screenshot 2024-11-07 at 21 43 07

I suspect that the background correction is leading to a peak being detected at the edge of the chromatogram, leading to a logical error in setting the peak parameter bounds. I will take a look at this when I can, but you should be able to crop your chromatograms a bit to get it to work.

Hope this helps, and please let me know if you have any other issues.

gchure avatar Nov 08 '24 05:11 gchure