Merge pull request #95 from wtsi-hgi/develop

Fixed GCC section of stats so that read cycle column begins with 1 instead of 0.
mpileup: Allow up to five alleles (N,A,C,G,T)
Rearrange (so tags can see main_depth()) [minor]
Remove incorrect parameter check

The q parameter is an m*m matrix, and is allocated by the caller and
m & q are passed in accordingly.  It appears that this check may have been
intended to be "if (m > qmax)" but we have no independent idea of the size
of q, so there's no way to validate m against it.

Values in q are computed from aux.bsum[k]/etc where 0 <= k < m, so m is
also limited by the size of bsum[], namely 16.  However meaningful indices
for bsum/etc mostly are 0...4 (i.e., A,C,G,T,N) and in practice (currently)
m is either 4 or 5 (with q sized accordingly).  So checking "if (m > 16)"
would be somewhat pointless.
New "flags" command plus moved filtering from htslib/pileup to BAM reading callbacks
On behalf of Peter Chines, test that filter mask replaces (not just adds to) default mask
mpileup: Disabled CDF version of MWU annotations and made it optional at compile time
Merge branch 'develop' into calling
Merge branch 'calling' into develop
plot-bamstats: Skip generation of empty GCD graphs
Adds tests for usage message for samtools and all subcommands

Parses usage output into sections and looks for usage, version, and commands sections
using regexes.

Dispatches a further usage test for each subcommand reported by `samtools`

Verifies that subcommand usage lines mention `samtools subcommand` where subcommand
is the name of the subcommand (this test is not run if the regex 'not.*implemented'
is found anywhere in the subcommand output -- it seems reasonable enough that not
yet implemented subcommands would not have usage messages)

N.B. this currently fails on 4 subcommands - these need fixing and these
tests should tell us when they are fixed.
Modifies test.pl so that it exits with non-zero status if any tests fail.
Fail when tests fail

Exit statuses are really 8-bit unsigned integers, so exit with 0/1
rather than the number of failures in case we have lots of tests, and
return a less unusual status from the usage display: 1 rather than 255.

Merge branch bugfix/test-pl-no-exit-code-on-fail of github.com/wtsi-hgi/samtools
stats: Fix of mismmatch-per-cycle calculation in presence of hard-clipped reads
Usage message tweaks to satisfy test/test.pl's test_usage()

Idxstats is currently disabled, but re-enable its basic functionality
including usage.  The calmd/fillmd command is canonically calmd.
Fix bamshuf and faidx messages.  Tview has been disabled in bamtk.c
for a while; also suppress it in samtools --help command listing.
Moved khash_utils.h into htslib
Updated the khash_utils.h dependency
stats: realloc buffers in MPC calculation if necessary, unclipped length can be bigger seq_len
mpileup: Removed bcf_hdr_fmt_text() which is no longer necessary
Add properly paired to stats and correct definition in flagstat

stats: Properly paired flag counting has been added as a summary
number.

flagstat: ensure that read with properly paired flag set is
mapped as per SAM spec.