Skip to content

Commit

Permalink
Merge pull request #1528 from broadinstitute/rhl_validate_vcf.gz
Browse files Browse the repository at this point in the history
Output filenames with the vcf.gz extension are gzipped, those containing the string ".bcf" result in VCF
  • Loading branch information
ronlevine committed Dec 6, 2016
2 parents ad67e36 + 15757b4 commit fbfda33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -149,7 +149,8 @@ private VariantContextWriter vcfWriterToFile(final VariantContextWriterStub stub
// if the stub says to test BCF, create a secondary writer to BCF and an 2 way out writer to send to both
// TODO -- remove me when argument generateShadowBCF is removed
if ( stub.alsoWriteBCFForTest() &&
! (options.contains(Options.FORCE_BCF) || file != null && file.getName().contains(".bcf")) ) {
! ( options.contains(Options.FORCE_BCF) ||
file != null && (file.getName().endsWith(".bcf") || file.getName().endsWith(".bcf.gz")) ) ) {
final File bcfFile = BCF2Utils.shadowBCF(file);
if ( bcfFile != null ) {
final VariantContextWriter bcfWriter = new VariantContextWriterBuilder()
Expand Down
Expand Up @@ -216,7 +216,8 @@ public EnumSet<Options> getWriterOptions(boolean indexOnTheFly) {
if ( writeFullFormatField ) options.add(Options.WRITE_FULL_FORMAT_FIELD);

final File file = getOutputFile();
if ( forceBCF || (file != null && options.contains(Options.FORCE_BCF) || file != null && file.getName().contains(".bcf")) )
if ( forceBCF || (file != null && options.contains(Options.FORCE_BCF) ||
file != null && (file.getName().endsWith(".bcf") || file.getName().endsWith(".bcf.gz"))) )
options.add(Options.FORCE_BCF);

return options.isEmpty() ? EnumSet.noneOf(Options.class) : EnumSet.copyOf(options);
Expand Down

0 comments on commit fbfda33

Please sign in to comment.