Ecogenomics / BamM

Metagenomics-focused BAM file manipulation
http://ecogenomics.github.io/BamM/
GNU Lesser General Public License v3.0
16 stars 7 forks source link

BM_median incorrectly calculates the median value for even sized arrays #7

Closed donovan-h-parks closed 9 years ago

donovan-h-parks commented 9 years ago

If there is an even number of observations, then there is no single middle value; the median is then usually defined to be the mean of the two middle values.

Note, that this will likely be a floating point value so the return type of BM_median should be changed.

donovan-h-parks commented 9 years ago

BM_median now returns the mean between the two middle values for even sized arrays.