Are there any programming language APIs available yet for working with VCF files? The only tool I know of is vcf tools which as far as I know only has a command line interface and no application interface.
What I am looking for is the vcf equivalent of Picards, Samtools or Bamtools. A library that you can use from your own code to parse trough VCF files.
Preferentially a object oriented library in Java, but anything in Python or Perl will also do.
Nice GATK ofcourse has a VCF reader and writer in their source. I will have a look at this.
I copied your code and it seems to work. But I get an exception when closing the vcf writer. Did you run into this? Exception in thread "main" java.lang.NullPointerException at org.broadinstitute.sting.gatk.refdata.tracks.IndexDictionaryUtils.setIndexSequenceDictionary(IndexDictionaryUtils.java:85) at org.broadinstitute.sting.utils.variantcontext.writer.IndexingVariantContextWriter.close(IndexingVariantContextWriter.java:100) at org.broadinstitute.sting.utils.variantcontext.writer.VCFWriter.close(VCFWriter.java:147)
I am using the latest GATK lite jar file as a library.
strange. I cannot help you with this only stacktrace.
Well the writer seems to write all the output before crashing on closing so I'll just look into it later.