Tarskin / HappyTools

A tool for the (high-throughput) processing of HPLC data.
Apache License 2.0
34 stars 16 forks source link

Check against minimum number of calibrants #59

Open stainawarijar opened 1 year ago

stainawarijar commented 1 year ago

It appears that a check against the specified minimum number of calibrants has not been implemented. HappyTools still calibrates (or attempts to calibrate) chromatograms that contain less calibrants with a high enough S/N.

This was an issue when batch processing a large amount of samples that included blanks. Because the specified calibrants did not have a high enough S/N in the blanks, HappyTools attempted to determine a calibration function using an empty self.calibration_time_pairs list (HappyTools/bin/chromatogram.py). This caused the error

ValueError: not enough values to unpack (expected 2, got 0)

in the function determine_calibration_function when trying to zip above mentioned list self.calibration_time_pairs.

Tarskin commented 1 year ago

Good catch, i'll add a simple check for the length of the pairs.