From 23c3057d611ffcfbca2d49467103859ee053e7f7 Mon Sep 17 00:00:00 2001
From: Sander Bollen <a.h.b.bollen@lumc.nl>
Date: Wed, 8 Apr 2015 16:41:47 +0200
Subject: [PATCH] give reference dictionary to writer

---
 .../scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
index 32cf5d42e..d765ab7a8 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
@@ -141,10 +141,16 @@ object VcfFilter extends ToolCommand {
 
     val reader = new VCFFileReader(commandArgs.inputVcf, false)
     val header = reader.getFileHeader
-    val writer = new AsyncVariantContextWriter(new VariantContextWriterBuilder().setOutputFile(commandArgs.outputVcf).build)
+    val writer = new AsyncVariantContextWriter(new VariantContextWriterBuilder().
+      setOutputFile(commandArgs.outputVcf).
+      setReferenceDictionary(header.getSequenceDictionary).
+      build)
     writer.writeHeader(header)
 
-    val invertedWriter = commandArgs.invertedOutputVcf.collect { case x => new VariantContextWriterBuilder().setOutputFile(x).build }
+    val invertedWriter = commandArgs.invertedOutputVcf.collect { case x => new VariantContextWriterBuilder().
+      setOutputFile(x).
+      setReferenceDictionary(header.getSequenceDictionary).
+      build }
     invertedWriter.foreach(_.writeHeader(header))
 
     var counterTotal = 0
-- 
GitLab