glasgowcompbio / vimms

A programmable and modular LC/MS simulator in Python
MIT License
19 stars 6 forks source link

Smart ROI Scoring Error #23

Closed vinnydavies closed 4 years ago

vinnydavies commented 4 years ago

I got the following error

\vimms\vimms\Controller\roi.py:298: RuntimeWarning: divide by zero encountered in log scores *= (np.log(self.current_roi_intensities) > np.log(self.min_ms1_intensity)) # intensity filter

joewandy commented 4 years ago

some of the ROI intensities are 0? weird

vinnydavies commented 4 years ago

happens right at the start, so could be to do with the empty scan again. Imagine its a quick fix, just havent got to it yet

sdrogers commented 4 years ago

I don't think it can be the roi intensities, because the line immediately before says: https://github.com/sdrogers/vimms/blob/a42e10cf297d0ef5e24977f8c7ad0416bec0d931/vimms/Controller/roi.py#L285-L286 So it would give the error if it was the np.log(self.current_roi_intensities) bit. Must be the second part: the self.min_ms1_intensity not being set?

vinnydavies commented 4 years ago

Issue came from setting self.min_ms1_intensity==0. Issue fixed by Simon by removing the logs from line 286 above and another instance