getzlab / rnaseqc

Fast, efficient RNA-Seq metrics for quality control and process optimization
Other
149 stars 19 forks source link

5'/3' bias edge case bugs #74

Closed kachulis closed 2 years ago

kachulis commented 2 years ago

A few bugs in calculation of 5'/3' bias, specifically for the edge case where only 1 gene is included in the calculation.

  1. In calculation of 25th and 75th percentiles, the index to read at is not checked against the size of the ratios vector. If the ratios vector is length 1, this leads to reading from past the end of the vector, giving undefined behavior. Also, the behaviors in both the if and else blocks are currently mathematically identical, I believe.

https://github.com/getzlab/rnaseqc/blob/19967f36fe51b4a497606a368e5b3b657b0339a8/src/RNASeQC.cpp#L500-L521

  1. In the code to compute medians, the edge case when size is 1 hits a similar bug.

https://github.com/getzlab/rnaseqc/blob/19967f36fe51b4a497606a368e5b3b657b0339a8/src/Metrics.h#L152-L156

agraubert commented 2 years ago

Thanks for pointing these out. Good catches!