samtools/samtools — pull request #164 by daviesrob (2014-02-28 14:47:17+00:00)
Title: Makes samtools view -r and -R read group filtering options both use settings.rghash

Changes the option handling so -r and -R both use settings.rghash instead
or the -r option being stored in a string that then has to be checked
separately. The code to add the hash entires is also moved into the
option handling loop, so it is possible to have more that one -r or -R
on the command line. The set of read groups output will be the union of
all the groups requested. As -r uses the hash, drop_rg now gets called
so unwanted groups are removed from the header. This fixes issue #152.

Alter process_aln so that read group filtering will only make it return if
the alignment has been filtered out (previously it would return from the
read group filter at this point in either case). This means other filters
still have a chance to run after the read group one, and fixes issue #153.