samtools/samtools — pull request #184 by nc6 (2014-03-26 15:57:38+00:00)
Title: Adds support for outputting stats over the full input size distribution.

Current behaviour is to specify a parameter (-i) which governs the maximum
input size which will be considered. Any input size above this will be output
as the maximum input size. This can lead to peaks in the tail of the IS
distribution appearing incorrectly, as well as potentially breaking the calculation
of average input size.

This commit changes the current behaviour in the following ways:

- Previously, setting "-i 0" would either result in a crash or non-useful behaviour.
Instead, setting "-i 0" now removes the maximum input size. Rather than using the existing
array-backed storage, we switch to a hashmap which only stores non-0 entries (e.g. sizes x
for which there is at least one insert of size x).
- Introduce a new option "--sparse|-x" which sets the IS output into 'sparse' mode - IS
lines in this mode are only output where the total number of inserts is greater than 0.

This has been tested (on a random humgen test file) to produce identical to samtools/develop
when run with default settings (replicating default behaviour) and to agree on a bunch of randomly
selected insert sizes when using the new behaviour.