add script to help generate regions of even coverage and run in parallel

If you are running freebayes on anything more than a very small dataset, it's
best to run it on multiple regions in parallel, such as using GNU parallel.

When running in parallel, it can be important to generate targets that have
roughly equal amounts of data in them.  This reduces the variance of runtime in
the jobs and thus improves the overall performance of the process.

Now included is a script which will help do this, provided the coverage output
of bamtools.  You can use it like this:

    % bamtools coverage -in sample001.sorted.bam \
      | scripts/coverage_to_regions.py chr20_bit.fa.fai 10
    chr20_bit:0-10092
    chr20_bit:10092-19390
    chr20_bit:19390-29472
    chr20_bit:29472-40012
    chr20_bit:40012-50035
    chr20_bit:50035-59548
    chr20_bit:59548-69820
    chr20_bit:69820-79811
    chr20_bit:79811-89480
    chr20_bit:89480-100001

Here we generate 10 regions in which there is approximately equal coverage.
For larger datasets, it should be sufficient to feed in a few samples or a
downsampled BAM in order to generate the target list.

To use these, one could apply GNU parallel to run freebayes on all the chunks.

    cat regions | parallel -j 24 'freebayes -f ref.fa -r {} input.bam | gzip >outputdir/{}.vcf.gz'

And then merge the chunks afterwards:

    ( zcat outputdir/$(head -1 regions).vcf.gz | grep "^#"   # generate header
      cat regions | parallel -k -j 24 'zcat outputdir/{}.vcf.gz | grep -v "^#"' ) \
      | vcfstreamsort | vcfuniq | bgzip >merged_results.vcf.gz
    tabix -p vcf merged_results.vcf.gz
when we have input variants but no coverage, ensure output of record
Merge branch 'master' of github.com:ekg/freebayes
added examples to --help manual text
freebayes-parallel

This script depends on GNU parallel, but allows for freebayes to be run with
near-100% efficiency in an arbitrary number of threads.  Two positional
arguments are required, $regions and $ncpus; the rest of the command line can
be exactly identical to what is typically used in freebayes with the exception
of the output parameter -v (VCF), which cannot be used.

Parallelization requires a list of regions, which can be generated inline in
one command as shown in the help text of the executable (using
fasta_generate_regions.py), or can be generated from an arbitrary BAM file
using coverage_to_regions.py, which is also in the scripts directory.  The
second option may provide lower variance in sub-job runtime and thus better
throughput at the cost of having to traverse an entire alignment file to
generate the regions.
Merge branch 'master' of github.com:ekg/freebayes