From 5632c13bf247826920018fb9c881470504567d4e Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Wed, 12 Dec 2012 10:27:07 -0500 Subject: [PATCH] Resolves GSA-681 / Compressed VCF.gz output is too big because of unnecessary call to flush(). -- Now compressed output VCFs are properly blocked compressed (i.e., they are actually smaller than the uncompressed VCF) --- .../walkers/genotyper/UnifiedGenotyperIntegrationTest.java | 2 +- .../sting/utils/variantcontext/writer/VCFWriter.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java index f2b2dfb7d..c768f95ad 100755 --- a/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java +++ b/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java @@ -96,7 +96,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { // // -------------------------------------------------------------------------------------------------------------- - private final static String COMPRESSED_OUTPUT_MD5 = "5b8f477c287770b5769b05591e35bc2d"; + private final static String COMPRESSED_OUTPUT_MD5 = "3eba6c309514d1e9ee06a20a112b68e6"; @Test public void testCompressedOutput() { diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/VCFWriter.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/VCFWriter.java index 9a987f161..974e50ced 100755 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/VCFWriter.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/VCFWriter.java @@ -248,7 +248,8 @@ class VCFWriter extends IndexingVariantContextWriter { } mWriter.write("\n"); - mWriter.flush(); // necessary so that writing to an output stream will work + // note that we cannot call flush here if we want block gzipping to work properly + // calling flush results in all gzipped blocks for each variant } catch (IOException e) { throw new RuntimeException("Unable to write the VCF object to " + getStreamName(), e); }