Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter bounding logical error after baseline correction #22

Open
ccourpalais opened this issue Nov 7, 2024 · 3 comments
Open

Parameter bounding logical error after baseline correction #22

ccourpalais opened this issue Nov 7, 2024 · 3 comments

Comments

@ccourpalais
Copy link

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

@gchure
Copy link
Member

gchure commented Nov 7, 2024

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.

@ccourpalais
Copy link
Author

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

@gchure gchure changed the title fit_peaks() function not working. Parameter bounding logical error after baseline correction Nov 8, 2024
@gchure
Copy link
Member

gchure commented Nov 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants