The ##contig header lines disappear when loading/writing a VCF file. To reproduce:
r = vcf.Reader (open ('PyVCF/vcf/test/gatk.vcf', 'r'))
w = vcf.Writer (open ('out.vcf', 'w'), r)
Note that out.vcf has no ##contig lines, but they were present in PyVCF/vcf/test/gatk.vcf
This actually happens with the sample filter script, too:
python2.7 scripts/vcf_filter.py vcf/test/gatk.vcf sq > ~/tmp/out.vcf
diff vcf/test/gatk.vcf ~/tmp/out.vcf | less
Notice that all the ##contig header lines are in the old file, but not the new file.
This is odd... contigs are stored in the Reader obj, but aren't written out? Everything else in the header is written out more-or-less verbatim.
This is another regression introduced by #105. I'll add a test case and fix it.
If fixed the regression in #119.
Note however that only the ID and length are considered by the Reader and as such any additional information (e.g. assembly=hg19) will be lost. Please open a separate issue for that if it is a problem for you.
Thanks for your report!