Fixed script for parsing BLAST output
Fixed a few bugs in blast2sam.pl script, added POD documentation
Create header of common test functions

Create a header to be included in tests for common functions.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Add split command to samtools

The split command takes BAMs which consist of multiple readgroups
and separates them out into separate files, one for each readgroup.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Add unit test for bam_split.c's count_rg

Add unit test to test count_rg function.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Polish bam_split

Unit test expand_format_string
Change from output_prefix to output format string
Make usage write to stdout when not an error.
Make stdout usage appear if no arguments given.
Make unaccounted reads an option and whine if found and not specified.
Filter alternate @RG lines from the files they’re not in.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Add unit test for bam_split.c's filter_header_rg

Add unit test to test filter_header_rg function.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Restructure testing structure to dedupe

Move certain functions from test.h into a test.c file to reduce code
duplication.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Add unit test for bam_split.c's parse_args

Add unit test to test parse_args function.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Add -b parameter to samtools merge manpage
Update samtools.1
Match style for FILE option
Alternate syntax for samtools merge.

Providing a FILE to the -b option for samtools merge overrides any file selection made at the command line, I have added an alternative syntax line in the documentation to try and clarify this.
Alternate syntax for samtools merge in stderr message
Clarify list is not a literal
Match samtools merge manpage and stderr syntax
Fix dependencies for test/test.h

Three of the test/merge/*.c tests do not yet use test.c's functions,
so needn't link to it.
Write files based on the *basename* of the input file

Strip the directory part (tools that write to the current directory
by default are more convenient) and extension from the input filename
before using it in the output filename template.

We don't seem to need _GNU_SOURCE.  Also minor spelling fixups.
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.