From 567dba0f761b5172dfd23a698d28551e3dae231c Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Wed, 20 Jun 2012 15:35:36 -0400 Subject: [PATCH] Cleanup of VCF header lines and constants, BCF2 bugfixes -- Created public static UnifiedGenotyper.getHeaderInfo that loads UG standard header lines, and use this in tools like PoolCaller -- Created VCFStandardHeaderLines class that keeps standard header lines in the GATK in a single place. Provides convenient methods to add these to a header, as well as functionality to repair standard lines in incoming VCF headers -- VCF parsers now automatically repair standard VCF header lines when reading the header -- Updating integration tests to reflect header changes -- Created private and public testdata directories (public/testdata and private/testdata). Updated tests to use test -- SelectHeaders now always updates the header to include the contig lines -- SelectVariants add UG header lines when in regenotype mode -- Renamed PHRED_GENOTYPE_LIKELIHOODS_KEY to GENOTYPE_PL_KEY -- Bugfix in BCF2 to handle lists of null elements (can happen in genotype field values from VCFs) -- Throw error when VCF has unbounded non-flag values that don't have = value bindings -- By default we no longer allow writing of BCF2 files without contig lines in the header --- .../walkers/annotator/ChromosomeCounts.java | 7 +- .../walkers/annotator/DepthOfCoverage.java | 6 +- .../annotator/DepthPerAlleleBySample.java | 12 +- .../walkers/annotator/MappingQualityZero.java | 6 +- .../gatk/walkers/annotator/QualByDepth.java | 4 +- .../walkers/annotator/RMSMappingQuality.java | 6 +- .../annotator/VariantAnnotatorEngine.java | 12 +- .../diagnostics/targets/ThresHolder.java | 6 +- .../walkers/genotyper/UnifiedGenotyper.java | 44 ++- .../indels/SomaticIndelDetectorWalker.java | 2 +- .../ApplyRecalibration.java | 9 +- .../VariantRecalibrator.java | 7 +- .../walkers/variantutils/SelectHeaders.java | 7 +- .../walkers/variantutils/SelectVariants.java | 7 +- .../VariantValidationAssessor.java | 4 +- .../walkers/variantutils/VariantsToVCF.java | 4 +- .../bcf2/BCF2GenotypeFieldDecoders.java | 2 +- .../sting/utils/codecs/bcf2/BCF2Utils.java | 6 +- .../utils/codecs/vcf/AbstractVCFCodec.java | 9 +- .../sting/utils/codecs/vcf/VCFCodec.java | 3 +- .../sting/utils/codecs/vcf/VCFConstants.java | 15 +- .../sting/utils/codecs/vcf/VCFHeader.java | 6 +- .../codecs/vcf/VCFStandardHeaderLines.java | 264 ++++++++++++++++++ .../sting/utils/codecs/vcf/VCFUtils.java | 10 +- .../sting/utils/variantcontext/Genotype.java | 8 +- .../utils/variantcontext/SlowGenotype.java | 6 +- .../utils/variantcontext/VariantContext.java | 2 +- .../writer/BCF2FieldEncoder.java | 17 +- .../writer/BCF2FieldWriter.java | 2 +- .../variantcontext/writer/BCF2Writer.java | 9 +- .../writer/IntGenotypeFieldAccessors.java | 2 +- .../variantcontext/writer/VCFWriter.java | 2 +- .../FastaSequenceIndexBuilderUnitTest.java | 8 +- .../org/broadinstitute/sting/BaseTest.java | 11 +- .../org/broadinstitute/sting/WalkerTest.java | 2 +- .../commandline/ParsingEngineUnitTest.java | 4 +- .../ReferenceOrderedViewUnitTest.java | 4 +- .../reads/GATKBAMIndexUnitTest.java | 4 +- .../rmd/ReferenceOrderedDataPoolUnitTest.java | 4 +- ...ReferenceOrderedQueryDataPoolUnitTest.java | 2 +- .../ReadGroupBlackListFilterUnitTest.java | 5 +- .../tracks/FeatureManagerUnitTest.java | 10 +- .../FeatureToGATKFeatureIteratorUnitTest.java | 2 +- .../sting/gatk/report/GATKReportUnitTest.java | 2 +- .../sting/gatk/samples/SampleDBUnitTest.java | 2 +- .../CNV/SymbolicAllelesIntegrationTest.java | 2 +- .../ClipReadsWalkersIntegrationTest.java | 8 +- .../walkers/PrintReadsIntegrationTest.java | 2 +- .../VariantAnnotatorIntegrationTest.java | 50 ++-- .../walkers/beagle/BeagleIntegrationTest.java | 2 +- .../DiffObjectsIntegrationTest.java | 8 +- .../diffengine/DiffableReaderUnitTest.java | 8 +- .../VariantFiltrationIntegrationTest.java | 22 +- .../UnifiedGenotyperIntegrationTest.java | 79 +++--- ...RealignerTargetCreatorIntegrationTest.java | 2 +- .../PhaseByTransmissionIntegrationTest.java | 2 +- .../ReadBackedPhasingIntegrationTest.java | 2 +- .../RecalibrationWalkersIntegrationTest.java | 2 +- .../ValidationAmpliconsIntegrationTest.java | 16 +- .../VariantEvalIntegrationTest.java | 10 +- .../VariantGaussianMixtureModelUnitTest.java | 6 +- ...ntRecalibrationWalkersIntegrationTest.java | 7 +- .../CombineVariantsIntegrationTest.java | 49 ++-- .../LeftAlignVariantsIntegrationTest.java | 2 +- .../LiftoverVariantsIntegrationTest.java | 8 +- .../SelectVariantsIntegrationTest.java | 26 +- .../VCFStreamingIntegrationTest.java | 4 +- .../ValidateVariantsIntegrationTest.java | 2 +- .../VariantsToTableIntegrationTest.java | 14 +- .../VariantsToVCFIntegrationTest.java | 12 +- .../utils/codecs/vcf/VCFIntegrationTest.java | 19 +- .../vcf/VCFStandardHeaderLinesUnitTest.java | 148 ++++++++++ .../utils/crypt/GATKKeyIntegrationTest.java | 4 +- ...chingIndexedFastaSequenceFileUnitTest.java | 4 +- .../interval/IntervalIntegrationTest.java | 2 +- .../utils/interval/IntervalUtilsUnitTest.java | 8 +- .../VariantContextTestProvider.java | 4 +- .../pipeline/DataProcessingPipelineTest.scala | 12 +- .../PacbioProcessingPipelineTest.scala | 6 +- .../examples/DevNullOutputPipelineTest.scala | 4 +- .../ExampleCountLociPipelineTest.scala | 4 +- .../ExampleCountReadsPipelineTest.scala | 4 +- .../ExampleReadFilterPipelineTest.scala | 4 +- .../ExampleUnifiedGenotyperPipelineTest.scala | 4 +- 84 files changed, 802 insertions(+), 336 deletions(-) create mode 100644 public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLines.java create mode 100644 public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLinesUnitTest.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java index 3127f20ac..3d07e3a7a 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java @@ -55,9 +55,10 @@ import java.util.*; public class ChromosomeCounts extends InfoFieldAnnotation implements StandardAnnotation, ActiveRegionBasedAnnotation { public static final String[] keyNames = { VCFConstants.ALLELE_NUMBER_KEY, VCFConstants.ALLELE_COUNT_KEY, VCFConstants.ALLELE_FREQUENCY_KEY }; - public static final VCFInfoHeaderLine[] descriptions = { new VCFInfoHeaderLine(VCFConstants.ALLELE_FREQUENCY_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Allele Frequency, for each ALT allele, in the same order as listed"), - new VCFInfoHeaderLine(VCFConstants.ALLELE_COUNT_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Allele count in genotypes, for each ALT allele, in the same order as listed"), - new VCFInfoHeaderLine(VCFConstants.ALLELE_NUMBER_KEY, 1, VCFHeaderLineType.Integer, "Total number of alleles in called genotypes") }; + public static final VCFInfoHeaderLine[] descriptions = { + VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_FREQUENCY_KEY), + VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_COUNT_KEY), + VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_NUMBER_KEY) }; private Set founderIds = new HashSet(); diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java index a982f2cf9..b36de0dac 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java @@ -8,8 +8,8 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompa import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; -import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine; +import org.broadinstitute.sting.utils.codecs.vcf.VCFStandardHeaderLines; import org.broadinstitute.sting.utils.sam.GATKSAMRecord; import org.broadinstitute.sting.utils.variantcontext.Allele; import org.broadinstitute.sting.utils.variantcontext.VariantContext; @@ -68,5 +68,7 @@ public class DepthOfCoverage extends InfoFieldAnnotation implements StandardAnno public List getKeyNames() { return Arrays.asList(VCFConstants.DEPTH_KEY); } - public List getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(getKeyNames().get(0), 1, VCFHeaderLineType.Integer, "Approximate read depth; some reads may have been filtered")); } + public List getDescriptions() { + return Arrays.asList(VCFStandardHeaderLines.getInfoLine(getKeyNames().get(0))); + } } diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java index 7e766bd04..d56daadea 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java @@ -6,10 +6,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; -import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; -import org.broadinstitute.sting.utils.codecs.vcf.VCFFormatHeaderLine; -import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineCount; -import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; +import org.broadinstitute.sting.utils.codecs.vcf.*; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.variantcontext.Allele; @@ -136,11 +133,6 @@ public class DepthPerAlleleBySample extends GenotypeAnnotation implements Standa public List getKeyNames() { return Arrays.asList(VCFConstants.GENOTYPE_ALLELE_DEPTHS); } public List getDescriptions() { - return Arrays.asList( - new VCFFormatHeaderLine( - getKeyNames().get(0), - VCFHeaderLineCount.UNBOUNDED, - VCFHeaderLineType.Integer, - "Allelic depths for the ref and alt alleles in the order listed")); + return Arrays.asList(VCFStandardHeaderLines.getFormatLine(getKeyNames().get(0))); } } \ No newline at end of file diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java index 0b8c0ca18..780206f30 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java @@ -7,8 +7,8 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompa import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; -import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine; +import org.broadinstitute.sting.utils.codecs.vcf.VCFStandardHeaderLines; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.variantcontext.VariantContext; @@ -44,5 +44,7 @@ public class MappingQualityZero extends InfoFieldAnnotation implements StandardA public List getKeyNames() { return Arrays.asList(VCFConstants.MAPPING_QUALITY_ZERO_KEY); } - public List getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(getKeyNames().get(0), 1, VCFHeaderLineType.Integer, "Total Mapping Quality Zero Reads")); } + public List getDescriptions() { + return Arrays.asList(VCFStandardHeaderLines.getInfoLine(getKeyNames().get(0))); + } } \ No newline at end of file diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java index d39ea9b8f..5da6492a6 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java @@ -63,7 +63,9 @@ public class QualByDepth extends InfoFieldAnnotation implements StandardAnnotati public List getKeyNames() { return Arrays.asList("QD"); } - public List getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(getKeyNames().get(0), 1, VCFHeaderLineType.Float, "Variant Confidence/Quality by Depth")); } + public List getDescriptions() { + return Arrays.asList(new VCFInfoHeaderLine(getKeyNames().get(0), 1, VCFHeaderLineType.Float, "Variant Confidence/Quality by Depth")); + } public Map annotate(Map>> stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java index 5e4c37965..fb5767b34 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java @@ -10,8 +10,8 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnota import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.QualityUtils; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; -import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine; +import org.broadinstitute.sting.utils.codecs.vcf.VCFStandardHeaderLines; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.sam.GATKSAMRecord; @@ -85,5 +85,7 @@ public class RMSMappingQuality extends InfoFieldAnnotation implements StandardAn public List getKeyNames() { return Arrays.asList(VCFConstants.RMS_MAPPING_QUALITY_KEY); } - public List getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(getKeyNames().get(0), 1, VCFHeaderLineType.Float, "RMS Mapping Quality")); } + public List getDescriptions() { + return Arrays.asList(VCFStandardHeaderLines.getInfoLine(getKeyNames().get(0))); + } } \ No newline at end of file diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java index b3d9a881c..46212c19c 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java @@ -41,8 +41,8 @@ import java.util.*; public class VariantAnnotatorEngine { - private List requestedInfoAnnotations; - private List requestedGenotypeAnnotations; + private List requestedInfoAnnotations = Collections.emptyList(); + private List requestedGenotypeAnnotations = Collections.emptyList(); private List requestedExpressions = new ArrayList(); private final HashMap, String> dbAnnotations = new HashMap, String>(); @@ -164,8 +164,12 @@ public class VariantAnnotatorEngine { descriptions.addAll(annotation.getDescriptions()); for ( GenotypeAnnotation annotation : requestedGenotypeAnnotations ) descriptions.addAll(annotation.getDescriptions()); - for ( String db : dbAnnotations.values() ) - descriptions.add(new VCFInfoHeaderLine(db, 0, VCFHeaderLineType.Flag, (db.equals(VCFConstants.DBSNP_KEY) ? "dbSNP" : db) + " Membership")); + for ( String db : dbAnnotations.values() ) { + if ( VCFStandardHeaderLines.getInfoLine(db, false) != null ) + descriptions.add(VCFStandardHeaderLines.getInfoLine(db)); + else + descriptions.add(new VCFInfoHeaderLine(db, 0, VCFHeaderLineType.Flag, db + " Membership")); + } return descriptions; } diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java index ae4296449..234906944 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java @@ -128,13 +128,13 @@ class ThresHolder { Set headerLines = new HashSet(); // INFO fields for overall data - headerLines.add(new VCFInfoHeaderLine(VCFConstants.END_KEY, 1, VCFHeaderLineType.Integer, "Stop position of the interval")); - headerLines.add(new VCFInfoHeaderLine(VCFConstants.DEPTH_KEY, 1, VCFHeaderLineType.Float, "Average depth across the interval. Sum of the depth in a loci divided by interval size.")); + headerLines.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.END_KEY)); + headerLines.add(new VCFInfoHeaderLine("AVG_INTERVAL_DP", 1, VCFHeaderLineType.Float, "Average depth across the interval. Sum of the depth in a loci divided by interval size.")); headerLines.add(new VCFInfoHeaderLine("Diagnose Targets", 0, VCFHeaderLineType.Flag, "DiagnoseTargets mode")); // FORMAT fields for each genotype // todo -- find the appropriate VCF constants - headerLines.add(new VCFFormatHeaderLine(VCFConstants.DEPTH_KEY, 1, VCFHeaderLineType.Float, "Average depth across the interval. Sum of the depth in a loci divided by interval size.")); + headerLines.add(new VCFFormatHeaderLine("AVG_INTERVAL_DP", 1, VCFHeaderLineType.Float, "Average depth across the interval. Sum of the depth in a loci divided by interval size.")); headerLines.add(new VCFFormatHeaderLine("Q1", 1, VCFHeaderLineType.Float, "Lower Quartile of depth distribution.")); headerLines.add(new VCFFormatHeaderLine("MED", 1, VCFHeaderLineType.Float, "Median of depth distribution.")); headerLines.add(new VCFFormatHeaderLine("Q3", 1, VCFHeaderLineType.Float, "Upper Quartile of depth Distribution.")); diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index 7d69dcd48..5b9a83a1b 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -241,7 +241,7 @@ public class UnifiedGenotyper extends LocusWalker, Unif UG_engine = new UnifiedGenotyperEngine(getToolkit(), UAC, logger, verboseWriter, annotationEngine, samples, VariantContextUtils.DEFAULT_PLOIDY); // initialize the header - Set headerInfo = getHeaderInfo(); + Set headerInfo = getHeaderInfo(UAC, annotationEngine, dbsnp); // invoke initialize() method on each of the annotation classes, allowing them to add their own header lines // and perform any necessary initialization/validation steps @@ -250,27 +250,37 @@ public class UnifiedGenotyper extends LocusWalker, Unif writer.writeHeader(new VCFHeader(headerInfo, samples)); } - private Set getHeaderInfo() { + public static Set getHeaderInfo(final UnifiedArgumentCollection UAC, + final VariantAnnotatorEngine annotationEngine, + final DbsnpArgumentCollection dbsnp) { Set headerInfo = new HashSet(); // all annotation fields from VariantAnnotatorEngine - headerInfo.addAll(annotationEngine.getVCFAnnotationDescriptions()); + if ( annotationEngine != null ) + headerInfo.addAll(annotationEngine.getVCFAnnotationDescriptions()); // annotation (INFO) fields from UnifiedGenotyper if ( !UAC.NO_SLOD ) - headerInfo.add(new VCFInfoHeaderLine(VCFConstants.STRAND_BIAS_KEY, 1, VCFHeaderLineType.Float, "Strand Bias")); + VCFStandardHeaderLines.addStandardInfoLines(headerInfo, true, VCFConstants.STRAND_BIAS_KEY); + if ( UAC.ANNOTATE_NUMBER_OF_ALLELES_DISCOVERED ) headerInfo.add(new VCFInfoHeaderLine(UnifiedGenotyperEngine.NUMBER_OF_DISCOVERED_ALLELES_KEY, 1, VCFHeaderLineType.Integer, "Number of alternate alleles discovered (but not necessarily genotyped) at this site")); - headerInfo.add(new VCFInfoHeaderLine(VCFConstants.DOWNSAMPLED_KEY, 0, VCFHeaderLineType.Flag, "Were any of the samples downsampled?")); - headerInfo.add(new VCFInfoHeaderLine(VCFConstants.MLE_ALLELE_COUNT_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Maximum likelihood expectation (MLE) for the allele counts (not necessarily the same as the AC), for each ALT allele, in the same order as listed")); - headerInfo.add(new VCFInfoHeaderLine(VCFConstants.MLE_ALLELE_FREQUENCY_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Maximum likelihood expectation (MLE) for the allele frequency (not necessarily the same as the AF), for each ALT allele, in the same order as listed")); + + VCFStandardHeaderLines.addStandardInfoLines(headerInfo, true, + VCFConstants.DOWNSAMPLED_KEY, + VCFConstants.MLE_ALLELE_COUNT_KEY, + VCFConstants.MLE_ALLELE_FREQUENCY_KEY); // also, check to see whether comp rods were included - if ( dbsnp.dbsnp.isBound() ) - headerInfo.add(new VCFInfoHeaderLine(VCFConstants.DBSNP_KEY, 0, VCFHeaderLineType.Flag, "dbSNP Membership")); + if ( dbsnp != null && dbsnp.dbsnp.isBound() ) + VCFStandardHeaderLines.addStandardInfoLines(headerInfo, true, VCFConstants.DBSNP_KEY); // FORMAT fields - headerInfo.addAll(getSupportedHeaderStrings()); + VCFStandardHeaderLines.addStandardFormatLines(headerInfo, true, + VCFConstants.GENOTYPE_KEY, + VCFConstants.GENOTYPE_QUALITY_KEY, + VCFConstants.DEPTH_KEY, + VCFConstants.GENOTYPE_PL_KEY); // FILTER fields are added unconditionally as it's not always 100% certain the circumstances // where the filters are used. For example, in emitting all sites the lowQual field is used @@ -279,20 +289,6 @@ public class UnifiedGenotyper extends LocusWalker, Unif return headerInfo; } - /** - * return a set of supported format lines; what we currently support for output in the genotype fields of a VCF - * @return a set of VCF format lines - */ - private static Set getSupportedHeaderStrings() { - Set result = new HashSet(); - result.add(VCFConstants.GENOTYPE_KEY_HEADER_LINE); - result.add(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_QUALITY_KEY, 1, VCFHeaderLineType.Integer, "Genotype Quality")); - result.add(new VCFFormatHeaderLine(VCFConstants.DEPTH_KEY, 1, VCFHeaderLineType.Integer, "Approximate read depth (reads with MQ=255 or with bad mates are filtered)")); - result.add(new VCFFormatHeaderLine(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); - - return result; - } - /** * Compute at a given locus. * diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java index 4f080e90b..504359f3f 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java @@ -316,7 +316,7 @@ public class SomaticIndelDetectorWalker extends ReadWalker { // first, the basic info headerInfo.add(new VCFHeaderLine("source", "SomaticIndelDetector")); headerInfo.add(new VCFHeaderLine("reference", getToolkit().getArguments().referenceFile.getName())); - headerInfo.add(VCFConstants.GENOTYPE_KEY_HEADER_LINE); + headerInfo.add(VCFStandardHeaderLines.getFormatLine(VCFConstants.GENOTYPE_KEY)); // FORMAT and INFO fields // headerInfo.addAll(VCFUtils.getSupportedHeaderStrings()); diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java index 8a3098472..c1d4d34fb 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java @@ -150,8 +150,7 @@ public class ApplyRecalibration extends RodWalker implements T // setup the header fields final Set hInfo = new HashSet(); hInfo.addAll(VCFUtils.getHeaderFields(getToolkit(), inputNames)); - hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.VQS_LOD_KEY, 1, VCFHeaderLineType.Float, "Log odds ratio of being a true variant versus being false under the trained gaussian mixture model")); - hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.CULPRIT_KEY, 1, VCFHeaderLineType.String, "The annotation which was the worst performing in the Gaussian mixture model, likely the reason why the variant was filtered out")); + addVQSRStandardHeaderLines(hInfo); final TreeSet samples = new TreeSet(); samples.addAll(SampleUtils.getUniqueSamplesFromRods(getToolkit(), inputNames)); @@ -173,6 +172,12 @@ public class ApplyRecalibration extends RodWalker implements T vcfWriter.writeHeader(vcfHeader); } + public static final void addVQSRStandardHeaderLines(final Set hInfo) { + hInfo.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.END_KEY)); + hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.VQS_LOD_KEY, 1, VCFHeaderLineType.Float, "Log odds ratio of being a true variant versus being false under the trained gaussian mixture model")); + hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.CULPRIT_KEY, 1, VCFHeaderLineType.String, "The annotation which was the worst performing in the Gaussian mixture model, likely the reason why the variant was filtered out")); + } + //--------------------------------------------------------------------------------------------------------------- // // map diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java index 3666cfd12..ff4125d6c 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java @@ -37,7 +37,9 @@ import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.QualityUtils; import org.broadinstitute.sting.utils.R.RScriptExecutor; import org.broadinstitute.sting.utils.Utils; +import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeader; +import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLine; import org.broadinstitute.sting.utils.collections.ExpandingArrayList; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.io.Resource; @@ -229,7 +231,10 @@ public class VariantRecalibrator extends RodWalker hInfo = new HashSet(); + ApplyRecalibration.addVQSRStandardHeaderLines(hInfo); + recalWriter.writeHeader( new VCFHeader(hInfo) ); } //--------------------------------------------------------------------------------------------------------------- diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java index bd14d0563..378da05d3 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java @@ -34,9 +34,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.RodWalker; import org.broadinstitute.sting.gatk.walkers.TreeReducible; import org.broadinstitute.sting.utils.SampleUtils; -import org.broadinstitute.sting.utils.codecs.vcf.VCFHeader; -import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLine; -import org.broadinstitute.sting.utils.codecs.vcf.VCFUtils; +import org.broadinstitute.sting.utils.codecs.vcf.*; import org.broadinstitute.sting.utils.variantcontext.writer.VariantContextWriter; import org.broadinstitute.sting.utils.text.ListFileUtils; import org.broadinstitute.sting.utils.variantcontext.VariantContext; @@ -202,6 +200,9 @@ public class SelectHeaders extends RodWalker implements TreeRe // Remove any excluded headers. if (XLheaderNames != null) selectedHeaders = ListFileUtils.excludeMatching(selectedHeaders, headerKey, XLheaderNames, true); + + // always include the contig lines + selectedHeaders = VCFUtils.withUpdatedContigsAsLines(selectedHeaders, getToolkit().getArguments().referenceFile, getToolkit().getMasterSequenceDictionary()); return selectedHeaders; } diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java index b7388c4d9..33ab5a4c3 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java @@ -36,6 +36,7 @@ import org.broadinstitute.sting.gatk.walkers.TreeReducible; import org.broadinstitute.sting.gatk.walkers.annotator.ChromosomeCounts; import org.broadinstitute.sting.gatk.walkers.genotyper.GenotypeLikelihoodsCalculationModel; import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedArgumentCollection; +import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedGenotyper; import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedGenotyperEngine; import org.broadinstitute.sting.utils.MendelianViolation; import org.broadinstitute.sting.utils.SampleUtils; @@ -432,8 +433,7 @@ public class SelectVariants extends RodWalker implements TreeR headerLines.add(new VCFInfoHeaderLine("AN_Orig", 1, VCFHeaderLineType.Integer, "Original AN")); } headerLines.addAll(Arrays.asList(ChromosomeCounts.descriptions)); - headerLines.add(new VCFInfoHeaderLine(VCFConstants.DEPTH_KEY, 1, VCFHeaderLineType.Integer, "Depth of coverage")); - vcfWriter.writeHeader(new VCFHeader(headerLines, samples)); + headerLines.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.DEPTH_KEY)); for (int i = 0; i < SELECT_EXPRESSIONS.size(); i++) { // It's not necessary that the user supply select names for the JEXL expressions, since those @@ -469,6 +469,7 @@ public class SelectVariants extends RodWalker implements TreeR UAC.OutputMode = UnifiedGenotyperEngine.OUTPUT_MODE.EMIT_ALL_SITES; UAC.NO_SLOD = true; UG_engine = new UnifiedGenotyperEngine(getToolkit(), UAC, logger, null, null, samples, VariantContextUtils.DEFAULT_PLOIDY); + headerLines.addAll(UnifiedGenotyper.getHeaderInfo(UAC, null, null)); } /** load in the IDs file to a hashset for matching */ @@ -483,6 +484,8 @@ public class SelectVariants extends RodWalker implements TreeR throw new UserException.CouldNotReadInputFile(rsIDFile, e); } } + + vcfWriter.writeHeader(new VCFHeader(headerLines, samples)); } /** diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java index f7a70e5dc..3fca2d28a 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java @@ -170,8 +170,8 @@ public class VariantValidationAssessor extends RodWalker hInfo.add(new VCFInfoHeaderLine("HetPct", 1, VCFHeaderLineType.Float, "Percent of heterozygous genotypes")); hInfo.add(new VCFInfoHeaderLine("HomVarPct", 1, VCFHeaderLineType.Float, "Percent homozygous variant genotypes")); hInfo.add(new VCFInfoHeaderLine("HW", 1, VCFHeaderLineType.Float, "Phred-scaled Hardy-Weinberg violation p-value")); - hInfo.add(new VCFInfoHeaderLine(VCFConstants.ALLELE_COUNT_KEY, 1, VCFHeaderLineType.Integer, "Allele count in genotypes, for each ALT allele, in the same order as listed")); - hInfo.add(new VCFInfoHeaderLine(VCFConstants.ALLELE_NUMBER_KEY, 1, VCFHeaderLineType.Integer, "Total number of alleles in called genotypes")); + hInfo.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_COUNT_KEY)); + hInfo.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_NUMBER_KEY)); hInfo.add(new VCFFilterHeaderLine("HardyWeinbergViolation", "The validation is in Hardy-Weinberg violation")); hInfo.add(new VCFFilterHeaderLine("HighNoCallRate", "The validation no-call rate is too high")); hInfo.add(new VCFFilterHeaderLine("TooManyHomVars", "The validation homozygous variant rate is too high")); diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java index 215158152..b508a9dd5 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java @@ -219,10 +219,8 @@ public class VariantsToVCF extends RodWalker { // setup the header fields Set hInfo = new HashSet(); hInfo.addAll(VCFUtils.getHeaderFields(getToolkit(), Arrays.asList(variants.getName()))); - //hInfo.add(new VCFHeaderLine("source", "VariantsToVCF")); - //hInfo.add(new VCFHeaderLine("reference", getToolkit().getArguments().referenceFile.getID())); + hInfo.add(VCFStandardHeaderLines.getFormatLine(VCFConstants.GENOTYPE_KEY)); - hInfo.add(VCFConstants.GENOTYPE_KEY_HEADER_LINE); allowedGenotypeFormatStrings.add(VCFConstants.GENOTYPE_KEY); for ( VCFHeaderLine field : hInfo ) { if ( field instanceof VCFFormatHeaderLine) { diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2GenotypeFieldDecoders.java b/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2GenotypeFieldDecoders.java index 36ecb198b..5a4d1d0da 100644 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2GenotypeFieldDecoders.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2GenotypeFieldDecoders.java @@ -60,7 +60,7 @@ public class BCF2GenotypeFieldDecoders { genotypeFieldDecoder.put(VCFConstants.GENOTYPE_FILTER_KEY, new FTDecoder()); genotypeFieldDecoder.put(VCFConstants.DEPTH_KEY, new DPDecoder()); genotypeFieldDecoder.put(VCFConstants.GENOTYPE_ALLELE_DEPTHS, new ADDecoder()); - genotypeFieldDecoder.put(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY, new PLDecoder()); + genotypeFieldDecoder.put(VCFConstants.GENOTYPE_PL_KEY, new PLDecoder()); genotypeFieldDecoder.put(VCFConstants.GENOTYPE_QUALITY_KEY, new GQDecoder()); } diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2Utils.java b/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2Utils.java index 8e8ce7480..2669206fe 100644 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2Utils.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/bcf2/BCF2Utils.java @@ -164,8 +164,10 @@ public final class BCF2Utils { public static final String collapseStringList(final List strings) { final StringBuilder b = new StringBuilder(); for ( final String s : strings ) { - assert s.indexOf(",") == -1; // no commas in individual strings - b.append(",").append(s); + if ( s != null ) { + assert s.indexOf(",") == -1; // no commas in individual strings + b.append(",").append(s); + } } return b.toString(); } diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java index d8eebdfe2..baeec462d 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java @@ -23,7 +23,7 @@ import java.util.zip.GZIPInputStream; public abstract class AbstractVCFCodec extends AsciiFeatureCodec implements NameAwareCodec { public final static int MAX_ALLELE_SIZE_BEFORE_WARNING = (int)Math.pow(2, 20); - protected final static Logger log = Logger.getLogger(VCFCodec.class); + protected final static Logger log = Logger.getLogger(AbstractVCFCodec.class); protected final static int NUM_STANDARD_FIELDS = 8; // INFO is the 8th column // we have to store the list of strings that make up the header until they're needed @@ -168,6 +168,7 @@ public abstract class AbstractVCFCodec extends AsciiFeatureCodec } this.header = new VCFHeader(metaData, sampleNames); + this.header = VCFStandardHeaderLines.repairStandardHeaderLines(this.header); return this.header; } @@ -433,6 +434,10 @@ public abstract class AbstractVCFCodec extends AsciiFeatureCodec } } else { key = infoFieldArray[i]; + final VCFInfoHeaderLine headerLine = header.getInfoHeaderLine(key); + if ( headerLine != null && headerLine.getType() != VCFHeaderLineType.Flag ) + generateException("Found info key " + key + " without a = value, but the header says the field is of type " + + headerLine.getType() + " but this construct is only value for FLAG type fields"); value = true; } @@ -780,7 +785,7 @@ public abstract class AbstractVCFCodec extends AsciiFeatureCodec gb.GQ((int)Math.round(Double.valueOf(GTValueArray[i]))); } else if (gtKey.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { gb.AD(decodeInts(GTValueArray[i])); - } else if (gtKey.equals(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY)) { + } else if (gtKey.equals(VCFConstants.GENOTYPE_PL_KEY)) { gb.PL(decodeInts(GTValueArray[i])); } else if (gtKey.equals(VCFConstants.GENOTYPE_LIKELIHOODS_KEY)) { gb.PL(GenotypeLikelihoods.fromGLField(GTValueArray[i]).getAsPLs()); diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFCodec.java index 42f9d7d2d..da5b18831 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFCodec.java @@ -114,7 +114,8 @@ public class VCFCodec extends AbstractVCFCodec { * @param headerForRepairs */ public void setHeaderForRepairs(final VCFHeader headerForRepairs) { - log.info("Using master VCF header to repair missing files from incoming VCFs"); + if ( headerForRepairs != null ) + log.info("Using master VCF header to repair missing files from incoming VCFs"); this.headerForRepairs = headerForRepairs; } diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFConstants.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFConstants.java index 1814961f8..f76939ca9 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFConstants.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFConstants.java @@ -44,20 +44,21 @@ public final class VCFConstants { public static final String DOWNSAMPLED_KEY = "DS"; public static final String EXPECTED_ALLELE_COUNT_KEY = "EC"; public static final String END_KEY = "END"; + public static final String GENOTYPE_FILTER_KEY = "FT"; public static final String GENOTYPE_KEY = "GT"; - @Deprecated - public static final String GENOTYPE_LIKELIHOODS_KEY = "GL"; // log10 scaled genotype likelihoods public static final String GENOTYPE_POSTERIORS_KEY = "GP"; public static final String GENOTYPE_QUALITY_KEY = "GQ"; public static final String GENOTYPE_ALLELE_DEPTHS = "AD"; + public static final String GENOTYPE_PL_KEY = "PL"; // phred-scaled genotype likelihoods + @Deprecated public static final String GENOTYPE_LIKELIHOODS_KEY = "GL"; // log10 scaled genotype likelihoods + public static final String HAPMAP2_KEY = "H2"; public static final String HAPMAP3_KEY = "H3"; public static final String HAPLOTYPE_QUALITY_KEY = "HQ"; public static final String RMS_MAPPING_QUALITY_KEY = "MQ"; public static final String MAPPING_QUALITY_ZERO_KEY = "MQ0"; public static final String SAMPLE_NUMBER_KEY = "NS"; - public static final String PHRED_GENOTYPE_LIKELIHOODS_KEY = "PL"; // phred-scaled genotype likelihoods public static final String PHASE_QUALITY_KEY = "PQ"; public static final String PHASE_SET_KEY = "PS"; public static final String OLD_DEPTH_KEY = "RD"; @@ -88,7 +89,8 @@ public final class VCFConstants { public static final String FORMAT_HEADER_START = "##FORMAT"; public static final String INFO_HEADER_START = "##INFO"; public static final String ALT_HEADER_START = "##ALT"; - public static final String CONTIG_HEADER_START = "##contig"; + public static final String CONTIG_HEADER_KEY = "contig"; + public static final String CONTIG_HEADER_START = "##" + CONTIG_HEADER_KEY; // old indel alleles public static final char DELETION_ALLELE_v3 = 'D'; @@ -117,9 +119,4 @@ public final class VCFConstants { public static final int MAX_GENOTYPE_QUAL = 99; public static final Double VCF_ENCODING_EPSILON = 0.00005; // when we consider fields equal(), used in the Qual compare - - // - // VCF header line constants - // - public static final VCFFormatHeaderLine GENOTYPE_KEY_HEADER_LINE = new VCFFormatHeaderLine(VCFConstants.GENOTYPE_KEY, 1, VCFHeaderLineType.String, "Genotype"); } \ No newline at end of file diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFHeader.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFHeader.java index 0a800d7d0..50d46eab3 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFHeader.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFHeader.java @@ -195,11 +195,11 @@ public class VCFHeader { } } - if ( hasFormatLine(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && ! hasFormatLine(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY) ) { + if ( hasFormatLine(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && ! hasFormatLine(VCFConstants.GENOTYPE_PL_KEY) ) { logger.warn("Found " + VCFConstants.GENOTYPE_LIKELIHOODS_KEY + " format, but no " - + VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY + " field. As the GATK now only manages PL fields internally" + + VCFConstants.GENOTYPE_PL_KEY + " field. As the GATK now only manages PL fields internally" + " automatically adding a corresponding PL field to your VCF header"); - addMetaDataLine(new VCFFormatHeaderLine(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); + addMetaDataLine(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_PL_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); loadMetaDataMaps(); } } diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLines.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLines.java new file mode 100644 index 000000000..38e3c44f1 --- /dev/null +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLines.java @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2012, The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.utils.codecs.vcf; + +import com.google.java.contract.Ensures; +import com.google.java.contract.Invariant; +import com.google.java.contract.Requires; +import org.apache.log4j.Logger; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; + +import java.util.*; + +/** + * Manages header lines for standard VCF INFO and FORMAT fields + * + * Provides simple mechanisms for registering standard lines, + * looking them up, and adding them to headers + * + * @author Mark DePristo + * @since 6/12 + */ +public class VCFStandardHeaderLines { + /** + * Enabling this causes us to repair header lines even if only their descriptions differ + */ + private final static boolean REPAIR_BAD_DESCRIPTIONS = false; + protected final static Logger logger = Logger.getLogger(VCFStandardHeaderLines.class); + private static Standards formatStandards = new Standards(); + private static Standards infoStandards = new Standards(); + + /** + * Walks over the VCF header and repairs the standard VCF header lines in it, returning a freshly + * allocated VCFHeader with standard VCF header lines repaired as necessary + * + * @param header + * @return + */ + @Requires("header != null") + @Ensures("result != null") + public static VCFHeader repairStandardHeaderLines(final VCFHeader header) { + final Set newLines = new LinkedHashSet(header.getMetaData().size()); + for ( VCFHeaderLine line : header.getMetaData() ) { + if ( line instanceof VCFFormatHeaderLine ) { + line = formatStandards.repair((VCFFormatHeaderLine) line); + } else if ( line instanceof VCFInfoHeaderLine) { + line = infoStandards.repair((VCFInfoHeaderLine) line); + } + + newLines.add(line); + } + + return new VCFHeader(newLines, header.getGenotypeSamples()); + } + + /** + * Adds header lines for each of the format fields in IDs to header, returning the set of + * IDs without standard descriptions, unless throwErrorForMissing is true, in which + * case this situation results in a ReviewedStingException + * + * @param IDs + * @return + */ + public static Set addStandardFormatLines(final Set headerLines, final boolean throwErrorForMissing, final Collection IDs) { + return formatStandards.addToHeader(headerLines, IDs, throwErrorForMissing); + } + + /** + * @see #addStandardFormatLines(java.util.Set, boolean, java.util.Collection) + * + * @param headerLines + * @param throwErrorForMissing + * @param IDs + * @return + */ + public static Set addStandardFormatLines(final Set headerLines, final boolean throwErrorForMissing, final String ... IDs) { + return addStandardFormatLines(headerLines, throwErrorForMissing, Arrays.asList(IDs)); + } + + /** + * Returns the standard format line for ID. If none exists, return null or throw an exception, depending + * on throwErrorForMissing + * + * @param ID + * @param throwErrorForMissing + * @return + */ + public static VCFFormatHeaderLine getFormatLine(final String ID, final boolean throwErrorForMissing) { + return formatStandards.get(ID, throwErrorForMissing); + } + + /** + * Returns the standard format line for ID. If none exists throw an exception + * + * @param ID + * @return + */ + public static VCFFormatHeaderLine getFormatLine(final String ID) { + return formatStandards.get(ID, true); + } + + private static void registerStandard(final VCFFormatHeaderLine line) { + formatStandards.add(line); + } + + /** + * Adds header lines for each of the info fields in IDs to header, returning the set of + * IDs without standard descriptions, unless throwErrorForMissing is true, in which + * case this situation results in a ReviewedStingException + * + * @param IDs + * @return + */ + public static Set addStandardInfoLines(final Set headerLines, final boolean throwErrorForMissing, final Collection IDs) { + return infoStandards.addToHeader(headerLines, IDs, throwErrorForMissing); + } + + /** + * @see #addStandardFormatLines(java.util.Set, boolean, java.util.Collection) + * + * @param IDs + * @return + */ + public static Set addStandardInfoLines(final Set headerLines, final boolean throwErrorForMissing, final String ... IDs) { + return addStandardInfoLines(headerLines, throwErrorForMissing, Arrays.asList(IDs)); + } + + /** + * Returns the standard info line for ID. If none exists, return null or throw an exception, depending + * on throwErrorForMissing + * + * @param ID + * @param throwErrorForMissing + * @return + */ + public static VCFInfoHeaderLine getInfoLine(final String ID, final boolean throwErrorForMissing) { + return infoStandards.get(ID, throwErrorForMissing); + } + + /** + * Returns the standard info line for ID. If none exists throw an exception + * + * @param ID + * @return + */ + public static VCFInfoHeaderLine getInfoLine(final String ID) { + return getInfoLine(ID, true); + } + + private static void registerStandard(final VCFInfoHeaderLine line) { + infoStandards.add(line); + } + + + // + // VCF header line constants + // + static { + // FORMAT lines + registerStandard(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_KEY, 1, VCFHeaderLineType.String, "Genotype")); + registerStandard(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_QUALITY_KEY, 1, VCFHeaderLineType.Integer, "Genotype Quality")); + registerStandard(new VCFFormatHeaderLine(VCFConstants.DEPTH_KEY, 1, VCFHeaderLineType.Integer, "Approximate read depth (reads with MQ=255 or with bad mates are filtered)")); + registerStandard(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_PL_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); + registerStandard(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_ALLELE_DEPTHS, VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.Integer, "Allelic depths for the ref and alt alleles in the order listed")); + + // INFO lines + registerStandard(new VCFInfoHeaderLine(VCFConstants.END_KEY, 1, VCFHeaderLineType.Integer, "Stop position of the interval")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.MLE_ALLELE_COUNT_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Maximum likelihood expectation (MLE) for the allele counts (not necessarily the same as the AC), for each ALT allele, in the same order as listed")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.MLE_ALLELE_FREQUENCY_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Maximum likelihood expectation (MLE) for the allele frequency (not necessarily the same as the AF), for each ALT allele, in the same order as listed")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.DOWNSAMPLED_KEY, 0, VCFHeaderLineType.Flag, "Were any of the samples downsampled?")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.DBSNP_KEY, 0, VCFHeaderLineType.Flag, "dbSNP Membership")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.DEPTH_KEY, 1, VCFHeaderLineType.Integer, "Approximate read depth; some reads may have been filtered")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.STRAND_BIAS_KEY, 1, VCFHeaderLineType.Float, "Strand Bias")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.ALLELE_FREQUENCY_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Allele Frequency, for each ALT allele, in the same order as listed")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.ALLELE_COUNT_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Allele count in genotypes, for each ALT allele, in the same order as listed")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.ALLELE_NUMBER_KEY, 1, VCFHeaderLineType.Integer, "Total number of alleles in called genotypes")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.MAPPING_QUALITY_ZERO_KEY, 1, VCFHeaderLineType.Integer, "Total Mapping Quality Zero Reads")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.RMS_MAPPING_QUALITY_KEY, 1, VCFHeaderLineType.Float, "RMS Mapping Quality")); + registerStandard(new VCFInfoHeaderLine(VCFConstants.SOMATIC_KEY, 0, VCFHeaderLineType.Flag, "Somatic event")); + } + + private static class Standards { + private final Map standards = new HashMap(); + + @Requires("line != null") + @Ensures({"result != null", "result.getID().equals(line.getID())"}) + public T repair(final T line) { + final T standard = get(line.getID(), false); + if ( standard != null ) { + final boolean badCountType = line.getCountType() != standard.getCountType(); + final boolean badCount = line.isFixedCount() && ! badCountType && line.getCount() != standard.getCount(); + final boolean badType = line.getType() != standard.getType(); + final boolean badDesc = ! line.getDescription().equals(standard.getDescription()); + final boolean needsRepair = badCountType || badCount || badType || (REPAIR_BAD_DESCRIPTIONS && badDesc); + + if ( needsRepair ) { + logger.warn("Repairing standard header line for field " + line.getID() + " because" + + (badCountType ? " -- count types disagree; header has " + line.getCountType() + " but standard is " + standard.getCountType() : "") + + (badType ? " -- type disagree; header has " + line.getType() + " but standard is " + standard.getType() : "") + + (badCount ? " -- counts disagree; header has " + line.getCount() + " but standard is " + standard.getCount() : "") + + (badDesc ? " -- descriptions disagree; header has '" + line.getDescription() + "' but standard is '" + standard.getDescription() + "'": "")); + return standard; + } else + return line; + } else + return line; + } + + @Requires("headerLines != null") + @Ensures({"result != null", "result.isEmpty() || ! throwErrorForMissing", "IDs.containsAll(result)"}) + public Set addToHeader(final Set headerLines, final Collection IDs, final boolean throwErrorForMissing) { + final Set missing = new HashSet(); + for ( final String ID : IDs ) { + final T line = get(ID, throwErrorForMissing); + if ( line == null ) + missing.add(ID); + else + headerLines.add(line); + } + + return missing; + } + + @Requires("line != null") + @Ensures({ + "standards.containsKey(line.getID())", + "old(standards.values().size()) > standards.values().size()"}) + public void add(final T line) { + if ( standards.containsKey(line.getID()) ) + throw new ReviewedStingException("Attempting to add multiple standard header lines for ID " + line.getID()); + standards.put(line.getID(), line); + } + + @Requires("ID != null") + @Ensures({"result != null || ! throwErrorForMissing"}) + public T get(final String ID, final boolean throwErrorForMissing) { + final T x = standards.get(ID); + if ( throwErrorForMissing && x == null ) + throw new ReviewedStingException("Couldn't find a standard VCF header line for field " + ID); + return x; + } + } +} diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFUtils.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFUtils.java index 8a1b03149..93eb1b237 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/VCFUtils.java @@ -247,9 +247,13 @@ public class VCFUtils { * @param refDict the SAM formatted reference sequence dictionary */ public final static VCFHeader withUpdatedContigs(final VCFHeader oldHeader, final File referenceFile, final SAMSequenceDictionary refDict) { - final Set lines = new LinkedHashSet(oldHeader.getMetaData().size()); + return new VCFHeader(withUpdatedContigsAsLines(oldHeader.getMetaData(), referenceFile, refDict), oldHeader.getGenotypeSamples()); + } - for ( final VCFHeaderLine line : oldHeader.getMetaData() ) { + public final static Set withUpdatedContigsAsLines(final Set oldLines, final File referenceFile, final SAMSequenceDictionary refDict) { + final Set lines = new LinkedHashSet(oldLines.size()); + + for ( final VCFHeaderLine line : oldLines ) { if ( line instanceof VCFContigHeaderLine ) continue; // skip old contig lines if ( line.getKey().equals(VCFHeader.REFERENCE_KEY) ) @@ -261,7 +265,7 @@ public class VCFUtils { lines.add(contigLine); lines.add(new VCFHeaderLine(VCFHeader.REFERENCE_KEY, "file://" + referenceFile.getAbsolutePath())); - return new VCFHeader(lines, oldHeader.getGenotypeSamples()); + return lines; } /** diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/Genotype.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/Genotype.java index cffa5f528..f45b0e615 100755 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/Genotype.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/Genotype.java @@ -31,7 +31,7 @@ public abstract class Genotype implements Comparable { VCFConstants.GENOTYPE_QUALITY_KEY, VCFConstants.DEPTH_KEY, VCFConstants.GENOTYPE_ALLELE_DEPTHS, - VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY); + VCFConstants.GENOTYPE_PL_KEY); public final static String PHASED_ALLELE_SEPARATOR = "|"; public final static String UNPHASED_ALLELE_SEPARATOR = "/"; @@ -354,7 +354,7 @@ public abstract class Genotype implements Comparable { toStringIfExists(VCFConstants.GENOTYPE_QUALITY_KEY, getGQ()), toStringIfExists(VCFConstants.DEPTH_KEY, getDP()), toStringIfExists(VCFConstants.GENOTYPE_ALLELE_DEPTHS, getAD()), - toStringIfExists(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY, getPL()), + toStringIfExists(VCFConstants.GENOTYPE_PL_KEY, getPL()), sortedString(getExtendedAttributes())); } @@ -502,7 +502,7 @@ public abstract class Genotype implements Comparable { return getGQ(); } else if (key.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { return Arrays.asList(getAD()); - } else if (key.equals(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY)) { + } else if (key.equals(VCFConstants.GENOTYPE_PL_KEY)) { return Arrays.asList(getPL()); } else if (key.equals(VCFConstants.DEPTH_KEY)) { return getDP(); @@ -518,7 +518,7 @@ public abstract class Genotype implements Comparable { return hasGQ(); } else if (key.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { return hasAD(); - } else if (key.equals(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY)) { + } else if (key.equals(VCFConstants.GENOTYPE_PL_KEY)) { return hasPL(); } else if (key.equals(VCFConstants.DEPTH_KEY)) { return hasDP(); diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/SlowGenotype.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/SlowGenotype.java index ded7c63bd..0dda82050 100755 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/SlowGenotype.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/SlowGenotype.java @@ -51,7 +51,7 @@ public class SlowGenotype extends Genotype { this.alleles = Collections.unmodifiableList(alleles); commonInfo = new CommonInfo(sampleName, log10PError, filters, attributes); if ( log10Likelihoods != null ) - commonInfo.putAttribute(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY, GenotypeLikelihoods.fromLog10Likelihoods(log10Likelihoods)); + commonInfo.putAttribute(VCFConstants.GENOTYPE_PL_KEY, GenotypeLikelihoods.fromLog10Likelihoods(log10Likelihoods)); this.isPhased = isPhased; validate(); } @@ -72,12 +72,12 @@ public class SlowGenotype extends Genotype { // Useful methods for getting genotype likelihoods for a genotype object, if present // @Override public boolean hasLikelihoods() { - return (commonInfo.hasAttribute(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY) && !commonInfo.getAttribute(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY).equals(VCFConstants.MISSING_VALUE_v4)) || + return (commonInfo.hasAttribute(VCFConstants.GENOTYPE_PL_KEY) && !commonInfo.getAttribute(VCFConstants.GENOTYPE_PL_KEY).equals(VCFConstants.MISSING_VALUE_v4)) || (commonInfo.hasAttribute(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && !commonInfo.getAttribute(VCFConstants.GENOTYPE_LIKELIHOODS_KEY).equals(VCFConstants.MISSING_VALUE_v4)); } @Override public GenotypeLikelihoods getLikelihoods() { - GenotypeLikelihoods x = getLikelihoods(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY, true); + GenotypeLikelihoods x = getLikelihoods(VCFConstants.GENOTYPE_PL_KEY, true); if ( x != null ) return x; else { diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java index 2f9074ded..19cdf337f 100755 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java @@ -1398,7 +1398,7 @@ public class VariantContext implements Feature { // to enable tribble integratio private final Object decodeValue(final String field, final Object value, final VCFCompoundHeaderLine format) { if ( value instanceof String ) { - if ( field.equals(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY) ) + if ( field.equals(VCFConstants.GENOTYPE_PL_KEY) ) return GenotypeLikelihoods.fromPLField((String)value); final String string = (String)value; diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldEncoder.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldEncoder.java index 28fb8a602..ecc1cd3e0 100644 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldEncoder.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldEncoder.java @@ -394,9 +394,11 @@ public abstract class BCF2FieldEncoder { } else { // handle generic case final List doubles = toList(Double.class, value); - for ( final double d : doubles ) { - encoder.encodeRawFloat(d); - count++; + for ( final Double d : doubles ) { + if ( d != null ) { // necessary because .,. => [null, null] in VC + encoder.encodeRawFloat(d); + count++; + } } } for ( ; count < minValues; count++ ) encoder.encodeRawMissingValue(type); @@ -424,6 +426,7 @@ public abstract class BCF2FieldEncoder { return value == null ? BCF2Type.INT8 : BCF2Utils.determineIntegerType((int[])value); } + @Requires("value == null || ((int[])value).length <= minValues") @Override public void encodeValue(final BCF2Encoder encoder, final Object value, final BCF2Type type, final int minValues) throws IOException { int count = 0; @@ -480,9 +483,11 @@ public abstract class BCF2FieldEncoder { @Override public void encodeValue(final BCF2Encoder encoder, final Object value, final BCF2Type type, final int minValues) throws IOException { int count = 0; - for ( final int i : toList(Integer.class, value) ) { - encoder.encodeRawInt(i, type); - count++; + for ( final Integer i : toList(Integer.class, value) ) { + if ( i != null ) { // necessary because .,. => [null, null] in VC + encoder.encodeRawInt(i, type); + count++; + } } for ( ; count < minValues; count++ ) encoder.encodeRawMissingValue(type); } diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldWriter.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldWriter.java index 9d0adeed8..42567adb8 100644 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldWriter.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2FieldWriter.java @@ -179,7 +179,7 @@ public abstract class BCF2FieldWriter { final List values = new ArrayList(vc.getNSamples()); for ( final Genotype g : vc.getGenotypes() ) { for ( final Object i : BCF2Utils.toList(g.getExtendedAttribute(getField(), null)) ) { - values.add((Integer)i); // we know they are all integers + if ( i != null ) values.add((Integer)i); // we know they are all integers } } diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2Writer.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2Writer.java index 92d99c609..eada05578 100644 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2Writer.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/BCF2Writer.java @@ -85,6 +85,7 @@ import java.util.*; class BCF2Writer extends IndexingVariantContextWriter { final protected static Logger logger = Logger.getLogger(BCF2Writer.class); final private static List MISSING_GENOTYPE = Arrays.asList(Allele.NO_CALL, Allele.NO_CALL); + final private static boolean ALLOW_MISSING_CONTIG_LINES = false; private final OutputStream outputStream; // Note: do not flush until completely done writing, to avoid issues with eventual BGZF support private VCFHeader header; @@ -112,8 +113,12 @@ class BCF2Writer extends IndexingVariantContextWriter { public void writeHeader(final VCFHeader header) { // create the config offsets map if ( header.getContigLines().isEmpty() ) { - logger.warn("No contig dictionary found in header, falling back to reference sequence dictionary"); - createContigDictionary(VCFUtils.makeContigHeaderLines(getRefDict(), null)); + if ( ALLOW_MISSING_CONTIG_LINES ) { + logger.warn("No contig dictionary found in header, falling back to reference sequence dictionary"); + createContigDictionary(VCFUtils.makeContigHeaderLines(getRefDict(), null)); + } else { + throw new UserException.MalformedBCF2("Cannot write BCF2 file with missing contig lines"); + } } else { createContigDictionary(header.getContigLines()); } diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/IntGenotypeFieldAccessors.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/IntGenotypeFieldAccessors.java index e02526e1e..fc117e5e1 100644 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/IntGenotypeFieldAccessors.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/writer/IntGenotypeFieldAccessors.java @@ -44,7 +44,7 @@ class IntGenotypeFieldAccessors { public IntGenotypeFieldAccessors() { intGenotypeFieldEncoders.put(VCFConstants.DEPTH_KEY, new IntGenotypeFieldAccessors.DPAccessor()); intGenotypeFieldEncoders.put(VCFConstants.GENOTYPE_ALLELE_DEPTHS, new IntGenotypeFieldAccessors.ADAccessor()); - intGenotypeFieldEncoders.put(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY, new IntGenotypeFieldAccessors.PLAccessor()); + intGenotypeFieldEncoders.put(VCFConstants.GENOTYPE_PL_KEY, new IntGenotypeFieldAccessors.PLAccessor()); intGenotypeFieldEncoders.put(VCFConstants.GENOTYPE_QUALITY_KEY, new IntGenotypeFieldAccessors.GQAccessor()); } 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 2e5d984d0..fcd3eb071 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 @@ -533,7 +533,7 @@ class VCFWriter extends IndexingVariantContextWriter { if ( sawGoodQual ) keys.add(VCFConstants.GENOTYPE_QUALITY_KEY); if ( sawDP ) keys.add(VCFConstants.DEPTH_KEY); if ( sawAD ) keys.add(VCFConstants.GENOTYPE_ALLELE_DEPTHS); - if ( sawPL ) keys.add(VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY); + if ( sawPL ) keys.add(VCFConstants.GENOTYPE_PL_KEY); if ( sawGenotypeFilter ) keys.add(VCFConstants.GENOTYPE_FILTER_KEY); List sortedList = ParsingUtils.sortList(new ArrayList(keys)); diff --git a/public/java/test/net/sf/picard/reference/FastaSequenceIndexBuilderUnitTest.java b/public/java/test/net/sf/picard/reference/FastaSequenceIndexBuilderUnitTest.java index 675d81dda..c243140f7 100644 --- a/public/java/test/net/sf/picard/reference/FastaSequenceIndexBuilderUnitTest.java +++ b/public/java/test/net/sf/picard/reference/FastaSequenceIndexBuilderUnitTest.java @@ -55,7 +55,7 @@ public class FastaSequenceIndexBuilderUnitTest extends BaseTest { public void unixFileTest() { logger.warn("Executing unixFileTest"); - fastaFile = new File(testDir + "exampleFASTA.fasta"); + fastaFile = new File(publicTestDir + "exampleFASTA.fasta"); builder = new FastaSequenceIndexBuilder(fastaFile, false); FastaSequenceIndex index = builder.createIndex(); controlIndex.add(new FastaSequenceIndexEntry("chr1", 6, 100000, 60, 61,0)); @@ -72,7 +72,7 @@ public class FastaSequenceIndexBuilderUnitTest extends BaseTest { public void windowsFileTest() { logger.warn("Executing windowsFileTest"); - fastaFile = new File(testDir + "exampleFASTA-windows.fasta"); + fastaFile = new File(publicTestDir + "exampleFASTA-windows.fasta"); builder = new FastaSequenceIndexBuilder(fastaFile, false); FastaSequenceIndex index = builder.createIndex(); controlIndex.add(new FastaSequenceIndexEntry("chr2", 7, 29, 7, 9,0)); @@ -88,7 +88,7 @@ public class FastaSequenceIndexBuilderUnitTest extends BaseTest { public void combinedWindowsUnix() { logger.warn("Executing combinedWindowsUnix"); - fastaFile = new File(testDir + "exampleFASTA-combined.fasta"); + fastaFile = new File(publicTestDir + "exampleFASTA-combined.fasta"); builder = new FastaSequenceIndexBuilder(fastaFile, false); FastaSequenceIndex index = builder.createIndex(); controlIndex.add(new FastaSequenceIndexEntry("chr1", 6, 100000, 60, 61,0)); @@ -105,7 +105,7 @@ public class FastaSequenceIndexBuilderUnitTest extends BaseTest { public void threeVariableLengthContigs() { logger.warn("Executing threeVariableLengthContigs"); - fastaFile = new File(testDir + "exampleFASTA-3contigs.fasta"); + fastaFile = new File(publicTestDir + "exampleFASTA-3contigs.fasta"); builder = new FastaSequenceIndexBuilder(fastaFile, false); FastaSequenceIndex index = builder.createIndex(); controlIndex.add(new FastaSequenceIndexEntry("chr1", 6, 17, 5, 6,0)); diff --git a/public/java/test/org/broadinstitute/sting/BaseTest.java b/public/java/test/org/broadinstitute/sting/BaseTest.java index 94b3b54ba..55de62431 100755 --- a/public/java/test/org/broadinstitute/sting/BaseTest.java +++ b/public/java/test/org/broadinstitute/sting/BaseTest.java @@ -87,10 +87,13 @@ public abstract class BaseTest { private static final String networkTempDir; private static final File networkTempDirFile; - protected static final String testDirRelative = "public/testdata/"; - public static final File testDirFile = new File(testDirRelative); - public static final String testDir = testDirFile.getAbsolutePath() + "/"; - protected static final String testDirRoot = testDir.replace(testDirRelative, ""); + private static final String privateTestDirRelative = "private/testdata/"; + public static final String privateTestDir = new File(privateTestDirRelative).getAbsolutePath() + "/"; + protected static final String privateTestDirRoot = privateTestDir.replace(privateTestDirRelative, ""); + + private static final String publicTestDirRelative = "public/testdata/"; + public static final String publicTestDir = new File(publicTestDirRelative).getAbsolutePath() + "/"; + protected static final String publicTestDirRoot = publicTestDir.replace(publicTestDirRelative, ""); public static final String keysDataLocation = validationDataLocation + "keys/"; public static final String gatkKeyFile = CryptUtils.GATK_USER_KEY_DIRECTORY + "gsamembers_broadinstitute.org.key"; diff --git a/public/java/test/org/broadinstitute/sting/WalkerTest.java b/public/java/test/org/broadinstitute/sting/WalkerTest.java index 3b252528e..708dd042e 100755 --- a/public/java/test/org/broadinstitute/sting/WalkerTest.java +++ b/public/java/test/org/broadinstitute/sting/WalkerTest.java @@ -356,7 +356,7 @@ public class WalkerTest extends BaseTest { System.out.println(String.format("[%s] Executing test %s with GATK arguments: %s", now, name, cmdline)); // also write the command line to the HTML log for convenient follow-up // do the replaceAll so paths become relative to the current - BaseTest.log(cmdline.replaceAll(testDirRoot, "")); + BaseTest.log(cmdline.replaceAll(publicTestDirRoot, "").replaceAll(privateTestDirRoot, "")); CommandLineExecutable.start(instance, command); } catch (Exception e) { gotAnException = true; diff --git a/public/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java b/public/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java index 8a461d25b..be2e91557 100755 --- a/public/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java @@ -844,8 +844,8 @@ public class ParsingEngineUnitTest extends BaseTest { Assert.assertEquals(argProvider.bindings.get(1).getName(), "foo2", "Name isn't set properly"); } - private final static String HISEQ_VCF = testDir + "HiSeq.10000.vcf"; - private final static String TRANCHES_FILE = testDir + "tranches.6.txt"; + private final static String HISEQ_VCF = privateTestDir + "HiSeq.10000.vcf"; + private final static String TRANCHES_FILE = privateTestDir + "tranches.6.txt"; @Test public void variantContextBindingTestDynamicTyping1() { diff --git a/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java index 85ae1e1f7..d75beae23 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java @@ -79,7 +79,7 @@ public class ReferenceOrderedViewUnitTest extends BaseTest { */ @Test public void testSingleBinding() { - String fileName = testDir + "TabularDataTest.dat"; + String fileName = privateTestDir + "TabularDataTest.dat"; RMDTriplet triplet = new RMDTriplet("tableTest","Table",fileName,RMDStorageType.FILE,new Tags()); ReferenceOrderedDataSource dataSource = new ReferenceOrderedDataSource(triplet,builder,seq.getSequenceDictionary(),genomeLocParser,false); @@ -101,7 +101,7 @@ public class ReferenceOrderedViewUnitTest extends BaseTest { */ @Test public void testMultipleBinding() { - File file = new File(testDir + "TabularDataTest.dat"); + File file = new File(privateTestDir + "TabularDataTest.dat"); RMDTriplet testTriplet1 = new RMDTriplet("tableTest1","Table",file.getAbsolutePath(),RMDStorageType.FILE,new Tags()); ReferenceOrderedDataSource dataSource1 = new ReferenceOrderedDataSource(testTriplet1,builder,seq.getSequenceDictionary(),genomeLocParser,false); diff --git a/public/java/test/org/broadinstitute/sting/gatk/datasources/reads/GATKBAMIndexUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/datasources/reads/GATKBAMIndexUnitTest.java index b12a712d4..f81e16e7f 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/datasources/reads/GATKBAMIndexUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/datasources/reads/GATKBAMIndexUnitTest.java @@ -94,13 +94,13 @@ public class GATKBAMIndexUnitTest extends BaseTest { @Test( expectedExceptions = UserException.MalformedFile.class ) public void testDetectTruncatedBamIndexWordBoundary() { - GATKBAMIndex index = new GATKBAMIndex(new File(testDir + "truncated_at_word_boundary.bai")); + GATKBAMIndex index = new GATKBAMIndex(new File(privateTestDir + "truncated_at_word_boundary.bai")); index.readReferenceSequence(0); } @Test( expectedExceptions = UserException.MalformedFile.class ) public void testDetectTruncatedBamIndexNonWordBoundary() { - GATKBAMIndex index = new GATKBAMIndex(new File(testDir + "truncated_at_non_word_boundary.bai")); + GATKBAMIndex index = new GATKBAMIndex(new File(privateTestDir + "truncated_at_non_word_boundary.bai")); index.readReferenceSequence(0); } diff --git a/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java index d45f6e667..1a6b31df4 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java @@ -68,10 +68,10 @@ public class ReferenceOrderedDataPoolUnitTest extends BaseTest { @BeforeMethod public void setUp() { - String fileName = testDir + "TabularDataTest.dat"; + String fileName = privateTestDir + "TabularDataTest.dat"; // check to see if we have an index, if so, delete it - File indexFileName = new File(testDir + "TabularDataTest.dat.idx"); + File indexFileName = new File(privateTestDir + "TabularDataTest.dat.idx"); if (indexFileName.exists()) indexFileName.delete(); triplet = new RMDTriplet("tableTest","Table",fileName,RMDStorageType.FILE,new Tags()); diff --git a/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedQueryDataPoolUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedQueryDataPoolUnitTest.java index c481a00fe..d7f8e1554 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedQueryDataPoolUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedQueryDataPoolUnitTest.java @@ -43,7 +43,7 @@ public class ReferenceOrderedQueryDataPoolUnitTest extends BaseTest{ @Test public void testCloseFilePointers() throws IOException { // Build up query parameters - File file = new File(BaseTest.testDir + "NA12878.hg19.example1.vcf"); + File file = new File(BaseTest.privateTestDir + "NA12878.hg19.example1.vcf"); RMDTriplet triplet = new RMDTriplet("test", "VCF", file.getAbsolutePath(), RMDTriplet.RMDStorageType.FILE, new Tags()); IndexedFastaSequenceFile seq = new CachingIndexedFastaSequenceFile(new File(BaseTest.hg19Reference)); GenomeLocParser parser = new GenomeLocParser(seq); diff --git a/public/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java index 7d8bf257d..5f2751030 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java @@ -4,7 +4,6 @@ import org.testng.Assert; import org.broadinstitute.sting.BaseTest; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils; -import org.broadinstitute.sting.utils.GenomeLocParser; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -188,7 +187,7 @@ public class ReadGroupBlackListFilterUnitTest extends BaseTest { } List filterList = new ArrayList(); - filterList.add(testDir + "readgroupblacklisttest.txt"); + filterList.add(privateTestDir + "readgroupblacklisttest.txt"); ReadGroupBlackListFilter filter = new ReadGroupBlackListFilter(filterList); int filtered = 0; @@ -227,7 +226,7 @@ public class ReadGroupBlackListFilterUnitTest extends BaseTest { } List filterList = new ArrayList(); - filterList.add(testDir + "readgroupblacklisttestlist.txt"); + filterList.add(privateTestDir + "readgroupblacklisttestlist.txt"); ReadGroupBlackListFilter filter = new ReadGroupBlackListFilter(filterList); int filtered = 0; diff --git a/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManagerUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManagerUnitTest.java index 1a3a86313..48e4ff4ed 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManagerUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManagerUnitTest.java @@ -52,11 +52,11 @@ import java.util.*; * UnitTests for RMD FeatureManager */ public class FeatureManagerUnitTest extends BaseTest { - private static final File RANDOM_FILE = new File(testDir + "exampleGATKReport.eval"); - private static final File VCF3_FILE = new File(testDir + "vcf3.vcf"); - private static final File VCF4_FILE = new File(testDir + "HiSeq.10000.vcf"); - private static final File VCF4_FILE_GZ = new File(testDir + "HiSeq.10000.vcf.gz"); - private static final File VCF4_FILE_BGZIP = new File(testDir + "HiSeq.10000.bgzip.vcf.gz"); + private static final File RANDOM_FILE = new File(publicTestDir+ "exampleGATKReport.eval"); + private static final File VCF3_FILE = new File(privateTestDir + "vcf3.vcf"); + private static final File VCF4_FILE = new File(privateTestDir + "HiSeq.10000.vcf"); + private static final File VCF4_FILE_GZ = new File(privateTestDir + "HiSeq.10000.vcf.gz"); + private static final File VCF4_FILE_BGZIP = new File(privateTestDir + "HiSeq.10000.bgzip.vcf.gz"); private FeatureManager manager; private GenomeLocParser genomeLocParser; diff --git a/public/java/test/org/broadinstitute/sting/gatk/refdata/utils/FeatureToGATKFeatureIteratorUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/refdata/utils/FeatureToGATKFeatureIteratorUnitTest.java index 55f70f16e..c00fbbcdb 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/refdata/utils/FeatureToGATKFeatureIteratorUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/refdata/utils/FeatureToGATKFeatureIteratorUnitTest.java @@ -44,7 +44,7 @@ public class FeatureToGATKFeatureIteratorUnitTest extends BaseTest { final String chr = "20"; IndexedFastaSequenceFile seq = new CachingIndexedFastaSequenceFile(new File(BaseTest.hg19Reference)); GenomeLocParser parser = new GenomeLocParser(seq); - File file = new File(testDir + "NA12878.hg19.example1.vcf"); + File file = new File(privateTestDir + "NA12878.hg19.example1.vcf"); VCFCodec codec = new VCFCodec(); TestFeatureReader reader = new TestFeatureReader(file.getAbsolutePath(), codec); CheckableCloseableTribbleIterator tribbleIterator = reader.query(chr, 1, 100000); diff --git a/public/java/test/org/broadinstitute/sting/gatk/report/GATKReportUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/report/GATKReportUnitTest.java index 495d2b3f3..20071acca 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/report/GATKReportUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/report/GATKReportUnitTest.java @@ -36,7 +36,7 @@ import java.io.PrintStream; public class GATKReportUnitTest extends BaseTest { @Test public void testParse() throws Exception { - String reportPath = testDir + "exampleGATKReportv2.tbl"; + String reportPath = publicTestDir + "exampleGATKReportv2.tbl"; GATKReport report = new GATKReport(reportPath); Assert.assertEquals(report.getVersion(), GATKReportVersion.V1_1); Assert.assertEquals(report.getTables().size(), 5); diff --git a/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDBUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDBUnitTest.java index 85aa28a98..3ee4e31d9 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDBUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDBUnitTest.java @@ -20,7 +20,7 @@ import java.util.*; public class SampleDBUnitTest extends BaseTest { private static SampleDBBuilder builder; // all the test sample files are located here - private File testPED = new File(testDir + "ceutrio.ped"); + private File testPED = new File(privateTestDir + "ceutrio.ped"); private static final Set testPEDSamples = new HashSet(Arrays.asList( new Sample("kid", "fam1", "dad", "mom", Gender.MALE, Affection.AFFECTED), diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/CNV/SymbolicAllelesIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/CNV/SymbolicAllelesIntegrationTest.java index 0ffdb9ffa..13519c815 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/CNV/SymbolicAllelesIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/CNV/SymbolicAllelesIntegrationTest.java @@ -10,7 +10,7 @@ public class SymbolicAllelesIntegrationTest extends WalkerTest { public static String baseTestString(String reference, String VCF) { return "-T CombineVariants" + " -R " + reference + - " --variant:vcf " + testDir + VCF + + " --variant:vcf " + privateTestDir + VCF + " -filteredRecordsMergeType KEEP_IF_ANY_UNFILTERED" + " -genotypeMergeOptions REQUIRE_UNIQUE" + " -setKey null" + diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/ClipReadsWalkersIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/ClipReadsWalkersIntegrationTest.java index 66315611f..ade9bda16 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/ClipReadsWalkersIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/ClipReadsWalkersIntegrationTest.java @@ -36,7 +36,7 @@ public class ClipReadsWalkersIntegrationTest extends WalkerTest { WalkerTestSpec spec = new WalkerTestSpec( "-R " + hg18Reference + " -T ClipReads " + - "-I " + testDir + "clippingReadsTest.withRG.bam " + + "-I " + privateTestDir + "clippingReadsTest.withRG.bam " + "-os %s " + "-o %s " + args, 2, // just one output file @@ -55,9 +55,9 @@ public class ClipReadsWalkersIntegrationTest extends WalkerTest { @Test public void testClipRange2() { testClipper("clipRange2", "-CT 1-5,11-15", "be4fcad5b666a5540028b774169cbad7", "3061cf742f9e5526a61130128ae761a3"); } @Test public void testClipSeq() { testClipper("clipSeqX", "-X CCCCC", "db199bd06561c9f2122f6ffb07941fbc", "b89459f373e40f0b835c1faff2208839"); } - @Test public void testClipSeqFile() { testClipper("clipSeqXF", "-XF " + testDir + "seqsToClip.fasta", "d011a3152b31822475afbe0281491f8d", "24e19116ef16a37a6d095ed5c22c2466"); } + @Test public void testClipSeqFile() { testClipper("clipSeqXF", "-XF " + privateTestDir + "seqsToClip.fasta", "d011a3152b31822475afbe0281491f8d", "24e19116ef16a37a6d095ed5c22c2466"); } - @Test public void testClipMulti() { testClipper("clipSeqMulti", "-QT 10 -CT 1-5 -XF " + testDir + "seqsToClip.fasta -X CCCCC", "a23187bd9bfb06557f799706d98441de", "ad8d30300cb43d5e300fcc4d2450da8e"); } + @Test public void testClipMulti() { testClipper("clipSeqMulti", "-QT 10 -CT 1-5 -XF " + privateTestDir + "seqsToClip.fasta -X CCCCC", "a23187bd9bfb06557f799706d98441de", "ad8d30300cb43d5e300fcc4d2450da8e"); } @Test public void testClipNs() { testClipper("testClipNs", "-QT 10 -CR WRITE_NS", Q10ClipOutput, "57c05b6241db7110148a91fde2d431d0"); } @Test public void testClipQ0s() { testClipper("testClipQs", "-QT 10 -CR WRITE_Q0S", Q10ClipOutput, "2a1a3153e0942ab355fd8a6e082b30e0"); } @@ -68,7 +68,7 @@ public class ClipReadsWalkersIntegrationTest extends WalkerTest { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + hg18Reference + " -T ClipReads" + - " -I " + testDir + "originalQuals.chr1.1-1K.bam" + + " -I " + privateTestDir + "originalQuals.chr1.1-1K.bam" + " -L chr1:1-1,000" + " -OQ -QT 4 -CR WRITE_Q0S" + " -o %s -os %s", diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsIntegrationTest.java index 3e9f2b493..057cf1cf9 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsIntegrationTest.java @@ -47,7 +47,7 @@ public class PrintReadsIntegrationTest extends WalkerTest { WalkerTestSpec spec = new WalkerTestSpec( "-T PrintReads" + " -R " + params.reference + - " -I " + testDir + params.bam + + " -I " + privateTestDir + params.bam + params.args + " -o %s", Arrays.asList(params.md5)); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java index 6dc93e549..3d10e7c73 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java @@ -15,7 +15,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testHasAnnotsNotAsking1() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --variant " + testDir + "vcfexample2.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, + baseTestString() + " --variant " + privateTestDir + "vcfexample2.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, Arrays.asList("bd6848e7dbf2f809ee2f690ee2cf8ef4")); executeTest("test file has annotations, not asking for annotations, #1", spec); } @@ -23,15 +23,15 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testHasAnnotsNotAsking2() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --variant " + testDir + "vcfexample3.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, - Arrays.asList("9914bd19f6235c550e5182e0f4591da6")); + baseTestString() + " --variant " + privateTestDir + "vcfexample3.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, + Arrays.asList("d6f749f8dbeb2d42c9effaff9fe571d7")); executeTest("test file has annotations, not asking for annotations, #2", spec); } @Test public void testHasAnnotsAsking1() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -G Standard --variant " + testDir + "vcfexample2.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -G Standard --variant " + privateTestDir + "vcfexample2.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, Arrays.asList("9084e6c7b1cec0f3a2c6d96711844d5e")); executeTest("test file has annotations, asking for annotations, #1", spec); } @@ -39,15 +39,15 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testHasAnnotsAsking2() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -G Standard --variant " + testDir + "vcfexample3.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, - Arrays.asList("74d894fd31b449deffca88d0e465f01b")); + baseTestString() + " -G Standard --variant " + privateTestDir + "vcfexample3.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, + Arrays.asList("3dfabdcaa2648ac34380fb71860c42d3")); executeTest("test file has annotations, asking for annotations, #2", spec); } @Test public void testNoAnnotsNotAsking1() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --variant " + testDir + "vcfexample2empty.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, + baseTestString() + " --variant " + privateTestDir + "vcfexample2empty.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, Arrays.asList("b85c1ea28194484b327fbe0add1b5685")); executeTest("test file doesn't have annotations, not asking for annotations, #1", spec); } @@ -57,7 +57,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { // the genotype annotations in this file are actually out of order. If you don't parse the genotypes // they don't get reordered. It's a good test of the genotype ordering system. WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --variant " + testDir + "vcfexample3empty.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, + baseTestString() + " --variant " + privateTestDir + "vcfexample3empty.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, Arrays.asList("fe4d4e2484c4cf8b1cd50ad42cfe468e")); executeTest("test file doesn't have annotations, not asking for annotations, #2", spec); } @@ -65,7 +65,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testNoAnnotsAsking1() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -G Standard --variant " + testDir + "vcfexample2empty.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -G Standard --variant " + privateTestDir + "vcfexample2empty.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, Arrays.asList("043fc6205b0633edcd3fadc9e044800c")); executeTest("test file doesn't have annotations, asking for annotations, #1", spec); } @@ -73,7 +73,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testNoAnnotsAsking2() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -G Standard --variant " + testDir + "vcfexample3empty.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, + baseTestString() + " -G Standard --variant " + privateTestDir + "vcfexample3empty.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1, Arrays.asList("6fafb42d374a67ba4687a23078a126af")); executeTest("test file doesn't have annotations, asking for annotations, #2", spec); } @@ -81,7 +81,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testExcludeAnnotations() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -G Standard -XA FisherStrand -XA ReadPosRankSumTest --variant " + testDir + "vcfexample2empty.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -G Standard -XA FisherStrand -XA ReadPosRankSumTest --variant " + privateTestDir + "vcfexample2empty.vcf -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1, Arrays.asList("639462a0e0fa79e33def5f011fe55961")); executeTest("test exclude annotations", spec); } @@ -89,7 +89,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testOverwritingHeader() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -G Standard --variant " + testDir + "vcfexample4.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,001,292", 1, + baseTestString() + " -G Standard --variant " + privateTestDir + "vcfexample4.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,001,292", 1, Arrays.asList("ebbf32f5b8b8d22f2eb247a0a3db3da0")); executeTest("test overwriting header", spec); } @@ -97,7 +97,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testNoReads() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -G Standard --variant " + testDir + "vcfexample3empty.vcf -L " + testDir + "vcfexample3empty.vcf", 1, + baseTestString() + " -G Standard --variant " + privateTestDir + "vcfexample3empty.vcf -L " + privateTestDir + "vcfexample3empty.vcf", 1, Arrays.asList("afe6c9d3b4b80635a541cdfcfa48db2f")); executeTest("not passing it any reads", spec); } @@ -105,7 +105,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testDBTagWithDbsnp() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --dbsnp " + b36dbSNP129 + " -G Standard --variant " + testDir + "vcfexample3empty.vcf -L " + testDir + "vcfexample3empty.vcf", 1, + baseTestString() + " --dbsnp " + b36dbSNP129 + " -G Standard --variant " + privateTestDir + "vcfexample3empty.vcf -L " + privateTestDir + "vcfexample3empty.vcf", 1, Arrays.asList("21d696ea8c55d2fd4cbb4dcd5f7f7db6")); executeTest("getting DB tag with dbSNP", spec); } @@ -113,7 +113,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testMultipleIdsWithDbsnp() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --alwaysAppendDbsnpId --dbsnp " + b36dbSNP129 + " -G Standard --variant " + testDir + "vcfexample3withIDs.vcf -L " + testDir + "vcfexample3withIDs.vcf", 1, + baseTestString() + " --alwaysAppendDbsnpId --dbsnp " + b36dbSNP129 + " -G Standard --variant " + privateTestDir + "vcfexample3withIDs.vcf -L " + privateTestDir + "vcfexample3withIDs.vcf", 1, Arrays.asList("ef95394c14d5c16682a322f3dfb9000c")); executeTest("adding multiple IDs with dbSNP", spec); } @@ -121,7 +121,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testDBTagWithHapMap() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --comp:H3 " + testDir + "fakeHM3.vcf -G Standard --variant " + testDir + "vcfexample3empty.vcf -L " + testDir + "vcfexample3empty.vcf", 1, + baseTestString() + " --comp:H3 " + privateTestDir + "fakeHM3.vcf -G Standard --variant " + privateTestDir + "vcfexample3empty.vcf -L " + privateTestDir + "vcfexample3empty.vcf", 1, Arrays.asList("e6e276b7d517d57626c8409589cd286f")); executeTest("getting DB tag with HM3", spec); } @@ -129,7 +129,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testNoQuals() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --variant " + testDir + "noQual.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L " + testDir + "noQual.vcf -A QualByDepth", 1, + baseTestString() + " --variant " + privateTestDir + "noQual.vcf -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L " + privateTestDir + "noQual.vcf -A QualByDepth", 1, Arrays.asList("a99e8315571ed1b6bce942451b3d8612")); executeTest("test file doesn't have QUALs", spec); } @@ -137,7 +137,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testUsingExpression() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --resource:foo " + testDir + "targetAnnotations.vcf -G Standard --variant " + testDir + "vcfexample3empty.vcf -E foo.AF -L " + testDir + "vcfexample3empty.vcf", 1, + baseTestString() + " --resource:foo " + privateTestDir + "targetAnnotations.vcf -G Standard --variant " + privateTestDir + "vcfexample3empty.vcf -E foo.AF -L " + privateTestDir + "vcfexample3empty.vcf", 1, Arrays.asList("7d6ea3b54210620cbc7e14dad8836bcb")); executeTest("using expression", spec); } @@ -145,7 +145,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testUsingExpressionWithID() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --resource:foo " + testDir + "targetAnnotations.vcf -G Standard --variant " + testDir + "vcfexample3empty.vcf -E foo.ID -L " + testDir + "vcfexample3empty.vcf", 1, + baseTestString() + " --resource:foo " + privateTestDir + "targetAnnotations.vcf -G Standard --variant " + privateTestDir + "vcfexample3empty.vcf -E foo.ID -L " + privateTestDir + "vcfexample3empty.vcf", 1, Arrays.asList("35ce4fb0288dfc5c01ec6ce8b14c6157")); executeTest("using expression with ID", spec); } @@ -189,8 +189,8 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { public void testTDTAnnotation() { final String MD5 = "81f85f0ce8cc36df7c717c478e100ba1"; WalkerTestSpec spec = new WalkerTestSpec( - "-T VariantAnnotator -R " + b37KGReference + " -A TransmissionDisequilibriumTest --variant:vcf " + testDir + "ug.random50000.subset300bp.chr1.family.vcf" + - " -L " + testDir + "ug.random50000.subset300bp.chr1.family.vcf --no_cmdline_in_header -ped " + testDir + "ug.random50000.family.ped -o %s", 1, + "-T VariantAnnotator -R " + b37KGReference + " -A TransmissionDisequilibriumTest --variant:vcf " + privateTestDir + "ug.random50000.subset300bp.chr1.family.vcf" + + " -L " + privateTestDir + "ug.random50000.subset300bp.chr1.family.vcf --no_cmdline_in_header -ped " + privateTestDir + "ug.random50000.family.ped -o %s", 1, Arrays.asList(MD5)); executeTest("Testing TDT annotation ", spec); } @@ -200,8 +200,8 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { public void testChromosomeCountsPed() { final String MD5 = "9830fe2247651377e68ad0b0894e9a4e"; WalkerTestSpec spec = new WalkerTestSpec( - "-T VariantAnnotator -R " + b37KGReference + " -A ChromosomeCounts --variant:vcf " + testDir + "ug.random50000.subset300bp.chr1.family.vcf" + - " -L " + testDir + "ug.random50000.subset300bp.chr1.family.vcf --no_cmdline_in_header -ped " + testDir + "ug.random50000.family.ped -o %s", 1, + "-T VariantAnnotator -R " + b37KGReference + " -A ChromosomeCounts --variant:vcf " + privateTestDir + "ug.random50000.subset300bp.chr1.family.vcf" + + " -L " + privateTestDir + "ug.random50000.subset300bp.chr1.family.vcf --no_cmdline_in_header -ped " + privateTestDir + "ug.random50000.family.ped -o %s", 1, Arrays.asList(MD5)); executeTest("Testing ChromosomeCounts annotation with PED file", spec); } @@ -210,8 +210,8 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { public void testInbreedingCoeffPed() { final String MD5 = "e94d589b5691e3ecfd9cc9475a384890"; WalkerTestSpec spec = new WalkerTestSpec( - "-T VariantAnnotator -R " + b37KGReference + " -A InbreedingCoeff --variant:vcf " + testDir + "ug.random50000.subset300bp.chr1.family.vcf" + - " -L " + testDir + "ug.random50000.subset300bp.chr1.family.vcf --no_cmdline_in_header -ped " + testDir + "ug.random50000.family.ped -o %s", 1, + "-T VariantAnnotator -R " + b37KGReference + " -A InbreedingCoeff --variant:vcf " + privateTestDir + "ug.random50000.subset300bp.chr1.family.vcf" + + " -L " + privateTestDir + "ug.random50000.subset300bp.chr1.family.vcf --no_cmdline_in_header -ped " + privateTestDir + "ug.random50000.family.ped -o %s", 1, Arrays.asList(MD5)); executeTest("Testing InbreedingCoeff annotation with PED file", spec); } diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java index f10b9a960..99710831d 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java @@ -32,7 +32,7 @@ import java.util.Arrays; public class BeagleIntegrationTest extends WalkerTest { - private static final String beagleValidationDataLocation = testDir + "/Beagle/"; + private static final String beagleValidationDataLocation = privateTestDir + "/Beagle/"; @Test public void testBeagleOutput() { WalkerTestSpec spec = new WalkerTestSpec( diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java index 470d8e6dc..e3461421d 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java @@ -52,10 +52,10 @@ public class DiffObjectsIntegrationTest extends WalkerTest { @DataProvider(name = "data") public Object[][] createData() { - new TestParams(testDir + "diffTestMaster.vcf", testDir + "diffTestTest.vcf", true, "bf7ef17436a7eccf27be41a9477904f6"); - new TestParams(testDir + "exampleBAM.bam", testDir + "exampleBAM.simple.bam", true, "3f46f5a964f7c34015d972256fe49a35"); - new TestParams(testDir + "diffTestMaster.vcf", testDir + "diffTestTest.vcf", false, "8ab29169cff232e670db9a4c54fc4358"); - new TestParams(testDir + "exampleBAM.bam", testDir + "exampleBAM.simple.bam", false, "47bf16c27c9e2c657a7e1d13f20880c9"); + new TestParams(privateTestDir + "diffTestMaster.vcf", privateTestDir + "diffTestTest.vcf", true, "aea3d5df32a2acd400da48d06b4dbc60"); + new TestParams(publicTestDir + "exampleBAM.bam", publicTestDir + "exampleBAM.simple.bam", true, "3f46f5a964f7c34015d972256fe49a35"); + new TestParams(privateTestDir + "diffTestMaster.vcf", privateTestDir + "diffTestTest.vcf", false, "e71e23e7ebfbe768e59527bc62f8918d"); + new TestParams(publicTestDir + "exampleBAM.bam", publicTestDir + "exampleBAM.simple.bam", false, "47bf16c27c9e2c657a7e1d13f20880c9"); return TestParams.getTests(TestParams.class); } diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java index 46b0df5b4..c1c22aceb 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java @@ -29,8 +29,8 @@ package org.broadinstitute.sting.gatk.walkers.diffengine; // the imports for unit testing. -import net.sf.samtools.SAMRecord; import org.broadinstitute.sting.BaseTest; +import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; import org.broadinstitute.sting.utils.variantcontext.Allele; import org.testng.Assert; import org.testng.annotations.BeforeClass; @@ -45,8 +45,8 @@ import java.util.*; public class DiffableReaderUnitTest extends BaseTest { DiffEngine engine; - File vcfFile = new File(testDir + "diffTestMaster.vcf"); - File bamFile = new File(testDir + "exampleBAM.bam"); + File vcfFile = new File(privateTestDir + "diffTestMaster.vcf"); + File bamFile = new File(publicTestDir + "exampleBAM.bam"); @BeforeClass(enabled = true) public void createDiffEngine() { @@ -97,7 +97,7 @@ public class DiffableReaderUnitTest extends BaseTest { testLeaf(rec1, "REF", Allele.create("G", true)); testLeaf(rec1, "ALT", Arrays.asList(Allele.create("A"))); testLeaf(rec1, "QUAL", 0.15); - testLeaf(rec1, "FILTER", Collections.emptySet()); + testLeaf(rec1, "FILTER", VCFConstants.PASSES_FILTERS_v4); testLeaf(rec1, "AC", "2"); testLeaf(rec1, "AF", "1.00"); testLeaf(rec1, "AN", "2"); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java index bd6af5337..b1e0d274a 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java @@ -15,7 +15,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testNoAction() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("49471b44ac165929d3ff81f98ce19063")); executeTest("test no action", spec); } @@ -23,7 +23,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testClusteredSnps() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -window 10 --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -window 10 --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("8b45895d7ae1f36b70e7fd26aa9451d3")); executeTest("test clustered SNPs", spec); } @@ -31,7 +31,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testMask1() { WalkerTestSpec spec1 = new WalkerTestSpec( - baseTestString() + " -maskName foo --mask " + testDir + "vcfexample2.vcf --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -maskName foo --mask " + privateTestDir + "vcfexample2.vcf --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("06307029f5da87ae4edd9804063a98f9")); executeTest("test mask all", spec1); } @@ -39,7 +39,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testMask2() { WalkerTestSpec spec2 = new WalkerTestSpec( - baseTestString() + " -maskName foo --mask:VCF " + testDir + "vcfMask.vcf --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -maskName foo --mask:VCF " + privateTestDir + "vcfMask.vcf --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("1fd06f6b2642685093ed36342f002b58")); executeTest("test mask some", spec2); } @@ -47,7 +47,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testMask3() { WalkerTestSpec spec3 = new WalkerTestSpec( - baseTestString() + " -maskName foo -maskExtend 10 --mask:VCF " + testDir + "vcfMask.vcf --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -maskName foo -maskExtend 10 --mask:VCF " + privateTestDir + "vcfMask.vcf --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("d8c5206d5d13477a5929fb1ae5a6bfc4")); executeTest("test mask extend", spec3); } @@ -55,7 +55,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testFilter1() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -filter 'DoC < 20 || FisherStrand > 20.0' -filterName foo --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -filter 'DoC < 20 || FisherStrand > 20.0' -filterName foo --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("a3be095e8aa75d9ef4235b9487527307")); executeTest("test filter #1", spec); } @@ -63,7 +63,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testFilter2() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -filter 'AlleleBalance < 70.0 && FisherStrand == 1.4' -filterName bar --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -filter 'AlleleBalance < 70.0 && FisherStrand == 1.4' -filterName bar --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("bd1361ddc52d73b8cd7adeb9e5c47200")); executeTest("test filter #2", spec); } @@ -71,7 +71,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testFilterWithSeparateNames() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --filterName ABF -filter 'AlleleBalance < 0.7' --filterName FSF -filter 'FisherStrand == 1.4' --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " --filterName ABF -filter 'AlleleBalance < 0.7' --filterName FSF -filter 'FisherStrand == 1.4' --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("4a43ec0285433df426ab482f88cf7ca6")); executeTest("test filter with separate names #2", spec); } @@ -79,7 +79,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testGenotypeFilters1() { WalkerTestSpec spec1 = new WalkerTestSpec( - baseTestString() + " -G_filter 'GQ == 0.60' -G_filterName foo --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -G_filter 'GQ == 0.60' -G_filterName foo --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("5ee4485a022e163645c08b9691384f67")); executeTest("test genotype filter #1", spec1); } @@ -87,7 +87,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testGenotypeFilters2() { WalkerTestSpec spec2 = new WalkerTestSpec( - baseTestString() + " -G_filter 'AF == 0.04 && isHomVar == 1' -G_filterName foo --variant " + testDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, + baseTestString() + " -G_filter 'AF == 0.04 && isHomVar == 1' -G_filterName foo --variant " + privateTestDir + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1, Arrays.asList("d0a068c8cfb0758d2a8d471383f39b68")); executeTest("test genotype filter #2", spec2); } @@ -95,7 +95,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest { @Test public void testDeletions() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " --filterExpression 'QUAL < 100' --filterName foo --variant:VCF " + testDir + "twoDeletions.vcf", 1, + baseTestString() + " --filterExpression 'QUAL < 100' --filterName foo --variant:VCF " + privateTestDir + "twoDeletions.vcf", 1, Arrays.asList("a1c02a5a90f1262e9eb3d2cad1fd08f2")); executeTest("test deletions", spec); } diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java index 477297a21..e526df1c2 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java @@ -8,7 +8,6 @@ import org.testng.annotations.Test; import java.io.File; import java.util.Arrays; import java.util.List; -import java.util.Map; // ********************************************************************************** // // Note that this class also serves as an integration test for the VariantAnnotator! // @@ -29,23 +28,23 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMultiSamplePilot1() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( baseCommand + " -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -o %s -L 1:10,022,000-10,025,000", 1, - Arrays.asList("a4c520b56f85513423c1c0204cabb5e1")); + Arrays.asList("f98c38defc8d619609399b4a3ba874e8")); executeTest("test MultiSample Pilot1", spec); } @Test public void testWithAllelesPassedIn1() { WalkerTest.WalkerTestSpec spec1 = new WalkerTest.WalkerTestSpec( - baseCommand + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + testDir + "allelesForUG.vcf -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,025,000", 1, - Arrays.asList("26ec9db9c7ad4b9a2ef25a8b1cb0d45c")); + baseCommand + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + privateTestDir + "allelesForUG.vcf -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,025,000", 1, + Arrays.asList("6f0c49b76225e2099c74015b6f79c96d")); executeTest("test MultiSample Pilot2 with alleles passed in", spec1); } @Test public void testWithAllelesPassedIn2() { WalkerTest.WalkerTestSpec spec2 = new WalkerTest.WalkerTestSpec( - baseCommand + " --output_mode EMIT_ALL_SITES --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + testDir + "allelesForUG.vcf -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,025,000", 1, - Arrays.asList("f2624782525929384d9f2c59f3c65529")); + baseCommand + " --output_mode EMIT_ALL_SITES --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + privateTestDir + "allelesForUG.vcf -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,025,000", 1, + Arrays.asList("42c4e37e0f130dc796231003638a197c")); executeTest("test MultiSample Pilot2 with alleles passed in and emitting all sites", spec2); } @@ -53,23 +52,23 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testSingleSamplePilot2() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( baseCommand + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,100,000", 1, - Arrays.asList("a71d4abbad9c31e66aeb21b1fe2cfe9a")); + Arrays.asList("736607ee529b5624a3ab5521ab9e1b35")); executeTest("test SingleSample Pilot2", spec); } @Test public void testMultipleSNPAlleles() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( - "-T UnifiedGenotyper -R " + b37KGReference + " -nosl --no_cmdline_in_header -glm BOTH --dbsnp " + b37dbSNP129 + " -I " + testDir + "multiallelic.snps.bam -o %s -L " + testDir + "multiallelic.snps.intervals", 1, - Arrays.asList("2429c0f24da57ab1a1313e807e53e48e")); + "-T UnifiedGenotyper -R " + b37KGReference + " -nosl --no_cmdline_in_header -glm BOTH --dbsnp " + b37dbSNP129 + " -I " + privateTestDir + "multiallelic.snps.bam -o %s -L " + privateTestDir + "multiallelic.snps.intervals", 1, + Arrays.asList("f33507add5d5c30448948906467dd3f3")); executeTest("test Multiple SNP alleles", spec); } @Test public void testBadRead() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( - "-T UnifiedGenotyper -R " + b37KGReference + " -nosl --no_cmdline_in_header -glm BOTH -I " + testDir + "badRead.test.bam -o %s -L 1:22753424-22753464", 1, - Arrays.asList("995c8f57d1f211e004ce81d356a80d16")); + "-T UnifiedGenotyper -R " + b37KGReference + " -nosl --no_cmdline_in_header -glm BOTH -I " + privateTestDir + "badRead.test.bam -o %s -L 1:22753424-22753464", 1, + Arrays.asList("d915535c1458733f09f82670092fcab6")); executeTest("test bad read", spec); } @@ -77,7 +76,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testReverseTrim() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + b37KGReference + " -nosl --no_cmdline_in_header -glm INDEL -I " + validationDataLocation + "CEUTrio.HiSeq.b37.chr20.10_11mb.bam -o %s -L 20:10289124 -L 20:10090289", 1, - Arrays.asList("53f60fe15ebffdf85183426b93d48b10")); + Arrays.asList("0d724551e00129730b95fd4d70faaa58")); executeTest("test reverse trim", spec); } @@ -87,7 +86,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { // // -------------------------------------------------------------------------------------------------------------- - private final static String COMPRESSED_OUTPUT_MD5 = "65846f5a8591d591ffbd1f85afadd9d5"; + private final static String COMPRESSED_OUTPUT_MD5 = "fe3429b736c50bb770e40c0320d498ed"; @Test public void testCompressedOutput() { @@ -108,7 +107,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { // Note that we need to turn off any randomization for this to work, so no downsampling and no annotations - String md5 = "36e6c8b0f30b159915eedaa5926ebbad"; + String md5 = "306943dd63111e2e64388cd2e2de6c01"; WalkerTest.WalkerTestSpec spec1 = new WalkerTest.WalkerTestSpec( baseCommand + " -dt NONE -G none -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,075,000", 1, @@ -140,7 +139,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMinBaseQualityScore() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( baseCommand + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,010,000 --min_base_quality_score 26", 1, - Arrays.asList("efc4882c1150b246be163e08d81f428f")); + Arrays.asList("b341b87742848a3224115fe94e73f244")); executeTest("test min_base_quality_score 26", spec); } @@ -148,7 +147,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testSLOD() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + b36KGReference + " --no_cmdline_in_header -glm BOTH --dbsnp " + b36dbSNP129 + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,010,000", 1, - Arrays.asList("b47b08b514acf5e96fb4994754e0e9ce")); + Arrays.asList("acb5332a267927d78edd51d93685111c")); executeTest("test SLOD", spec); } @@ -156,7 +155,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testNDA() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( baseCommand + " --annotateNDA -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,010,000", 1, - Arrays.asList("08db1413ed6a04fcb03d58e3ece9f366")); + Arrays.asList("74779b59730962bdf36a7a8ef84ac24d")); executeTest("test NDA", spec); } @@ -164,23 +163,23 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testCompTrack() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + b36KGReference + " --no_cmdline_in_header -glm BOTH -comp:FOO " + b36dbSNP129 + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,010,000", 1, - Arrays.asList("d78f95c225db2a4b21c99a688330df52")); + Arrays.asList("036edf58a4ed6c626f53bd2ab34b9f97")); executeTest("test using comp track", spec); } @Test public void testOutputParameterSitesOnly() { - testOutputParameters("-sites_only", "1e4a98213ec00479cc090f53620317e4"); + testOutputParameters("-sites_only", "52b8336f347d182c158e8384b78f5a6d"); } @Test public void testOutputParameterAllConfident() { - testOutputParameters("--output_mode EMIT_ALL_CONFIDENT_SITES", "5580e3e7c2b358ed416bc03409c54c1d"); + testOutputParameters("--output_mode EMIT_ALL_CONFIDENT_SITES", "281363e6afb3260143bfdb22710e3d0e"); } @Test public void testOutputParameterAllSites() { - testOutputParameters("--output_mode EMIT_ALL_SITES", "23ab7f15a01dd6dbf9f09a7560a2055b"); + testOutputParameters("--output_mode EMIT_ALL_SITES", "a802b672850b6fbc2764611d3ad071d9"); } private void testOutputParameters(final String args, final String md5) { @@ -194,7 +193,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testConfidence() { WalkerTest.WalkerTestSpec spec1 = new WalkerTest.WalkerTestSpec( baseCommand + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,010,000 -stand_call_conf 10 ", 1, - Arrays.asList("87c55fece67a562d208c538868307d7b")); + Arrays.asList("99ef7ba1747c7289ce1f963130539e18")); executeTest("test confidence 1", spec1); } @@ -202,7 +201,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testConfidence2() { WalkerTest.WalkerTestSpec spec2 = new WalkerTest.WalkerTestSpec( baseCommand + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,010,000 -stand_emit_conf 10 ", 1, - Arrays.asList("87c55fece67a562d208c538868307d7b")); + Arrays.asList("99ef7ba1747c7289ce1f963130539e18")); executeTest("test confidence 2", spec2); } @@ -213,12 +212,12 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { // -------------------------------------------------------------------------------------------------------------- @Test public void testHeterozyosity1() { - testHeterozosity( 0.01, "481b17c5541f758a49f84263e5b0f795" ); + testHeterozosity( 0.01, "7e1681b9052e357ca4a065fa76c8afb6" ); } @Test public void testHeterozyosity2() { - testHeterozosity( 1.0 / 1850, "70ad4b50a22de917eb91a95ca191eb17" ); + testHeterozosity( 1.0 / 1850, "68a12f3eccac6cf4b27b6424f23628ee" ); } private void testHeterozosity(final double arg, final String md5) { @@ -242,7 +241,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { " -o %s" + " -L 1:10,000,000-10,100,000", 1, - Arrays.asList("3d20dbf7912e49cdfa929eb04840d351")); + Arrays.asList("b098a7744a448cf91a50886e4cc7d268")); executeTest(String.format("test multiple technologies"), spec); } @@ -261,7 +260,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { " -L 1:10,000,000-10,100,000" + " -baq CALCULATE_AS_NECESSARY", 1, - Arrays.asList("0b141419428831b598813272cb7af055")); + Arrays.asList("2f008169b82d542ec9cc94908c395a0f")); executeTest(String.format("test calling with BAQ"), spec); } @@ -280,7 +279,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { " -o %s" + " -L 1:10,000,000-10,500,000", 1, - Arrays.asList("9a54f9f820efa74e5a719e5ca44bc04d")); + Arrays.asList("0d4177d7f963f4b4e8568613e7a468f0")); executeTest(String.format("test indel caller in SLX"), spec); } @@ -295,7 +294,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { " -minIndelCnt 1" + " -L 1:10,000,000-10,100,000", 1, - Arrays.asList("7f6c4e55b8e77c19199e8ad8b3594280")); + Arrays.asList("1268bde77842e6bb6a4f337c1d589f4d")); executeTest(String.format("test indel caller in SLX with low min allele count"), spec); } @@ -308,7 +307,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { " -o %s" + " -L 1:10,000,000-10,500,000", 1, - Arrays.asList("7ef98a593945f0269ac2d29982a2a72b")); + Arrays.asList("181c4ed8dd084b83f8de92123bb85c41")); executeTest(String.format("test indel calling, multiple technologies"), spec); } @@ -316,9 +315,9 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { @Test public void testWithIndelAllelesPassedIn1() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( - baseCommandIndels + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + testDir + "indelAllelesForUG.vcf -I " + validationDataLocation + + baseCommandIndels + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + privateTestDir + "indelAllelesForUG.vcf -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,100,000", 1, - Arrays.asList("656185ebade2db034441c787d6a363c1")); + Arrays.asList("5250cefb1fff262a6a3985dee29c154d")); executeTest("test MultiSample Pilot2 indels with alleles passed in", spec); } @@ -326,9 +325,9 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testWithIndelAllelesPassedIn2() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( baseCommandIndels + " --output_mode EMIT_ALL_SITES --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " - + testDir + "indelAllelesForUG.vcf -I " + validationDataLocation + + + privateTestDir + "indelAllelesForUG.vcf -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,100,000", 1, - Arrays.asList("eb9624642e814a0b8962acc89422be23")); + Arrays.asList("c9b468fe75e7215a6d6d5a050af07918")); executeTest("test MultiSample Pilot2 indels with alleles passed in and emitting all sites", spec); } @@ -336,7 +335,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMultiSampleIndels1() { WalkerTest.WalkerTestSpec spec1 = new WalkerTest.WalkerTestSpec( baseCommandIndels + " -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -o %s -L 1:10450700-10551000", 1, - Arrays.asList("e7b471d2a0eada2c7f37f120f2f1fa88")); + Arrays.asList("01fd223deb4f88fb7d9ee9736b664d8a")); List result = executeTest("test MultiSample Pilot1 CEU indels", spec1).getFirst(); WalkerTest.WalkerTestSpec spec2 = new WalkerTest.WalkerTestSpec( @@ -350,9 +349,9 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testGGAwithNoEvidenceInReads() { final String vcf = "small.indel.test.vcf"; WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( - baseCommandIndelsb37 + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -out_mode EMIT_ALL_SITES -alleles " + testDir + vcf + " -I " + validationDataLocation + + baseCommandIndelsb37 + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -out_mode EMIT_ALL_SITES -alleles " + privateTestDir + vcf + " -I " + validationDataLocation + "NA12878.HiSeq.WGS.bwa.cleaned.recal.hg19.20.bam -o %s -L " + validationDataLocation + vcf, 1, - Arrays.asList("e362dc0488c8ee3013fa636d929db688")); + Arrays.asList("db0f91abb901e097714d8755058e1319")); executeTest("test GENOTYPE_GIVEN_ALLELES with no evidence in reads", spec); } @@ -385,7 +384,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMinIndelFraction0() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( assessMinIndelFraction + " -minIndelFrac 0.0", 1, - Arrays.asList("3c9786453eb59013c70d99ee74f957a9")); + Arrays.asList("25465c6dd3c4845f61b0f8e383388824")); executeTest("test minIndelFraction 0.0", spec); } @@ -393,7 +392,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMinIndelFraction25() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( assessMinIndelFraction + " -minIndelFrac 0.25", 1, - Arrays.asList("72b82f04dd7f9b9318ef7f8604f8085a")); + Arrays.asList("aa58dc9f77132c30363562bcdc321f6e")); executeTest("test minIndelFraction 0.25", spec); } @@ -401,7 +400,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMinIndelFraction100() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( assessMinIndelFraction + " -minIndelFrac 1", 1, - Arrays.asList("0e9f485edabbed613e50c699cfa8822f")); + Arrays.asList("3f07efb768e08650a7ce333edd4f9a52")); executeTest("test minIndelFraction 1.0", spec); } } diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java index 06c48c8ba..e6468e261 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java @@ -44,7 +44,7 @@ public class RealignerTargetCreatorIntegrationTest extends WalkerTest { @Test public void testKnownsOnly() { WalkerTest.WalkerTestSpec spec3 = new WalkerTest.WalkerTestSpec( - "-T RealignerTargetCreator -R " + b36KGReference + " --known " + testDir + "NA12878.chr1_10mb_11mb.slx.indels.vcf4 -L " + testDir + "NA12878.chr1_10mb_11mb.slx.indels.vcf4 -o %s", + "-T RealignerTargetCreator -R " + b36KGReference + " --known " + privateTestDir + "NA12878.chr1_10mb_11mb.slx.indels.vcf4 -L " + privateTestDir + "NA12878.chr1_10mb_11mb.slx.indels.vcf4 -o %s", 1, Arrays.asList("5206cee6c01b299417bf2feeb8b3dc96")); executeTest("test rods only", spec3); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java index 83e8153c2..b3c85622e 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java @@ -6,7 +6,7 @@ import org.testng.annotations.Test; import java.util.Arrays; public class PhaseByTransmissionIntegrationTest extends WalkerTest { - private static String phaseByTransmissionTestDataRoot = testDir + "PhaseByTransmission/"; + private static String phaseByTransmissionTestDataRoot = privateTestDir + "PhaseByTransmission/"; private static String goodFamilyFile = phaseByTransmissionTestDataRoot + "PhaseByTransmission.IntegrationTest.goodFamilies.ped"; private static String TNTest = phaseByTransmissionTestDataRoot + "PhaseByTransmission.IntegrationTest.TN.vcf"; private static String TPTest = phaseByTransmissionTestDataRoot + "PhaseByTransmission.IntegrationTest.TP.vcf"; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java index f0fb01892..bb4b7a1be 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java @@ -11,7 +11,7 @@ public class ReadBackedPhasingIntegrationTest extends WalkerTest { return "-T ReadBackedPhasing" + " -R " + reference + " -I " + validationDataLocation + reads + - " --variant " + ( VCF.contains("phasing_test") ? testDir : validationDataLocation) + VCF + + " --variant " + ( VCF.contains("phasing_test") ? privateTestDir : validationDataLocation) + VCF + " --cacheWindowSize " + cacheWindowSize + " --maxPhaseSites " + maxPhaseSites + " --phaseQualityThresh " + phaseQualityThresh + diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/recalibration/RecalibrationWalkersIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/recalibration/RecalibrationWalkersIntegrationTest.java index d93b7c4d9..04c7caf5d 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/recalibration/RecalibrationWalkersIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/recalibration/RecalibrationWalkersIntegrationTest.java @@ -271,7 +271,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + - " -knownSites:anyNameABCD,VCF " + testDir + "vcfexample3.vcf" + + " -knownSites:anyNameABCD,VCF " + privateTestDir + "vcfexample3.vcf" + " -T CountCovariates" + " -I " + bam + " -knownSites " + b36dbSNP129 + diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java index caa09fdb6..7a849a819 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java @@ -17,8 +17,8 @@ public class ValidationAmpliconsIntegrationTest extends WalkerTest { @Test(enabled=true) public void testWikiExample() { String siteVCF = validationDataLocation + "sites_to_validate.vcf"; - String maskVCF = testDir + "amplicon_mask_sites.vcf"; - String intervalTable = testDir + "amplicon_interval_table1.table"; + String maskVCF = privateTestDir + "amplicon_mask_sites.vcf"; + String intervalTable = privateTestDir + "amplicon_interval_table1.table"; String testArgs = "-R " + b37KGReference + " -T ValidationAmplicons --ValidateAlleles:VCF "+siteVCF+" -o %s"; testArgs += " --ProbeIntervals:table "+intervalTable+" -L:table "+intervalTable+" --MaskAlleles:VCF "+maskVCF; testArgs += " --virtualPrimerSize 30"; @@ -29,9 +29,9 @@ public class ValidationAmpliconsIntegrationTest extends WalkerTest { @Test(enabled=true) public void testWikiExampleNoBWA() { - String siteVCF = testDir + "sites_to_validate.vcf"; - String maskVCF = testDir + "amplicon_mask_sites.vcf"; - String intervalTable = testDir + "amplicon_interval_table1.table"; + String siteVCF = privateTestDir + "sites_to_validate.vcf"; + String maskVCF = privateTestDir + "amplicon_mask_sites.vcf"; + String intervalTable = privateTestDir + "amplicon_interval_table1.table"; String testArgs = "-R " + b37KGReference + " -T ValidationAmplicons --ValidateAlleles:VCF "+siteVCF+" -o %s"; testArgs += " --ProbeIntervals:table "+intervalTable+" -L:table "+intervalTable+" --MaskAlleles:VCF "+maskVCF; testArgs += " --virtualPrimerSize 30 --doNotUseBWA"; @@ -42,9 +42,9 @@ public class ValidationAmpliconsIntegrationTest extends WalkerTest { @Test(enabled=true) public void testWikiExampleMonoFilter() { - String siteVCF = testDir + "sites_to_validate.vcf"; - String maskVCF = testDir + "amplicon_mask_sites.vcf"; - String intervalTable = testDir + "amplicon_interval_table1.table"; + String siteVCF = privateTestDir + "sites_to_validate.vcf"; + String maskVCF = privateTestDir + "amplicon_mask_sites.vcf"; + String intervalTable = privateTestDir + "amplicon_interval_table1.table"; String testArgs = "-R " + b37KGReference + " -T ValidationAmplicons --ValidateAlleles:VCF "+siteVCF+" -o %s"; testArgs += " --ProbeIntervals:table "+intervalTable+" -L:table "+intervalTable+" --MaskAlleles:VCF "+maskVCF; testArgs += " --virtualPrimerSize 30 --filterMonomorphic"; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java index 27ce5f408..43812d12d 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java @@ -303,7 +303,7 @@ public class VariantEvalIntegrationTest extends WalkerTest { String tests = cmdRoot + " --dbsnp " + b36dbSNP129 + " --eval " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.vcf" + - " --comp:comp_genotypes " + testDir + "yri.trio.gatk.ug.head.vcf"; + " --comp:comp_genotypes " + privateTestDir + "yri.trio.gatk.ug.head.vcf"; WalkerTestSpec spec = new WalkerTestSpec(withSelect(tests, "DP < 50", "DP50") + " " + extraArgs + " -ST CpG -o %s", 1, Arrays.asList("4b9dcbce0717285e3c0c736c1bed744c")); executeTestParallel("testSelect1", spec); @@ -343,7 +343,7 @@ public class VariantEvalIntegrationTest extends WalkerTest { @Test(enabled = false) // no longer supported in the GATK public void testTranches() { - String extraArgs = "-T VariantEval -R "+ hg18Reference +" --eval " + validationDataLocation + "GA2.WEx.cleaned.ug.snpfiltered.indelfiltered.optimized.vcf -o %s -EV TiTvVariantEvaluator -L chr1 -noEV -ST CpG -tf " + testDir + "tranches.6.txt"; + String extraArgs = "-T VariantEval -R "+ hg18Reference +" --eval " + validationDataLocation + "GA2.WEx.cleaned.ug.snpfiltered.indelfiltered.optimized.vcf -o %s -EV TiTvVariantEvaluator -L chr1 -noEV -ST CpG -tf " + privateTestDir + "tranches.6.txt"; WalkerTestSpec spec = new WalkerTestSpec(extraArgs,1,Arrays.asList("6af2b9959aa1778a5b712536de453952")); executeTestParallel("testTranches",spec); } @@ -530,11 +530,11 @@ public class VariantEvalIntegrationTest extends WalkerTest { buildCommandLine( "-T VariantEval", "-R " + b37KGReference, - "-eval " + testDir + "/withSymbolic.b37.vcf", + "-eval " + privateTestDir + "/withSymbolic.b37.vcf", "-noEV", "-EV CountVariants", "-noST", - "-stratIntervals " + testDir + "/overlapTest.bed", + "-stratIntervals " + privateTestDir + "/overlapTest.bed", "-ST IntervalStratification", "-L 20", "-o %s" @@ -602,7 +602,7 @@ public class VariantEvalIntegrationTest extends WalkerTest { buildCommandLine( "-T VariantEval", "-R " + b37KGReference, - "-eval " + testDir + "/ac0.vcf", + "-eval " + privateTestDir + "/ac0.vcf", "-L 20:81006 -noST -noEV -EV VariantSummary -o %s" + (includeAC0 ? " -keepAC0" : "") ), 1, diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java index eece0ff39..42181aae6 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java @@ -45,10 +45,10 @@ public final class VariantGaussianMixtureModelUnitTest extends BaseTest { private static int N_VARIANTS = 100; VariantDatum[] variantData1 = new VariantDatum[N_VARIANTS]; - private final File QUAL_DATA = new File(testDir + "tranches.raw.dat"); + private final File QUAL_DATA = new File(privateTestDir + "tranches.raw.dat"); private final double[] TRUTH_SENSITIVITY_CUTS = new double[]{99.9, 99.0, 97.0, 95.0}; - private final File EXPECTED_TRANCHES_NEW = new File(testDir + "tranches.6.txt"); - private final File EXPECTED_TRANCHES_OLD = new File(testDir + "tranches.4.txt"); + private final File EXPECTED_TRANCHES_NEW = new File(privateTestDir + "tranches.6.txt"); + private final File EXPECTED_TRANCHES_OLD = new File(privateTestDir + "tranches.4.txt"); private ArrayList readData() { ArrayList vd = new ArrayList(); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java index 239c2fac8..eed819c95 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java @@ -1,6 +1,5 @@ package org.broadinstitute.sting.gatk.walkers.variantrecalibration; -import org.broadinstitute.sting.MD5DB; import org.broadinstitute.sting.WalkerTest; import org.testng.annotations.Test; import org.testng.annotations.DataProvider; @@ -129,10 +128,10 @@ public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest { " -L 20:1000100-1000500" + " -mode BOTH" + " --no_cmdline_in_header" + - " -input " + testDir + "VQSR.mixedTest.input" + + " -input " + privateTestDir + "VQSR.mixedTest.input" + " -o %s" + - " -tranchesFile " + testDir + "VQSR.mixedTest.tranches" + - " -recalFile " + testDir + "VQSR.mixedTest.recal", + " -tranchesFile " + privateTestDir + "VQSR.mixedTest.tranches" + + " -recalFile " + privateTestDir + "VQSR.mixedTest.recal", Arrays.asList("beadf841bbf39c3f0d0bc7fb55462b37")); executeTest("testApplyRecalibrationSnpAndIndelTogether", spec); } diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java index b4ff275d8..b11c16c6f 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java @@ -34,8 +34,23 @@ import java.util.Arrays; * Tests CombineVariants */ public class CombineVariantsIntegrationTest extends WalkerTest { - public static String baseTestString(String args) { - return "-T CombineVariants --no_cmdline_in_header -L 1:1-50,000,000 -o %s -R " + b36KGReference + args; + // + // TODO TODO TODO TODO TODO TODO TODO TODO + // TODO TODO TODO TODO TODO TODO TODO TODO + // + // TODO WHEN THE HC EMITS VALID VCF HEADERS ENABLE BCF AND REMOVE allowMissingVCFHeaders ARGUMENTS + // + // TODO TODO TODO TODO TODO TODO TODO TODO + // TODO TODO TODO TODO TODO TODO TODO TODO + // TODO TODO TODO TODO TODO TODO TODO TODO + // + private static String baseTestString(String args) { + return "-T CombineVariants --no_cmdline_in_header -L 1:1-50,000,000 -o %s --allowMissingVCFHeaders -R " + b36KGReference + args; + } + + private void cvExecuteTest(final String name, final WalkerTestSpec spec) { + spec.disableShadowBCF(); + executeTest(name, spec); } public void test1InOut(String file, String md5) { @@ -47,7 +62,7 @@ public class CombineVariantsIntegrationTest extends WalkerTest { baseTestString(" -priority v1 -V:v1 " + validationDataLocation + file + args), 1, Arrays.asList(md5)); - executeTest("testInOut1--" + file, spec); + cvExecuteTest("testInOut1--" + file, spec); } public void combine2(String file1, String file2, String args, String md5) { @@ -55,7 +70,7 @@ public class CombineVariantsIntegrationTest extends WalkerTest { baseTestString(" -priority v1,v2 -V:v1 " + validationDataLocation + file1 + " -V:v2 "+ validationDataLocation + file2 + args), 1, Arrays.asList(md5)); - executeTest("combine2 1:" + new File(file1).getName() + " 2:" + new File(file2).getName(), spec); + cvExecuteTest("combine2 1:" + new File(file1).getName() + " 2:" + new File(file2).getName(), spec); } public void combineSites(String args, String md5) { @@ -67,15 +82,15 @@ public class CombineVariantsIntegrationTest extends WalkerTest { + " -V:hm3 " + validationDataLocation + file2 + args, 1, Arrays.asList(md5)); - executeTest("combineSites 1:" + new File(file1).getName() + " 2:" + new File(file2).getName() + " args = " + args, spec); + cvExecuteTest("combineSites 1:" + new File(file1).getName() + " 2:" + new File(file2).getName() + " args = " + args, spec); } public void combinePLs(String file1, String file2, String md5) { WalkerTestSpec spec = new WalkerTestSpec( - "-T CombineVariants --no_cmdline_in_header -o %s -R " + b36KGReference + " -priority v1,v2 -V:v1 " + testDir + file1 + " -V:v2 " + testDir + file2, + "-T CombineVariants --no_cmdline_in_header -o %s -R " + b36KGReference + " -priority v1,v2 -V:v1 " + privateTestDir + file1 + " -V:v2 " + privateTestDir + file2, 1, Arrays.asList(md5)); - executeTest("combine PLs 1:" + new File(file1).getName() + " 2:" + new File(file2).getName(), spec); + cvExecuteTest("combine PLs 1:" + new File(file1).getName() + " 2:" + new File(file2).getName(), spec); } @Test public void test1SNP() { test1InOut("pilot2.snps.vcf4.genotypes.vcf", "6469fce8a5cd5a0f77e5ac5d9e9e192b"); } @@ -86,7 +101,7 @@ public class CombineVariantsIntegrationTest extends WalkerTest { @Test public void test1Indel1() { test1InOut("CEU.dindel.vcf4.trio.2010_06.indel.genotypes.vcf", "ef2d249ea4b25311966e038aac05c661"); } @Test public void test1Indel2() { test1InOut("CEU.dindel.vcf4.low_coverage.2010_06.indel.genotypes.vcf", "cdb448aaa92ca5a9e393d875b42581b3"); } - @Test public void combineWithPLs() { combinePLs("combine.3.vcf", "combine.4.vcf", "284083f60792c5f817899445dfa63a42"); } + @Test public void combineWithPLs() { combinePLs("combine.3.vcf", "combine.4.vcf", "f0ce3fb83d4ad9ba402d7cb11cd000c3"); } @Test public void combineTrioCalls() { combine2("CEU.trio.2010_03.genotypes.vcf.gz", "YRI.trio.2010_03.genotypes.vcf.gz", "", "4efdf983918db822e4ac13d911509576"); } // official project VCF files in tabix format @Test public void combineTrioCallsMin() { combine2("CEU.trio.2010_03.genotypes.vcf.gz", "YRI.trio.2010_03.genotypes.vcf.gz", " -minimalVCF", "848d4408ee953053d2307cefebc6bd6d"); } // official project VCF files in tabix format @@ -111,7 +126,7 @@ public class CombineVariantsIntegrationTest extends WalkerTest { " -genotypeMergeOptions UNIQUIFY -L 1"), 1, Arrays.asList("c0d4d601aa5d2b29927c535868448d2a")); - executeTest("threeWayWithRefs", spec); + cvExecuteTest("threeWayWithRefs", spec); } // complex examples with filtering, indels, and multiple alleles @@ -120,17 +135,17 @@ public class CombineVariantsIntegrationTest extends WalkerTest { String file2 = "combine.2.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T CombineVariants --no_cmdline_in_header -o %s -R " + b37KGReference - + " -V:one " + testDir + file1 - + " -V:two " + testDir + file2 + args, + + " -V:one " + privateTestDir + file1 + + " -V:two " + privateTestDir + file2 + args, 1, Arrays.asList(md5)); - executeTest("combineComplexSites 1:" + new File(file1).getName() + " 2:" + new File(file2).getName() + " args = " + args, spec); + cvExecuteTest("combineComplexSites 1:" + new File(file1).getName() + " 2:" + new File(file2).getName() + " args = " + args, spec); } - @Test public void complexTestFull() { combineComplexSites("", "7d587bf49bbc9f8239476bab84bf9708"); } - @Test public void complexTestMinimal() { combineComplexSites(" -minimalVCF", "4d1e0c12d95f50e472493fc14af3cc06"); } - @Test public void complexTestSitesOnly() { combineComplexSites(" -sites_only", "9a98b01b9b2a28ae6af3125edc131dea"); } - @Test public void complexTestSitesOnlyMinimal() { combineComplexSites(" -sites_only -minimalVCF", "9a98b01b9b2a28ae6af3125edc131dea"); } + @Test public void complexTestFull() { combineComplexSites("", "8b19b54516b59de40992f0c4b328258a"); } + @Test public void complexTestMinimal() { combineComplexSites(" -minimalVCF", "a38dd097adc37420fe36ef8be14cfded"); } + @Test public void complexTestSitesOnly() { combineComplexSites(" -sites_only", "a3957dac9a617f50ce2668607e3baef0"); } + @Test public void complexTestSitesOnlyMinimal() { combineComplexSites(" -sites_only -minimalVCF", "a3957dac9a617f50ce2668607e3baef0"); } @Test public void combineDBSNPDuplicateSites() { @@ -138,6 +153,6 @@ public class CombineVariantsIntegrationTest extends WalkerTest { "-T CombineVariants --no_cmdline_in_header -L 1:902000-903000 -o %s -R " + b37KGReference + " -V:v1 " + b37dbSNP132, 1, Arrays.asList("3d2a5a43db86e3f6217ed2a63251285b")); - executeTest("combineDBSNPDuplicateSites:", spec); + cvExecuteTest("combineDBSNPDuplicateSites:", spec); } } \ No newline at end of file diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java index 76b31ecfc..c79c5449a 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java @@ -38,7 +38,7 @@ public class LeftAlignVariantsIntegrationTest extends WalkerTest { @Test public void testLeftAlignment() { WalkerTestSpec spec = new WalkerTestSpec( - "-T LeftAlignVariants -o %s -R " + b37KGReference + " --variant:vcf " + testDir + "forLeftAlignVariantsTest.vcf --no_cmdline_in_header", + "-T LeftAlignVariants -o %s -R " + b37KGReference + " --variant:vcf " + privateTestDir + "forLeftAlignVariantsTest.vcf --no_cmdline_in_header", 1, Arrays.asList("bcf05f56adbb32a47b6d6b27b327d5c2")); executeTest("test left alignment", spec); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java index e44d47438..c7dd2e60f 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java @@ -38,7 +38,7 @@ public class LiftoverVariantsIntegrationTest extends WalkerTest { @Test public void testb36Tohg19() { WalkerTestSpec spec = new WalkerTestSpec( - "-T LiftoverVariants -o %s -R " + b36KGReference + " --variant " + testDir + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict", + "-T LiftoverVariants -o %s -R " + b36KGReference + " --variant " + privateTestDir + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict", 1, Arrays.asList("b8f4171b0c39954b283dfed4afed87d7")); executeTest("test b36 to hg19", spec); @@ -47,16 +47,16 @@ public class LiftoverVariantsIntegrationTest extends WalkerTest { @Test public void testb36Tohg19UnsortedSamples() { WalkerTestSpec spec = new WalkerTestSpec( - "-T LiftoverVariants -o %s -R " + b36KGReference + " --variant " + testDir + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.unsortedSamples.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict", + "-T LiftoverVariants -o %s -R " + b36KGReference + " --variant " + privateTestDir + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.unsortedSamples.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict", 1, - Arrays.asList("07d1bf52125d1f9a25e260e13ec7b010")); + Arrays.asList("2fd072a88006e3d7cfea4cac5d7b0d98")); executeTest("test b36 to hg19, unsorted samples", spec); } @Test public void testhg18Tohg19Unsorted() { WalkerTestSpec spec = new WalkerTestSpec( - "-T LiftoverVariants -o %s -R " + hg18Reference + " --variant:vcf " + testDir + "liftover_test.vcf -chain " + validationDataLocation + "hg18ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict", + "-T LiftoverVariants -o %s -R " + hg18Reference + " --variant:vcf " + privateTestDir + "liftover_test.vcf -chain " + validationDataLocation + "hg18ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict", 1, Arrays.asList("e0b813ff873185ab51995a151f80ec98")); executeTest("test hg18 to hg19, unsorted", spec); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java index 1288e97d7..d7792f69c 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java @@ -13,7 +13,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testDiscordanceNoSampleSpecified() { - String testFile = testDir + "NA12878.hg19.example1.vcf"; + String testFile = privateTestDir + "NA12878.hg19.example1.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + hg19Reference + " -L 20:1012700-1020000 --variant " @@ -29,7 +29,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testRepeatedLineSelection() { - String testfile = testDir + "test.dup.vcf"; + String testfile = privateTestDir + "test.dup.vcf"; WalkerTestSpec spec = new WalkerTestSpec( baseTestString(" -sn A -sn B -sn C --variant " + testfile), @@ -42,7 +42,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testDiscordance() { - String testFile = testDir + "NA12878.hg19.example1.vcf"; + String testFile = privateTestDir + "NA12878.hg19.example1.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 --variant " @@ -88,14 +88,14 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testConcordance() { - String testFile = testDir + "NA12878.hg19.example1.vcf"; + String testFile = privateTestDir + "NA12878.hg19.example1.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 -conc " + b37hapmapGenotypes + " --variant " + testFile + " -o %s --no_cmdline_in_header --allowMissingVCFHeaders", 1, - Arrays.asList("7d2c7deeacf307d140a85a34629c6539") + Arrays.asList("25b3a8fd7b62b035c9d7c090db3c682d") ); spec.disableShadowBCF(); @@ -104,7 +104,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testVariantTypeSelection() { - String testFile = testDir + "complexExample1.vcf"; + String testFile = privateTestDir + "complexExample1.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + b36KGReference + " -restrictAllelesTo MULTIALLELIC -selectType MIXED --variant " + testFile + " -o %s --no_cmdline_in_header", @@ -117,7 +117,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testUsingDbsnpName() { - String testFile = testDir + "combine.3.vcf"; + String testFile = privateTestDir + "combine.3.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + b36KGReference + " -sn NA12892 --variant:dbsnp " + testFile + " -o %s --no_cmdline_in_header", @@ -130,7 +130,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testRegenotype() { - String testFile = testDir + "combine.3.vcf"; + String testFile = privateTestDir + "combine.3.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + b36KGReference + " -regenotype -sn NA12892 --variant " + testFile + " -o %s --no_cmdline_in_header", @@ -143,7 +143,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testMultipleRecordsAtOnePosition() { - String testFile = testDir + "selectVariants.onePosition.vcf"; + String testFile = privateTestDir + "selectVariants.onePosition.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + b36KGReference + " -select 'KG_FREQ < 0.5' --variant " + testFile + " -o %s --no_cmdline_in_header", @@ -156,7 +156,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testNoGTs() { - String testFile = testDir + "vcf4.1.example.vcf"; + String testFile = privateTestDir + "vcf4.1.example.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + b37KGReference + " --variant " + testFile + " -o %s --no_cmdline_in_header", @@ -199,8 +199,8 @@ public class SelectVariantsIntegrationTest extends WalkerTest { @Test public void testSelectFromMultiAllelic() { - String testfile = testDir + "multi-allelic.bi-allelicInGIH.vcf"; - String samplesFile = testDir + "GIH.samples.list"; + String testfile = privateTestDir + "multi-allelic.bi-allelicInGIH.vcf"; + String samplesFile = privateTestDir + "GIH.samples.list"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants -R " + b37KGReference + " -o %s --no_cmdline_in_header -sf " + samplesFile + " --excludeNonVariants --variant " + testfile, 1, @@ -220,7 +220,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest { } private void testFileWithoutInfoLineInHeader(final String name, final Class expectedException) { - final String testFile = testDir + "missingHeaderLine.vcf"; + final String testFile = privateTestDir + "missingHeaderLine.vcf"; final String cmd = "-T SelectVariants -R " + b36KGReference + " -sn NA12892 --variant:dbsnp " + testFile + " -o %s --no_cmdline_in_header" + (expectedException == null ? " -allowMissingVCFHeaders" : ""); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java index cd6fda282..312f827c1 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java @@ -46,7 +46,7 @@ public class VCFStreamingIntegrationTest extends WalkerTest { // Copy VCF data from the test file into the FIFO. - String testFile = testDir + "yri.trio.gatk.ug.head.vcf"; + String testFile = privateTestDir + "yri.trio.gatk.ug.head.vcf"; FileInputStream inputStream = new FileInputStream(testFile); FileOutputStream outputStream = new FileOutputStream(tmpFifo); outputStream.getChannel().transferFrom(inputStream.getChannel(),0,inputStream.getChannel().size()); @@ -74,7 +74,7 @@ public class VCFStreamingIntegrationTest extends WalkerTest { File tmpFifo = File.createTempFile("vcfstreaming",""); Runtime.getRuntime().exec(new String[] {"mkfifo",tmpFifo.getAbsolutePath()}); - String testFile = testDir + "yri.trio.gatk.ug.head.vcf"; + String testFile = privateTestDir + "yri.trio.gatk.ug.head.vcf"; // Output select to FIFO WalkerTestSpec selectTestSpec = new WalkerTestSpec( diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java index 39945a9b7..3277f5060 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java @@ -34,7 +34,7 @@ import java.util.Arrays; public class ValidateVariantsIntegrationTest extends WalkerTest { public static String baseTestString(String file, String type) { - return "-T ValidateVariants -R " + b36KGReference + " -L 1:10001292-10001303 --variant:vcf " + testDir + file + " --validationType " + type; + return "-T ValidateVariants -R " + b36KGReference + " -L 1:10001292-10001303 --variant:vcf " + privateTestDir + file + " --validationType " + type; } @Test diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java index 02c9e293d..2ffcd02e2 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java @@ -33,7 +33,7 @@ import java.util.*; public class VariantsToTableIntegrationTest extends WalkerTest { private String variantsToTableCmd(String moreArgs) { return "-R " + hg18Reference + - " --variant:vcf " + testDir + "soap_gatk_annotated.vcf" + + " --variant:vcf " + privateTestDir + "soap_gatk_annotated.vcf" + " -T VariantsToTable" + " -F CHROM -F POS -F ID -F REF -F ALT -F QUAL -F FILTER -F TRANSITION -F DP -F SB -F set -F RankSumP -F refseq.functionalClass*" + " -L chr1 -o %s" + moreArgs; @@ -41,7 +41,7 @@ public class VariantsToTableIntegrationTest extends WalkerTest { private String variantsToTableMultiAllelicCmd(String moreArgs) { return "-R " + b37KGReference + - " --variant " + testDir + "multiallelic.vcf" + + " --variant " + privateTestDir + "multiallelic.vcf" + " -T VariantsToTable" + " -F CHROM -F POS -F ID -F REF -F ALT -F QUAL -F MULTI-ALLELIC -F AC -F AF" + " -o %s" + moreArgs; @@ -78,7 +78,7 @@ public class VariantsToTableIntegrationTest extends WalkerTest { public void testGenotypeFields() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + - " --variant " + testDir + "vcfexample2.vcf" + + " --variant " + privateTestDir + "vcfexample2.vcf" + " -T VariantsToTable" + " -GF RD" + " -o %s", @@ -91,7 +91,7 @@ public class VariantsToTableIntegrationTest extends WalkerTest { public void testGenotypeFieldsWithInline() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + - " --variant " + testDir + "vcfexample2.vcf" + + " --variant " + privateTestDir + "vcfexample2.vcf" + " -T VariantsToTable" + " -GF RD -GF GT -GF GQ" + " -o %s", @@ -104,7 +104,7 @@ public class VariantsToTableIntegrationTest extends WalkerTest { public void testMoltenOutput() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + - " --variant " + testDir + "vcfexample2.vcf" + + " --variant " + privateTestDir + "vcfexample2.vcf" + " -T VariantsToTable" + " -F CHROM -F POS -F ID -F REF -F ALT -F QUAL -F FILTER" + " --moltenize" + @@ -118,7 +118,7 @@ public class VariantsToTableIntegrationTest extends WalkerTest { public void testMoltenOutputWithGenotypeFields() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + - " --variant " + testDir + "vcfexample2.vcf" + + " --variant " + privateTestDir + "vcfexample2.vcf" + " -T VariantsToTable" + " -GF RD" + " --moltenize" + @@ -132,7 +132,7 @@ public class VariantsToTableIntegrationTest extends WalkerTest { public void testMoltenOutputWithMultipleAlleles() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b37KGReference + - " --variant " + testDir + "multiallelic.vcf" + + " --variant " + privateTestDir + "multiallelic.vcf" + " -T VariantsToTable" + " -F CHROM -F POS -F ID -F REF -F ALT -F QUAL -F MULTI-ALLELIC -F AC -F AF" + " --moltenize -SMA" + diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java index 656b9e5d2..eb79228e7 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java @@ -19,7 +19,7 @@ public class VariantsToVCFIntegrationTest extends WalkerTest { @Test public void testVariantsToVCFUsingDbsnpInput() { List md5 = new ArrayList(); - md5.add("268c116f825c2a4b5200a416ca587adc"); + md5.add("72e6ce7aff7dec7ca9e7580be7ddd435"); WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + @@ -36,7 +36,7 @@ public class VariantsToVCFIntegrationTest extends WalkerTest { @Test public void testVariantsToVCFUsingGeliInput() { List md5 = new ArrayList(); - md5.add("82ca5ecef2df5d64dee9ef5a4b14ef2f"); + md5.add("22373883afa2221b5a4f75a50f30f26b"); WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + @@ -54,7 +54,7 @@ public class VariantsToVCFIntegrationTest extends WalkerTest { @Test public void testGenotypesToVCFUsingGeliInput() { List md5 = new ArrayList(); - md5.add("90bc2e21d633fa6c3c47c6bd86c134a0"); + md5.add("738eb66dbc400dcd1786cd9e49902e8c"); WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + @@ -72,7 +72,7 @@ public class VariantsToVCFIntegrationTest extends WalkerTest { @Test public void testGenotypesToVCFUsingHapMapInput() { List md5 = new ArrayList(); - md5.add("bb71dabd072a679cc85fe8d3e130fb2b"); + md5.add("67656672acc264156f5a3e01e5cac61a"); WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + @@ -89,11 +89,11 @@ public class VariantsToVCFIntegrationTest extends WalkerTest { @Test public void testGenotypesToVCFUsingVCFInput() { List md5 = new ArrayList(); - md5.add("ae39e2249bc20fcd0a668a7fe5fb84b0"); + md5.add("95898aad8c9f9515c0e668e2fb65a024"); WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-R " + b36KGReference + - " --variant:VCF " + testDir + "complexExample.vcf4" + + " --variant:VCF " + privateTestDir + "complexExample.vcf4" + " -T VariantsToVCF" + " -o %s" + " --no_cmdline_in_header", diff --git a/public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFIntegrationTest.java b/public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFIntegrationTest.java index 067a8ff9c..898cc62eb 100644 --- a/public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFIntegrationTest.java @@ -13,7 +13,7 @@ public class VCFIntegrationTest extends WalkerTest { public void testReadingAndWritingWitHNoChanges() { String md5ofInputVCF = "babf02baabcfa7f72a2c6f7da5fdc996"; - String testVCF = testDir + "vcf4.1.example.vcf"; + String testVCF = privateTestDir + "vcf4.1.example.vcf"; String baseCommand = "-R " + b37KGReference + " --no_cmdline_in_header -o %s "; @@ -26,10 +26,10 @@ public class VCFIntegrationTest extends WalkerTest { executeTest("Test Variants To VCF from new output", spec2); } - @Test + @Test(enabled = false) // See https://getsatisfaction.com/gsa/topics/support_vcf_4_1_structural_variation_breakend_alleles?utm_content=topic_link&utm_medium=email&utm_source=new_topic public void testReadingAndWritingBreakpointAlleles() { - String testVCF = testDir + "breakpoint-example.vcf"; + String testVCF = privateTestDir + "breakpoint-example.vcf"; //String testVCF = validationDataLocation + "multiallelic.vcf"; String baseCommand = "-R " + b37KGReference + " --no_cmdline_in_header -o %s "; @@ -41,12 +41,21 @@ public class VCFIntegrationTest extends WalkerTest { @Test public void testReadingAndWritingSamtools() { - String testVCF = testDir + "samtools.vcf"; + String testVCF = privateTestDir + "samtools.vcf"; String baseCommand = "-R " + b37KGReference + " --no_cmdline_in_header -o %s "; String test1 = baseCommand + "-T SelectVariants -V " + testVCF; - WalkerTestSpec spec1 = new WalkerTestSpec(test1, 1, Arrays.asList("0807ff11bebba81b87a273ad6bee01a8")); + WalkerTestSpec spec1 = new WalkerTestSpec(test1, 1, Arrays.asList("cf3f09ef63feba6958d32f95d587af80")); executeTest("Test reading and writing samtools vcf", spec1); } + + @Test + public void testReadingAndWritingSamtoolsWExBCFExample() { + String testVCF = privateTestDir + "ex2.vcf"; + String baseCommand = "-R " + b36KGReference + " --no_cmdline_in_header -o %s "; + String test1 = baseCommand + "-T SelectVariants -V " + testVCF; + WalkerTestSpec spec1 = new WalkerTestSpec(test1, 1, Arrays.asList("5839ed4972e2ccf3a7b190752ede6596")); + executeTest("Test reading and writing samtools WEx vcf/BCF example", spec1); + } } diff --git a/public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLinesUnitTest.java b/public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLinesUnitTest.java new file mode 100644 index 000000000..b6e6c4f42 --- /dev/null +++ b/public/java/test/org/broadinstitute/sting/utils/codecs/vcf/VCFStandardHeaderLinesUnitTest.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2012, The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.utils.codecs.vcf; + +import org.broadinstitute.sting.BaseTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.Assert; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by IntelliJ IDEA. + * User: aaron + * Date: Jun 30, 2010 + * Time: 3:32:08 PM + * To change this template use File | Settings | File Templates. + */ +public class VCFStandardHeaderLinesUnitTest extends BaseTest { + @DataProvider(name = "getStandardLines") + public Object[][] makeGetStandardLines() { + List tests = new ArrayList(); + + // info + tests.add(new Object[]{"AC", "info", true}); + tests.add(new Object[]{"AN", "info", true}); + tests.add(new Object[]{"AF", "info", true}); + tests.add(new Object[]{"DP", "info", true}); + tests.add(new Object[]{"DB", "info", true}); + tests.add(new Object[]{"END", "info", true}); + + // format + tests.add(new Object[]{"GT", "format", true}); + tests.add(new Object[]{"GQ", "format", true}); + tests.add(new Object[]{"DP", "format", true}); + tests.add(new Object[]{"AD", "format", true}); + tests.add(new Object[]{"PL", "format", true}); + + tests.add(new Object[]{"NOT_STANDARD", "info", false}); + tests.add(new Object[]{"NOT_STANDARD", "format", false}); + + return tests.toArray(new Object[][]{}); + } + + + @Test(dataProvider = "getStandardLines") + public void getStandardLines(final String key, final String type, final boolean expectedToBeStandard) { + VCFCompoundHeaderLine line = null; + if ( type.equals("info") ) + line = VCFStandardHeaderLines.getInfoLine(key, false); + else if ( type.equals("format") ) + line = VCFStandardHeaderLines.getFormatLine(key, false); + else + throw new IllegalArgumentException("Unexpected type in getStandardLines " + type); + + if ( expectedToBeStandard ) { + Assert.assertNotNull(line); + Assert.assertEquals(line.getID(), key); + } else + Assert.assertNull(line); + } + + private class RepairHeaderTest extends TestDataProvider { + final VCFCompoundHeaderLine original, expectedResult; + + private RepairHeaderTest(final VCFCompoundHeaderLine original) { + this(original, original); + } + + private RepairHeaderTest(final VCFCompoundHeaderLine original, final VCFCompoundHeaderLine expectedResult) { + super(RepairHeaderTest.class); + this.original = original; + this.expectedResult = expectedResult; + } + } + + @DataProvider(name = "RepairHeaderTest") + public Object[][] makeRepairHeaderTest() { + final VCFInfoHeaderLine standardAC = VCFStandardHeaderLines.getInfoLine("AC"); + final VCFInfoHeaderLine goodAC = new VCFInfoHeaderLine("AC", VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "x"); + + final VCFFormatHeaderLine standardGT = VCFStandardHeaderLines.getFormatLine("GT"); + final VCFFormatHeaderLine goodGT = new VCFFormatHeaderLine("GT", 1, VCFHeaderLineType.String, "x"); + + new RepairHeaderTest( standardGT, standardGT); + new RepairHeaderTest( goodGT, goodGT ); + new RepairHeaderTest( new VCFFormatHeaderLine("GT", 2, VCFHeaderLineType.String, "x"), standardGT); + new RepairHeaderTest( new VCFFormatHeaderLine("GT", 1, VCFHeaderLineType.Integer, "x"), standardGT); + new RepairHeaderTest( new VCFFormatHeaderLine("GT", 1, VCFHeaderLineType.Float, "x"), standardGT); + new RepairHeaderTest( new VCFFormatHeaderLine("GT", VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.Float, "x"), standardGT); + new RepairHeaderTest( new VCFFormatHeaderLine("GT", VCFHeaderLineCount.G, VCFHeaderLineType.String, "x"), standardGT); + new RepairHeaderTest( new VCFFormatHeaderLine("GT", VCFHeaderLineCount.A, VCFHeaderLineType.String, "x"), standardGT); + + new RepairHeaderTest( standardAC, standardAC); + new RepairHeaderTest( goodAC, goodAC ); + new RepairHeaderTest( new VCFInfoHeaderLine("AC", 1, VCFHeaderLineType.Integer, "x"), standardAC); + new RepairHeaderTest( new VCFInfoHeaderLine("AC", VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "x"), standardAC); + new RepairHeaderTest( new VCFInfoHeaderLine("AC", VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.Integer, "x"), standardAC); + new RepairHeaderTest( new VCFInfoHeaderLine("AC", 1, VCFHeaderLineType.Float, "x"), standardAC); + new RepairHeaderTest( new VCFInfoHeaderLine("AC", 1, VCFHeaderLineType.String, "x"), standardAC); + new RepairHeaderTest( new VCFInfoHeaderLine("AC", 0, VCFHeaderLineType.Flag, "x"), standardAC); + + new RepairHeaderTest( new VCFInfoHeaderLine("NON_STANDARD_INFO", 1, VCFHeaderLineType.String, "x")); + new RepairHeaderTest( new VCFFormatHeaderLine("NON_STANDARD_FORMAT", 1, VCFHeaderLineType.String, "x")); + + return RepairHeaderTest.getTests(RepairHeaderTest.class); + } + + @Test(dataProvider = "RepairHeaderTest") + public void testRepairHeaderTest(RepairHeaderTest cfg) { + final VCFHeader toRepair = new VCFHeader(Collections.singleton((VCFHeaderLine)cfg.original)); + final VCFHeader repaired = VCFStandardHeaderLines.repairStandardHeaderLines(toRepair); + + VCFCompoundHeaderLine repairedLine = (VCFCompoundHeaderLine)repaired.getFormatHeaderLine(cfg.original.getID()); + if ( repairedLine == null ) repairedLine = (VCFCompoundHeaderLine)repaired.getInfoHeaderLine(cfg.original.getID()); + + Assert.assertNotNull(repairedLine, "Repaired header didn't contain the expected line"); + Assert.assertEquals(repairedLine.getID(), cfg.expectedResult.getID()); + Assert.assertEquals(repairedLine.getType(), cfg.expectedResult.getType()); + Assert.assertEquals(repairedLine.getCountType(), cfg.expectedResult.getCountType()); + if ( repairedLine.getCountType() == VCFHeaderLineCount.INTEGER ) + Assert.assertEquals(repairedLine.getCount(), cfg.expectedResult.getCount()); + } +} diff --git a/public/java/test/org/broadinstitute/sting/utils/crypt/GATKKeyIntegrationTest.java b/public/java/test/org/broadinstitute/sting/utils/crypt/GATKKeyIntegrationTest.java index 8fb75ef38..2e6e9f904 100644 --- a/public/java/test/org/broadinstitute/sting/utils/crypt/GATKKeyIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/utils/crypt/GATKKeyIntegrationTest.java @@ -35,8 +35,8 @@ import java.util.Arrays; public class GATKKeyIntegrationTest extends WalkerTest { public static final String BASE_COMMAND = String.format("-T PrintReads -R %s -I %s -o %%s", - testDir + "exampleFASTA.fasta", - testDir + "exampleBAM.bam"); + publicTestDir + "exampleFASTA.fasta", + publicTestDir + "exampleBAM.bam"); public static final String MD5_UPON_SUCCESSFUL_RUN = "b9dc5bf6753ca2819e70b056eaf61258"; diff --git a/public/java/test/org/broadinstitute/sting/utils/fasta/CachingIndexedFastaSequenceFileUnitTest.java b/public/java/test/org/broadinstitute/sting/utils/fasta/CachingIndexedFastaSequenceFileUnitTest.java index 061dc99fa..82b17f70e 100644 --- a/public/java/test/org/broadinstitute/sting/utils/fasta/CachingIndexedFastaSequenceFileUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/utils/fasta/CachingIndexedFastaSequenceFileUnitTest.java @@ -9,8 +9,6 @@ import org.broadinstitute.sting.utils.exceptions.UserException; import org.testng.Assert; import org.testng.annotations.Test; import org.testng.annotations.DataProvider; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.BeforeMethod; import org.broadinstitute.sting.BaseTest; import java.io.File; @@ -27,7 +25,7 @@ import net.sf.samtools.SAMSequenceRecord; * Basic unit test for GenomeLoc */ public class CachingIndexedFastaSequenceFileUnitTest extends BaseTest { - private File simpleFasta = new File(testDir + "/exampleFASTA.fasta"); + private File simpleFasta = new File(privateTestDir + "/exampleFASTA.fasta"); private static final int STEP_SIZE = 1; //private static final List QUERY_SIZES = Arrays.asList(1); diff --git a/public/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java b/public/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java index 875765ca8..e8933ce04 100644 --- a/public/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java @@ -279,7 +279,7 @@ public class IntervalIntegrationTest extends WalkerTest { " -I " + validationDataLocation + "NA12878.chrom1.SLX.SRP000032.2009_06.bam" + " -R " + b36KGReference + " -o %s" + - " -L " + testDir + "symbolic_alleles_1.vcf", + " -L " + privateTestDir + "symbolic_alleles_1.vcf", 1, // just one output file Arrays.asList(md5)); executeTest("testSymbolicAlleles", spec); diff --git a/public/java/test/org/broadinstitute/sting/utils/interval/IntervalUtilsUnitTest.java b/public/java/test/org/broadinstitute/sting/utils/interval/IntervalUtilsUnitTest.java index a2775c1d5..28573c600 100644 --- a/public/java/test/org/broadinstitute/sting/utils/interval/IntervalUtilsUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/utils/interval/IntervalUtilsUnitTest.java @@ -357,8 +357,8 @@ public class IntervalUtilsUnitTest extends BaseTest { @Test public void testIsIntervalFile() { - Assert.assertTrue(IntervalUtils.isIntervalFile(BaseTest.testDir + "empty_intervals.list")); - Assert.assertTrue(IntervalUtils.isIntervalFile(BaseTest.testDir + "empty_intervals.list", true)); + Assert.assertTrue(IntervalUtils.isIntervalFile(BaseTest.privateTestDir + "empty_intervals.list")); + Assert.assertTrue(IntervalUtils.isIntervalFile(BaseTest.privateTestDir + "empty_intervals.list", true)); List extensions = Arrays.asList("bed", "interval_list", "intervals", "list", "picard"); for (String extension: extensions) { @@ -368,7 +368,7 @@ public class IntervalUtilsUnitTest extends BaseTest { @Test(expectedExceptions = UserException.CouldNotReadInputFile.class) public void testMissingIntervalFile() { - IntervalUtils.isIntervalFile(BaseTest.testDir + "no_such_intervals.list"); + IntervalUtils.isIntervalFile(BaseTest.privateTestDir + "no_such_intervals.list"); } @Test @@ -758,7 +758,7 @@ public class IntervalUtilsUnitTest extends BaseTest { @Test(dataProvider="unmergedIntervals") public void testUnmergedIntervals(String unmergedIntervals) { - List locs = IntervalUtils.parseIntervalArguments(hg18GenomeLocParser, Collections.singletonList(testDir + unmergedIntervals)); + List locs = IntervalUtils.parseIntervalArguments(hg18GenomeLocParser, Collections.singletonList(privateTestDir + unmergedIntervals)); Assert.assertEquals(locs.size(), 2); List merged = IntervalUtils.mergeIntervalLocations(locs, IntervalMergingRule.ALL); diff --git a/public/java/test/org/broadinstitute/sting/utils/variantcontext/VariantContextTestProvider.java b/public/java/test/org/broadinstitute/sting/utils/variantcontext/VariantContextTestProvider.java index 48939ffe8..90bd6b979 100644 --- a/public/java/test/org/broadinstitute/sting/utils/variantcontext/VariantContextTestProvider.java +++ b/public/java/test/org/broadinstitute/sting/utils/variantcontext/VariantContextTestProvider.java @@ -62,8 +62,8 @@ public class VariantContextTestProvider { private static VariantContext ROOT; private final static List testSourceVCFs = Arrays.asList( - new File(BaseTest.testDir + "ILLUMINA.wex.broad_phase2_baseline.20111114.both.exome.genotypes.1000.vcf"), - new File(BaseTest.testDir + "dbsnp_135.b37.1000.vcf") + new File(BaseTest.privateTestDir + "ILLUMINA.wex.broad_phase2_baseline.20111114.both.exome.genotypes.1000.vcf"), + new File(BaseTest.privateTestDir + "dbsnp_135.b37.1000.vcf") ); public abstract static class VariantContextIOTest { diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala index 95455e812..a3c5f5144 100644 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala +++ b/public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala @@ -36,9 +36,9 @@ class DataProcessingPipelineTest { spec.name = "DataProcessingPipeline" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -i " + BaseTest.testDir + "exampleBAM.bam", - " -D " + BaseTest.testDir + "exampleDBSNP.vcf", + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -i " + BaseTest.publicTestDir + "exampleBAM.bam", + " -D " + BaseTest.publicTestDir + "exampleDBSNP.vcf", " -nv ", " -test ", " -p " + projectName).mkString @@ -54,9 +54,9 @@ class DataProcessingPipelineTest { spec.name = "DataProcessingPipeline" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -i " + BaseTest.testDir + "exampleBAM.bam", - " -D " + BaseTest.testDir + "exampleDBSNP.vcf", + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -i " + BaseTest.publicTestDir + "exampleBAM.bam", + " -D " + BaseTest.publicTestDir + "exampleDBSNP.vcf", " -nv ", " -test ", " -bwa /home/unix/carneiro/bin/bwa", diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala index 1278b6e16..0989f8d24 100644 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala +++ b/public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala @@ -35,11 +35,11 @@ class PacbioProcessingPipelineTest { spec.name = "pacbioProcessingPipeline" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -i " + BaseTest.testDir + "exampleBAM.bam", + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -i " + BaseTest.publicTestDir + "exampleBAM.bam", " -blasr ", " -test ", - " -D " + BaseTest.testDir + "exampleDBSNP.vcf").mkString + " -D " + BaseTest.publicTestDir + "exampleDBSNP.vcf").mkString spec.fileMD5s += testOut -> "cf147e7f56806598371f8d5d6794b852" PipelineTest.executeTest(spec) } diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/DevNullOutputPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/DevNullOutputPipelineTest.scala index 9bb287ac4..92c40acb1 100644 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/DevNullOutputPipelineTest.scala +++ b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/DevNullOutputPipelineTest.scala @@ -59,8 +59,8 @@ class DevNullOutputPipelineTest { spec.name = "devnulloutput" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/examples/DevNullOutput.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -I " + BaseTest.testDir + "exampleBAM.bam").mkString + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -I " + BaseTest.publicTestDir + "exampleBAM.bam").mkString spec.jobRunners = PipelineTest.allJobRunners PipelineTest.executeTest(spec) } diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountLociPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountLociPipelineTest.scala index e737e52ea..9d885dda2 100644 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountLociPipelineTest.scala +++ b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountLociPipelineTest.scala @@ -36,8 +36,8 @@ class ExampleCountLociPipelineTest { spec.name = "countloci" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/examples/ExampleCountLoci.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -I " + BaseTest.testDir + "exampleBAM.bam", + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -I " + BaseTest.publicTestDir + "exampleBAM.bam", " -o " + testOut).mkString spec.fileMD5s += testOut -> "ade93df31a6150321c1067e749cae9be" PipelineTest.executeTest(spec) diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountReadsPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountReadsPipelineTest.scala index 8b286f090..1b965d8d2 100644 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountReadsPipelineTest.scala +++ b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleCountReadsPipelineTest.scala @@ -35,8 +35,8 @@ class ExampleCountReadsPipelineTest { spec.name = "countreads" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/examples/ExampleCountReads.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -I " + BaseTest.testDir + "exampleBAM.bam").mkString + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -I " + BaseTest.publicTestDir + "exampleBAM.bam").mkString PipelineTest.executeTest(spec) } } diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleReadFilterPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleReadFilterPipelineTest.scala index 7e5e9a93e..c6e4c3507 100644 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleReadFilterPipelineTest.scala +++ b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleReadFilterPipelineTest.scala @@ -83,8 +83,8 @@ class ExampleReadFilterPipelineTest { spec.name = "examplereadfilter" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/examples/ExampleReadFilter.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -I " + BaseTest.testDir + "exampleBAM.bam").mkString + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -I " + BaseTest.publicTestDir + "exampleBAM.bam").mkString PipelineTest.executeTest(spec) } } diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleUnifiedGenotyperPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleUnifiedGenotyperPipelineTest.scala index f598402af..6e37ae2a3 100644 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleUnifiedGenotyperPipelineTest.scala +++ b/public/scala/test/org/broadinstitute/sting/queue/pipeline/examples/ExampleUnifiedGenotyperPipelineTest.scala @@ -35,8 +35,8 @@ class ExampleUnifiedGenotyperPipelineTest { spec.name = "unifiedgenotyper" spec.args = Array( " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/examples/ExampleUnifiedGenotyper.scala", - " -R " + BaseTest.testDir + "exampleFASTA.fasta", - " -I " + BaseTest.testDir + "exampleBAM.bam", + " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", + " -I " + BaseTest.publicTestDir + "exampleBAM.bam", " -filter QD", " -filterExpression 'QD < 2.0'").mkString spec.jobRunners = PipelineTest.allJobRunners