Add Beacon's AlleleCount

This is a piece of code that I wrote some time ago while I was working on the AMPLab beacon. It generates text files with frequencies of the alleles observed in an ADAM converted vcf file.
Can you add a header line to the start of this sequence?