fall over if a bed file given as an option cannot be read
Fixed script for parsing BLAST output
Fixed a few bugs in blast2sam.pl script, added POD documentation
plot-bamstats: Fixes #183
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.

Remove infinite loop.

Remove the cool closure stuff :-()

Fix error.

Change to use the internally stored max index rather than the bound.

Add sparse array format (untested).

Remove unused variable.

Refactor to remove duplication of code responsibility.

Also checks that malloc returns successfully.

Initialise stupid.

Bug fix.

Change the return thing to kh_put.

Add an error message.

Don't add a new record if the value is 0.

This is meant to be sparse, but I suspect that 0 records are being added.

Store total for dense array.

Quick bugfix.

Make the sparse array say it has MAX items rather than TOTAL.

Most of these items will be 0.

Add 'sparse' mode for insert-size.

Fix option placement.

Change from void * to untagged union.

Not quite so horrible!

Remove nested functions (alas).

This is considerably more nasty, but sadly nested-functions is a gcc
extension. Instead, we declare some stupidly-named static functions in
another file.

Modified makefile to build new stats_isize files.

Reference uint64_t

Add a few explanatory comments.

Fixup rebase
Merge pull request #184 from wtsi-hgi/features/unbounded-is

Adds support for outputting stats over the full input size distribution.
Further stats tests

Add test to check how insert CIGAR op behaves.
Add test to check how -i 0 behaves.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Remove unusued 'total' functions.
Merge pull request #186 from wtsi-hgi/issues/warn-unusued-fn

Remove unusued 'total' functions.
Don't require an index for full-file merges

Use the new sam_itr_queryi(idx=NULL, ...) facilities when we don't need
an index and there might not be any (in particular, when merging temporary
files at the end of samtools sort).

Don't attempt to free the list of filenames when it is argv.
Merge branch 'origin/develop' into develop

Keeps the BAM output and -b versus Usage changes from
b44c5e479db8136ed10ebe6a9123a6d1457b7f33, but discards the
filelist freeing and index building changes in favour of
those in 3ad6995d09f4dd8646e4e68ef2982dde759382fb.

Fixes #180.
The @HD header is optional
Add "make testclean" target
Make stats.c's error() static like the others
Add print_error() and print_error_errno()

Also use them to report why BED files cannot be read.
Use return instead of exit(), as suggested by Martin.
Merge BED file option error checking (PR #77)
Move CDF_MWU_TESTS switch closer to what it controls

In particular, bam2bcf.c does not #include samtools.h, so previously
it would not have computed these annotations when requested.
Reinstate old-API functions needed by Bio-SamTools Perl module

bam_plbuf.o should be in libbam.a.  Reinstate several functions in
bam.h and remove residual bam_plp_set_mask() and bam_plbuf_set_mask()
declarations as htslib's underlying bam_plp_set_mask() disappeared in
samtools/htslib@cf12fbaa2e1958659c9c075d940eb16f698ccefd.

Reinstate sampileup(), which now does its own masking.  It still calls
bam_plbuf_push() for all reads, so that the resulting bam_plp_push()
has the opportunity to invoke overlap_remove() on masked-out reads.
Support for =X cigars in mpileup, exit on yet untreated cigars.
Free all memory in sparse_isize_free