smith-chem-wisc / MetaMorpheus

Proteomics search software with integrated calibration, PTM discovery, bottom-up, top-down and LFQ capabilities
MIT License
91 stars 46 forks source link

Array.BinarySearch Audit #2284

Open avcarr2 opened 1 year ago

avcarr2 commented 1 year ago

BinarySearch of double array does not check to see if closer value is left or right.

https://github.com/smith-chem-wisc/MetaMorpheus/blob/2729265b3467c82a2770acb34ff283ad6194d0ac/MetaMorpheus/EngineLayer/ClassicSearch/ClassicSearchEngine.cs#L245-L254

avcarr2 commented 1 year ago

All binary searches are handled incorrectly in MiniClassicSearchEngine.cs.

avcarr2 commented 1 year ago

I'm not sure if this one is correct or not: https://github.com/smith-chem-wisc/MetaMorpheus/blob/2729265b3467c82a2770acb34ff283ad6194d0ac/MetaMorpheus/EngineLayer/PrecursorSearchModes/IntervalMassDiffAcceptor.cs#L19-L32C23