if (CREATE_INDEX)
builder.setOption(Options.INDEX_ON_THE_FLY);
final VariantContextWriter vcfWriter = builder.setOutputFile(OUTPUT).build();
fileHeader.setSequenceDictionary(samSequenceDictionary);
vcfWriter.writeHeader(fileHeader);
final ProgressLogger progress = new ProgressLogger(log, 10000);
final CloseableIterator<VariantContext> iterator = fileReader.iterator();
while (iterator.hasNext()) {
final VariantContext context = iterator.next();