From da7cd8337e0a2b5b557f2dde9c86d163f727045d Mon Sep 17 00:00:00 2001 From: ldgauthier Date: Fri, 4 Feb 2022 09:01:32 -0500 Subject: [PATCH] Add new max alt argument for GenomicsDB and require it to be >= GGVCFs (#7655) --- .../GenomicsDBArgumentCollection.java | 13 +- .../tools/genomicsdb/GenomicsDBOptions.java | 9 +- .../genotyper/AlleleSubsettingUtils.java | 12 +- ...GenotypeCalculationArgumentCollection.java | 13 +- .../walkers/genotyper/GenotypingEngine.java | 21 ++- .../afcalc/AlleleFrequencyCalculator.java | 6 +- .../walkers/variantutils/SelectVariants.java | 7 +- .../hellbender/utils/GenotypeUtils.java | 8 +- .../walkers/GenotypeGVCFsIntegrationTest.java | 96 ++++++++--- .../genotyper/GenotypingEngineUnitTest.java | 4 +- .../variantutils/ReblockGVCFUnitTest.java | 9 +- .../SelectVariantsIntegrationTest.java | 2 +- .../testSelectVariants_KeepOriginalAC.vcf | 2 +- .../testSelectVariants_SACDiploid.vcf | 106 ++++++------ .../testSelectVariants_SACNonDiploid.vcf | 154 +++++++++--------- .../vcfexample.loseAlleleInSelection.vcf | 2 +- .../testutils/VariantContextTestUtils.java | 8 + 17 files changed, 293 insertions(+), 179 deletions(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBArgumentCollection.java b/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBArgumentCollection.java index 7386ea44c64..e3400037a7d 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBArgumentCollection.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBArgumentCollection.java @@ -13,16 +13,27 @@ public class GenomicsDBArgumentCollection implements Serializable { public static final String USE_GCS_HDFS_CONNECTOR = "genomicsdb-use-gcs-hdfs-connector"; public static final String CALL_GENOTYPES_LONG_NAME = "call-genotypes"; + public static final String MAX_ALTS_LONG_NAME = "genomicsdb-max-alternate-alleles"; private static final boolean DEFAULT_CALL_GENOTYPES = false; private static final boolean DEFAULT_USE_BCF_CODEC = false; private static final boolean DEFAULT_SHARED_POSIXFS_OPTIMIZATIONS = false; private static final boolean DEFAULT_USE_GCS_HDFS_CONNECTOR = false; /** - * Not full-fledged arguments for now. + * Maximum number of alternate alleles that will report likelihoods after being combined on reading from GenomicsDB (including ) + * Must be at least one greater than the maximum number of alternate alleles for genotyping. + * A typical value is 3 more than the --max-alternate-alleles value that's used by GenotypeGVCFs and larger differences + * result in more robustness to PCR-related indel errors. + * Note that GenotypeGVCFs will drop highly multi-allelic sites that are missing likelihoods. + * + * See also {@link org.broadinstitute.hellbender.tools.walkers.genotyper.GenotypeCalculationArgumentCollection#MAX_ALTERNATE_ALLELES_LONG_NAME} */ + @Argument(fullName = MAX_ALTS_LONG_NAME, doc = "Maximum number of alternate alleles that will be combined on reading from GenomicsDB") public int maxDiploidAltAllelesThatCanBeGenotyped = GenotypeLikelihoods.MAX_DIPLOID_ALT_ALLELES_THAT_CAN_BE_GENOTYPED; + /** + * Output called genotypes in the final VCF (otherwise no-call) + */ @Argument(fullName = CALL_GENOTYPES_LONG_NAME, doc = "Output called genotypes in final VCF (otherwise no-call)", optional = true) public boolean callGenotypes = DEFAULT_CALL_GENOTYPES; diff --git a/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBOptions.java b/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBOptions.java index 57c92cf0585..aff83ddb9f6 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBOptions.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/genomicsdb/GenomicsDBOptions.java @@ -1,5 +1,6 @@ package org.broadinstitute.hellbender.tools.genomicsdb; +import org.broadinstitute.hellbender.exceptions.UserException; import org.broadinstitute.hellbender.tools.walkers.genotyper.GenotypeCalculationArgumentCollection; import java.nio.file.Path; @@ -35,12 +36,16 @@ public GenomicsDBOptions(final Path reference, final GenomicsDBArgumentCollectio this.useBCFCodec = genomicsdbArgs.useBCFCodec; this.sharedPosixFSOptimizations = genomicsdbArgs.sharedPosixFSOptimizations; this.useGcsHdfsConnector = genomicsdbArgs.useGcsHdfsConnector; + if (genomicsdbArgs.maxDiploidAltAllelesThatCanBeGenotyped - 1 < genotypeCalcArgs.maxAlternateAlleles) { //-1 for + throw new UserException.BadInput("GenomicsDB max alternate alleles (" + GenomicsDBArgumentCollection.MAX_ALTS_LONG_NAME + + ") must be at least one greater than genotype calculation max alternate alleles (" + + GenotypeCalculationArgumentCollection.MAX_ALTERNATE_ALLELES_LONG_NAME + "), accounting for the non-ref allele"); + } + this.maxDiploidAltAllelesThatCanBeGenotyped = genomicsdbArgs.maxDiploidAltAllelesThatCanBeGenotyped; if (genotypeCalcArgs != null) { - this.maxDiploidAltAllelesThatCanBeGenotyped = genotypeCalcArgs.maxAlternateAlleles; this.maxGenotypeCount = genotypeCalcArgs.maxGenotypeCount; } else { // Some defaults - this.maxDiploidAltAllelesThatCanBeGenotyped = genomicsdbArgs.maxDiploidAltAllelesThatCanBeGenotyped; this.maxGenotypeCount = GenotypeCalculationArgumentCollection.DEFAULT_MAX_GENOTYPE_COUNT; } } diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/AlleleSubsettingUtils.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/AlleleSubsettingUtils.java index e633cac19ed..88dc0f43089 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/AlleleSubsettingUtils.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/AlleleSubsettingUtils.java @@ -82,8 +82,12 @@ public static GenotypesContext subsetAlleles(final GenotypesContext originalGs, MathUtils.scaleLogSpaceArrayForNumericalStability(Arrays.stream(subsettedLikelihoodIndices) .mapToDouble(idx -> originalLikelihoods[idx]).toArray()) : null; if (newLikelihoods != null) { - final int PLindex = MathUtils.maxElementIndex(newLikelihoods); - newLog10GQ = GenotypeLikelihoods.getGQLog10FromLikelihoods(PLindex, newLikelihoods); + if (newLikelihoods.length > 1) { + final int PLindex = MathUtils.maxElementIndex(newLikelihoods); //pick out the call (log10L = 0) + newLog10GQ = GenotypeLikelihoods.getGQLog10FromLikelihoods(PLindex, newLikelihoods); + } else { //if we subset to just ref allele, keep the GQ + newLog10GQ = g.getGQ()/-10.0; //-10 to go from Phred to log space + } } } else if (g.hasGQ()) { @@ -99,8 +103,8 @@ public static GenotypesContext subsetAlleles(final GenotypesContext originalGs, //TODO: remove other G-length attributes, although that may require header parsing attributes.remove(VCFConstants.GENOTYPE_POSTERIORS_KEY); attributes.remove(GATKVCFConstants.GENOTYPE_PRIOR_KEY); - gb.noAttributes().attributes(attributes); - if (newLog10GQ != Double.NEGATIVE_INFINITY) { + gb.noPL().noGQ().noAttributes().attributes(attributes); //if alleles are subset, old PLs and GQ are invalid + if (newLog10GQ != Double.NEGATIVE_INFINITY && g.hasGQ()) { //only put GQ if originally present gb.log10PError(newLog10GQ); } if (useNewLikelihoods) { diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java index e688ac27457..edc41bccbdb 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java @@ -131,10 +131,14 @@ public GenotypeCalculationArgumentCollection clone() { /** * If there are more than this number of alternate alleles presented to the genotyper (either through discovery or GENOTYPE_GIVEN ALLELES), * then only this many alleles will be used. Note that genotyping sites with many alternate alleles is both CPU and memory intensive and it - * scales exponentially based on the number of alternate alleles. Unless there is a good reason to change the default value, we highly recommend + * scales exponentially based on the number of alternate alleles. + * + * Unless there is a good reason to change the default value, we highly recommend * that you not play around with this parameter. * - * See also {@link #maxGenotypeCount}. + * See also {@link #maxGenotypeCount} and {@link org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBArgumentCollection#MAX_ALTS_LONG_NAME}. + * This value can be no greater than one less than the corresponding GenomicsDB argument. Sites that exceed the + * GenomicsDB alt allele max will not be output with likelihoods and will be dropped by GenotypeGVCFs. */ @Advanced @Argument(fullName = MAX_ALTERNATE_ALLELES_LONG_NAME, doc = "Maximum number of alternate alleles to genotype", optional = true) @@ -142,7 +146,7 @@ public GenotypeCalculationArgumentCollection clone() { /** * If there are more than this number of genotypes at a locus presented to the genotyper, then only this many genotypes will be used. - * The possible genotypes are simply different ways of partitioning alleles given a specific ploidy asumption. + * The possible genotypes are simply different ways of partitioning alleles given a specific ploidy assumption. * Therefore, we remove genotypes from consideration by removing alternate alleles that are the least well supported. * The estimate of allele support is based on the ranking of the candidate haplotypes coming out of the graph building step. * Note that the reference allele is always kept. @@ -154,7 +158,8 @@ public GenotypeCalculationArgumentCollection clone() { * 1. the largest number of alt alleles, given ploidy, that yields a genotype count no higher than {@link #maxGenotypeCount} * 2. the value of {@link #maxAlternateAlleles} * - * See also {@link #maxAlternateAlleles}. + * See also {@link #maxAlternateAlleles} and + * {@link org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBArgumentCollection#maxDiploidAltAllelesThatCanBeGenotyped} */ @Advanced @Argument(fullName = MAX_GENOTYPE_COUNT_LONG_NAME, doc = "Maximum number of genotypes to consider at any site", optional = true) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngine.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngine.java index ea7a485dd46..03138c1f2ca 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngine.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngine.java @@ -112,7 +112,7 @@ public Config getConfiguration() { } /** - * Main entry function to calculate genotypes of a given VC with corresponding GL's that is shared across genotypers (namely UG and HC). + * Main entry function to calculate genotypes of a given VC with corresponding GLs that is shared across genotypers (namely GGVCFs and HC). * * Completes a variant context with genotype calls and associated annotations given the genotype likelihoods and * the model that need to be applied. @@ -122,7 +122,7 @@ public Config getConfiguration() { */ public VariantContext calculateGenotypes(final VariantContext vc, final GenotypePriorCalculator gpc, final List givenAlleles) { // if input VC can't be genotyped, exit with either null VCC or, in case where we need to emit all sites, an empty call - if (hasTooManyAlternativeAlleles(vc) || vc.getNSamples() == 0) { + if (cannotBeGenotyped(vc) || vc.getNSamples() == 0) { return null; } @@ -390,14 +390,21 @@ boolean isVcCoveredByDeletion(final VariantContext vc) { * @return {@code true} iff there is too many alternative alleles based on * {@link GenotypeLikelihoods#MAX_DIPLOID_ALT_ALLELES_THAT_CAN_BE_GENOTYPED}. */ - protected final boolean hasTooManyAlternativeAlleles(final VariantContext vc) { + protected final boolean cannotBeGenotyped(final VariantContext vc) { // protect against too many alternate alleles that we can't even run AF on: - if (vc.getNAlleles() <= GenotypeLikelihoods.MAX_DIPLOID_ALT_ALLELES_THAT_CAN_BE_GENOTYPED) { + if (vc.getNAlleles() <= GenotypeLikelihoods.MAX_DIPLOID_ALT_ALLELES_THAT_CAN_BE_GENOTYPED + && vc.getGenotypes().stream().anyMatch(GenotypeUtils::genotypeIsUsableForAFCalculation)) { return false; } - logger.warn("Attempting to genotype more than " + GenotypeLikelihoods.MAX_DIPLOID_ALT_ALLELES_THAT_CAN_BE_GENOTYPED + - " alleles. Site will be skipped at location "+vc.getContig()+":"+vc.getStart()); - return true; + if (vc.getNAlleles() > GenotypeLikelihoods.MAX_DIPLOID_ALT_ALLELES_THAT_CAN_BE_GENOTYPED) { + logger.warn("Attempting to genotype more than " + GenotypeLikelihoods.MAX_DIPLOID_ALT_ALLELES_THAT_CAN_BE_GENOTYPED + + " alleles. Site will be skipped at location " + vc.getContig() + ":" + vc.getStart()); + return true; + }else { + logger.warn("No genotype contained sufficient data to recalculate genotypes. Site will be skipped at location " + + vc.getContig() + ":" + vc.getStart()); + return true; + } } /** diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/afcalc/AlleleFrequencyCalculator.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/afcalc/AlleleFrequencyCalculator.java index 9bc52a3f3e0..dbd28342f07 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/afcalc/AlleleFrequencyCalculator.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/afcalc/AlleleFrequencyCalculator.java @@ -66,7 +66,9 @@ public static AlleleFrequencyCalculator makeCalculator(final DragstrParams drags /** * - * @param g must have likelihoods or (if approximateHomRefsFromGQ is true) GQ + * @param g must have likelihoods or (if approximateHomRefsFromGQ is true) be hom-ref with GQ + * (see {@link org.broadinstitute.hellbender.utils.GenotypeUtils#genotypeIsUsableForAFCalculation(Genotype) + * genotypeIsUsableForAFCalculation} ) * @param glCalc * @param log10AlleleFrequencies * @return @@ -75,7 +77,7 @@ private static double[] log10NormalizedGenotypePosteriors(final Genotype g, fina final double[] log10Likelihoods; if (g.hasLikelihoods()) { log10Likelihoods = g.getLikelihoods().getAsVector(); - } else if ( g.isHomRef() || g.isNoCall()) { + } else if (g.isHomRef()) { if (g.getPloidy() != 2) { throw new IllegalStateException("Likelihoods are required to calculate posteriors for hom-refs with ploidy != 2, " + "but were not found for genotype " + g + " with ploidy " + g.getPloidy()); diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants.java index 42367fe6619..e2a87b1c3f7 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants.java @@ -212,7 +212,8 @@ public final class SelectVariants extends VariantWalker { * When this flag is enabled, all alternate alleles that are not present in the (output) samples will be removed. * Note that this even extends to biallelic SNPs - if the alternate allele is not present in any sample, it will be * removed and the record will contain a '.' in the ALT column. Note also that sites-only VCFs, by definition, do - * not include the alternate allele in any genotype calls. + * not include the alternate allele in any genotype calls. Further note that PLs will be trimmed appropriately, + * removing likelihood information (even for homozygous reference calls). */ @Argument(fullName="remove-unused-alternates", doc="Remove alternate alleles not present in any genotypes", optional=true) @@ -1030,7 +1031,9 @@ private VariantContext subsetRecord(final VariantContext vc, final boolean prese // fix the PL and AD values if sub has fewer alleles than original vc final GenotypesContext subGenotypesWithOldAlleles = sub.getGenotypes(); //we need sub for the right samples, but PLs still go with old alleles newGC = sub.getNAlleles() == vc.getNAlleles() ? subGenotypesWithOldAlleles : - AlleleSubsettingUtils.subsetAlleles(subGenotypesWithOldAlleles, 0, vc.getAlleles(), sub.getAlleles(), null, GenotypeAssignmentMethod.DO_NOT_ASSIGN_GENOTYPES, vc.getAttributeAsInt(VCFConstants.DEPTH_KEY, 0), true); + AlleleSubsettingUtils.subsetAlleles(subGenotypesWithOldAlleles, 0, vc.getAlleles(), + sub.getAlleles(), null, GenotypeAssignmentMethod.DO_NOT_ASSIGN_GENOTYPES, + vc.getAttributeAsInt(VCFConstants.DEPTH_KEY, 0), false); } else { newGC = sub.getGenotypes(); } diff --git a/src/main/java/org/broadinstitute/hellbender/utils/GenotypeUtils.java b/src/main/java/org/broadinstitute/hellbender/utils/GenotypeUtils.java index 535b4e2af43..4d66795c7e4 100644 --- a/src/main/java/org/broadinstitute/hellbender/utils/GenotypeUtils.java +++ b/src/main/java/org/broadinstitute/hellbender/utils/GenotypeUtils.java @@ -136,8 +136,14 @@ public static GenotypeCounts computeDiploidGenotypeCounts(final VariantContext v return new GenotypeCounts(genotypeWithTwoRefsCount, genotypesWithOneRefCount, genotypesWithNoRefsCount); } + /** + * Do we have (or can we infer) likelihoods necessary for allele frequency calculation? + * Some reblocked and/or DRAGEN GVCFs omit likelihoods for ref blocks, but we can estimate them + * @param g a genotype of unknown call and ploidy + * @return true if we have enough info for AF calculation + */ public static boolean genotypeIsUsableForAFCalculation(Genotype g) { - return g.hasLikelihoods() || g.hasGQ() || g.getAlleles().stream().anyMatch(a -> a.isCalled() && a.isNonReference() && !a.isSymbolic()); + return g.hasLikelihoods() || (g.isHomRef() && g.hasGQ() && 2 == g.getPloidy()); } /** diff --git a/src/test/java/org/broadinstitute/hellbender/tools/walkers/GenotypeGVCFsIntegrationTest.java b/src/test/java/org/broadinstitute/hellbender/tools/walkers/GenotypeGVCFsIntegrationTest.java index 1fd477c6871..9934d6b4330 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/walkers/GenotypeGVCFsIntegrationTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/walkers/GenotypeGVCFsIntegrationTest.java @@ -12,10 +12,8 @@ import htsjdk.variant.vcf.VCFHeaderLineCount; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.tuple.Pair; -import org.broadinstitute.barclay.argparser.Argument; import org.broadinstitute.barclay.argparser.CommandLineException; import org.broadinstitute.hellbender.CommandLineProgramTest; -import org.broadinstitute.hellbender.cmdline.GATKPlugin.DefaultGATKVariantAnnotationArgumentCollection; import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions; import org.broadinstitute.hellbender.exceptions.UserException; import org.broadinstitute.hellbender.testutils.ArgumentsBuilder; @@ -45,6 +43,8 @@ import java.security.NoSuchAlgorithmException; import java.util.*; import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.IntUnaryOperator; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -82,6 +82,12 @@ private static void assertForEachElementInLists(final List actual, final } } + private static void assertCountForEachElementInList(final List actual, Integer count, BiConsumer assertion) { + for (int i = 0; i < actual.size(); i++) { + assertion.accept(actual.get(i), count); + } + } + @DataProvider(name = "gvcfsToGenotype") public Object[][] gvcfsToGenotype() { return new Object[][]{ @@ -262,22 +268,64 @@ public void assertMatchingGenotypesFromGenomicsDB(File input, File expected, Loc final String genomicsDBUri = GenomicsDBTestUtils.makeGenomicsDBUri(tempGenomicsDB); final List args = new ArrayList(); args.add("--"+GenotypeCalculationArgumentCollection.MAX_ALTERNATE_ALLELES_LONG_NAME); - args.add("2"); // Too small max_alternate_alleles arg to GenomicsDB, should fail - try { - File output = runGenotypeGVCFS(genomicsDBUri, expected, args, reference); - Assert.fail("Expected exception not thrown"); - } catch (IllegalStateException e) { - // Pass - } + args.add("2"); + runGenotypeGVCFSAndAssertCount(genomicsDBUri, args, 2, VariantContextTestUtils::assertVariantContextMaxAltAlleleCount, reference); args.clear(); args.add("--"+GenotypeCalculationArgumentCollection.MAX_ALTERNATE_ALLELES_LONG_NAME); args.add("8"); - runGenotypeGVCFSAndAssertSomething(genomicsDBUri, expected, args, VariantContextTestUtils::assertVariantContextsHaveSameGenotypes, reference); + runGenotypeGVCFSAndAssertComparison(genomicsDBUri, expected, args, VariantContextTestUtils::assertVariantContextsHaveSameGenotypes, reference); // The default option with GenomicsDB input uses VCFCodec for decoding, test BCFCodec explicitly args.add("--"+GenomicsDBArgumentCollection.USE_BCF_CODEC_LONG_NAME); - runGenotypeGVCFSAndAssertSomething(genomicsDBUri, expected, args, VariantContextTestUtils::assertVariantContextsHaveSameGenotypes, reference); + runGenotypeGVCFSAndAssertComparison(genomicsDBUri, expected, args, VariantContextTestUtils::assertVariantContextsHaveSameGenotypes, reference); + } + + @Test + public void testMaxAltsToCombineInGenomicsDB() { + final File tempGenomicsDB = GenomicsDBTestUtils.createTempGenomicsDB(CEUTRIO_20_21_GATK3_4_G_VCF, new SimpleInterval("20", 1, 11_000_000)); + final String genomicsDBUri = GenomicsDBTestUtils.makeGenomicsDBUri(tempGenomicsDB); + final List args = new ArrayList(); + args.add("--"+GenotypeCalculationArgumentCollection.MAX_ALTERNATE_ALLELES_LONG_NAME); + args.add("3"); + args.add("--" + GenomicsDBArgumentCollection.MAX_ALTS_LONG_NAME); + args.add("4"); + runGenotypeGVCFSAndAssertCount(genomicsDBUri, args, 3, VariantContextTestUtils::assertVariantContextMaxAltAlleleCount, b37_reference_20_21); + + args.clear(); + args.add("--"+GenotypeCalculationArgumentCollection.MAX_ALTERNATE_ALLELES_LONG_NAME); + args.add("2"); + args.add("--" + GenomicsDBArgumentCollection.MAX_ALTS_LONG_NAME); + args.add("20"); + runGenotypeGVCFSAndAssertCount(genomicsDBUri, args, 2, VariantContextTestUtils::assertVariantContextMaxAltAlleleCount, b37_reference_20_21); + } + + @Test(expectedExceptions = UserException.BadInput.class) + public void testGDBMaxAltsLessThanGGVCFsMaxAlts() { + final File input = CEUTRIO_20_21_GATK3_4_G_VCF; + final SimpleInterval interval = new SimpleInterval("20", 1, 11_000_000); + final File tempGenomicsDB = GenomicsDBTestUtils.createTempGenomicsDB(input, interval); + final String genomicsDBUri = GenomicsDBTestUtils.makeGenomicsDBUri(tempGenomicsDB); + final List args = new ArrayList(); + args.add("--"+GenotypeCalculationArgumentCollection.MAX_ALTERNATE_ALLELES_LONG_NAME); + args.add("20"); + args.add("--"+GenomicsDBArgumentCollection.MAX_ALTS_LONG_NAME); + args.add("2"); // Too small max_alternate_alleles arg to GenomicsDB, should throw + File output = runGenotypeGVCFS(genomicsDBUri, null, args, b37_reference_20_21); + } + + @Test(expectedExceptions = UserException.BadInput.class) + public void testGDBMaxAltsEqualsGGVCFsMaxAlts() { + final File input = CEUTRIO_20_21_GATK3_4_G_VCF; + final SimpleInterval interval = new SimpleInterval("20", 1, 11_000_000); + final File tempGenomicsDB = GenomicsDBTestUtils.createTempGenomicsDB(input, interval); + final String genomicsDBUri = GenomicsDBTestUtils.makeGenomicsDBUri(tempGenomicsDB); + final List args = new ArrayList(); + args.add("--"+GenomicsDBArgumentCollection.MAX_ALTS_LONG_NAME); + args.add("5"); + args.add("--"+GenotypeCalculationArgumentCollection.MAX_ALTERNATE_ALLELES_LONG_NAME); + args.add("5"); // GenomicsDB value needs to be at least one more than this, should throw + File output = runGenotypeGVCFS(genomicsDBUri, null, args, b37_reference_20_21); } private void runAndCheckGenomicsDBOutput(final ArgumentsBuilder args, final File expected, final File output) { @@ -321,12 +369,12 @@ public void assertMatchingAnnotationsFromGenomicsDB_newMQformat(File input, File final VCFHeader header = VCFHeaderReader.readHeaderFrom(new SeekablePathStream(IOUtils.getPath(expected.getAbsolutePath()))); final List attributesToFilter = Stream.concat(ATTRIBUTES_WITH_JITTER.stream(), ATTRIBUTES_TO_IGNORE.stream()).collect(Collectors.toList()); - runGenotypeGVCFSAndAssertSomething(genomicsDBUri, expected, NO_EXTRA_ARGS, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); + runGenotypeGVCFSAndAssertComparison(genomicsDBUri, expected, NO_EXTRA_ARGS, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); // The default option with GenomicsDB input uses VCFCodec for decoding, test BCFCodec explicitly final List args = new ArrayList(); args.add("--"+GenomicsDBArgumentCollection.USE_BCF_CODEC_LONG_NAME); - runGenotypeGVCFSAndAssertSomething(genomicsDBUri, expected, args, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); + runGenotypeGVCFSAndAssertComparison(genomicsDBUri, expected, args, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); } @Test(dataProvider = "gvcfsToGenotype") @@ -337,14 +385,14 @@ public void testEntireVariantContext(File input, File expected, List ext private void assertVariantContextsMatch(File input, File expected, List extraArgs, String reference) throws IOException { try { final VCFHeader header = VCFHeaderReader.readHeaderFrom(new SeekablePathStream(IOUtils.getPath(expected.getAbsolutePath()))); - runGenotypeGVCFSAndAssertSomething(input, expected, extraArgs, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); + runGenotypeGVCFSAndAssertComparison(input, expected, extraArgs, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); } catch (java.io.IOException e) { throw new AssertionError("There was a problem reading your expected input file"); } } private void assertGenotypesMatch(File input, File expected, List additionalArguments, String reference) throws IOException { - runGenotypeGVCFSAndAssertSomething(input, expected, additionalArguments, VariantContextTestUtils::assertVariantContextsHaveSameGenotypes, + runGenotypeGVCFSAndAssertComparison(input, expected, additionalArguments, VariantContextTestUtils::assertVariantContextsHaveSameGenotypes, reference); } @@ -366,11 +414,11 @@ public void assertDeprecatedMQThrowsUserException() { @Test(dataProvider = "GVCFsWithNewMQFormat") public void assertNewMQWorks(File input, File expected, Locatable interval, String reference) throws IOException { final VCFHeader header = VCFHeaderReader.readHeaderFrom(new SeekablePathStream(IOUtils.getPath(expected.getAbsolutePath()))); - runGenotypeGVCFSAndAssertSomething(input, expected, NO_EXTRA_ARGS, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); + runGenotypeGVCFSAndAssertComparison(input, expected, NO_EXTRA_ARGS, (a, e) -> VariantContextTestUtils.assertVariantContextsAreEqualAlleleOrderIndependent(a, e, ATTRIBUTES_TO_IGNORE, ATTRIBUTES_WITH_JITTER, header), reference); } - private void runGenotypeGVCFSAndAssertSomething(File input, File expected, List additionalArguments, BiConsumer assertion, String reference) throws IOException { - runGenotypeGVCFSAndAssertSomething(input.getAbsolutePath(), expected, additionalArguments, assertion, reference + private void runGenotypeGVCFSAndAssertComparison(File input, File expected, List additionalArguments, BiConsumer assertion, String reference) throws IOException { + runGenotypeGVCFSAndAssertComparison(input.getAbsolutePath(), expected, additionalArguments, assertion, reference ); } @@ -391,7 +439,7 @@ private File runGenotypeGVCFS(String input, File expected, List addition return output; } - private void runGenotypeGVCFSAndAssertSomething(String input, File expected, List additionalArguments, BiConsumer assertion, String reference) throws IOException { + private void runGenotypeGVCFSAndAssertComparison(String input, File expected, List additionalArguments, BiConsumer assertion, String reference) throws IOException { final File output = runGenotypeGVCFS(input, expected, additionalArguments, reference); Assert.assertTrue(output.exists()); @@ -406,6 +454,16 @@ private void runGenotypeGVCFSAndAssertSomething(String input, File expected, Lis } } + private void runGenotypeGVCFSAndAssertCount(final String input, final List additionalArguments, final Integer count, + final BiConsumer conditionOnCount, final String reference) { + final File output = runGenotypeGVCFS(input, null, additionalArguments, reference); + Assert.assertTrue(output.exists()); + + final List actualVC = VariantContextTestUtils.getVariantContexts(output); + Assert.assertTrue(actualVC.size() > 0); + assertCountForEachElementInList(actualVC, count, conditionOnCount); + } + @Test public void testIndexIsCreated(){ final File output = createTempFile("test", ".vcf"); diff --git a/src/test/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngineUnitTest.java b/src/test/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngineUnitTest.java index 137c07a77c5..beca5ddfb10 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngineUnitTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypingEngineUnitTest.java @@ -126,9 +126,11 @@ public void testNoIndexOutOfBoundsExceptionWhenSubsettingToNoAlleles(){ @Test public void testGenotypesWithNonRefSymbolicAllelesAreNotNulled(){ + final GenotypeBuilder gBuilder = new GenotypeBuilder(SAMPLES.getSample(0), Arrays.asList(refA, Allele.NON_REF_ALLELE)); + gBuilder.PL(new int[]{60,30,0}); final VariantContext vc = new VariantContextBuilder(null, "1", 100, 100, Arrays.asList(refA, Allele.NON_REF_ALLELE)) - .genotypes(GenotypeBuilder.create(SAMPLES.getSample(0), Arrays.asList(refA, Allele.NON_REF_ALLELE))).make(); + .genotypes(gBuilder.make()).make(); Assert.assertNotNull(getGenotypingEngine().calculateGenotypes(vc)); } diff --git a/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFUnitTest.java b/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFUnitTest.java index c6044669f3f..2b42a3c5a46 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFUnitTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFUnitTest.java @@ -96,7 +96,7 @@ public void testLowQualVariantToGQ0HomRef() { reblocker.vcfWriter = new ReblockingGVCFWriter(new GVCFWriterUnitTest.MockWriter(), Arrays.asList(20, 100), true, null, new ReblockingOptions()); reblocker.dropLowQuals = true; - final Genotype g = VariantContextTestUtils.makeG("sample1", LONG_REF, Allele.NON_REF_ALLELE, 200, 100, 200, 11, 0, 37); + final Genotype g = VariantContextTestUtils.makeG("sample1", 11, LONG_REF, Allele.NON_REF_ALLELE, 200, 100, 200, 11, 0, 37); final VariantContext toBeNoCalled = makeDeletionVC("lowQualVar", Arrays.asList(LONG_REF, DELETION, Allele.NON_REF_ALLELE), LONG_REF.length(), g); final VariantContextBuilder dropped = reblocker.lowQualVariantToGQ0HomRef(toBeNoCalled); Assert.assertNull(dropped); @@ -128,7 +128,8 @@ public void testLowQualVariantToGQ0HomRef() { //haploid hom ref call final int[] pls = {0, 35, 72}; - final GenotypeBuilder gb = new GenotypeBuilder("male_sample", Collections.singletonList(LONG_REF)).PL(pls); + final int gq = 35; + final GenotypeBuilder gb = new GenotypeBuilder("male_sample", Collections.singletonList(LONG_REF)).PL(pls).GQ(gq); final VariantContextBuilder vb = new VariantContextBuilder(); vb.chr("20").start(10001).stop(10004).alleles(Arrays.asList(LONG_REF, DELETION, Allele.NON_REF_ALLELE)).log10PError(-3.0).genotypes(gb.make()); final VariantContext vc = vb.make(); @@ -137,6 +138,7 @@ public void testLowQualVariantToGQ0HomRef() { final Genotype newG = haploidRefBlock.getGenotype("male_sample"); Assert.assertEquals(newG.getPloidy(), 1); + Assert.assertTrue(newG.hasGQ()); Assert.assertEquals(newG.getGQ(), 35); } @@ -144,10 +146,11 @@ public void testLowQualVariantToGQ0HomRef() { public void testCalledHomRefGetsAltGQ() { final ReblockGVCF reblocker = new ReblockGVCF(); - final Genotype g3 = VariantContextTestUtils.makeG("sample1", LONG_REF, LONG_REF, 0, 11, 37, 100, 200, 400); + final Genotype g3 = VariantContextTestUtils.makeG("sample1", 11, LONG_REF, LONG_REF, 0, 11, 37, 100, 200, 400); final VariantContext twoAltsHomRef = makeDeletionVC("lowQualVar", Arrays.asList(LONG_REF, DELETION, Allele.NON_REF_ALLELE), LONG_REF.length(), g3); final GenotypeBuilder takeGoodAltGQ = reblocker.changeCallToHomRefVersusNonRef(twoAltsHomRef, new HashMap<>()); final Genotype nowRefBlock = takeGoodAltGQ.make(); + Assert.assertTrue(nowRefBlock.hasGQ()); Assert.assertEquals(nowRefBlock.getGQ(), 11); Assert.assertEquals(nowRefBlock.getDP(), 18); Assert.assertEquals((int)nowRefBlock.getExtendedAttribute(GATKVCFConstants.MIN_DP_FORMAT_KEY), 18); diff --git a/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariantsIntegrationTest.java b/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariantsIntegrationTest.java index 28f3162e4a7..f5acd20a5ae 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariantsIntegrationTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariantsIntegrationTest.java @@ -847,7 +847,7 @@ public void testHaploid() throws IOException { final String testFile = getToolTestDataDir() + "haploid-multisample.vcf"; final IntegrationTestSpec spec = new IntegrationTestSpec( - baseTestString(" -sn HG00610 -select 'DP > 7' --remove-unused-alternates ", testFile), + baseTestString(" -sn HG00610 -select 'DP > 7' --remove-unused-alternates", testFile), Collections.singletonList(getToolTestDataDir() + "expected/" + "testSelectVariants_Haploid.vcf") ); diff --git a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepOriginalAC.vcf b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepOriginalAC.vcf index b094af2e322..ca6f26dd236 100644 --- a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepOriginalAC.vcf +++ b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepOriginalAC.vcf @@ -11,4 +11,4 @@ #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12892 20 10000000 . T G . PASS AC=1;AC_Orig=2;AF=0.500;AN=2;AN_Orig=4 GT:PL 0/1:10,0,12 20 10000117 . C T . PASS AC=0;AC_Orig=1;AF=0.00;AN=2;AN_Orig=4 GT:PL 0/0:0,10,80 -20 10000211 . C A,T . PASS AC=0,2;AC_Orig=1,2;AF=0.00,1.00;AN=2;AN_Orig=4 GT:PL 2/2:90,10,0 +20 10000211 . C A,T . PASS AC=0,2;AC_Orig=1,2;AF=0.00,1.00;AN=2;AN_Orig=4 GT:PL 2/2:90,10,60,10,50,0 diff --git a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACDiploid.vcf b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACDiploid.vcf index 409c092b832..f72f9875832 100644 --- a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACDiploid.vcf +++ b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACDiploid.vcf @@ -177,59 +177,59 @@ ##contig= ##contig= #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12891 -20 9999900 . G . . . AN=0;DP=0 GT:DP:GQ:MIN_DP:PL ./.:0:0:0:0,0,0 -20 9999901 . T . . . AN=0;DP=0 GT:DP:GQ:MIN_DP:PL ./.:0:0:0:0,0,0 -20 9999902 . T . . . AN=0;DP=1;END=9999903 GT:DP:GQ:MIN_DP:PL ./.:1:3:1:0,3,39 -20 9999904 . T . . . AN=0;DP=2 GT:DP:GQ:MIN_DP:PL ./.:2:6:2:0,6,78 -20 9999905 . T . . . AN=0;DP=2;END=9999906 GT:DP:GQ:MIN_DP:PL ./.:2:6:2:0,6,78 -20 9999907 . A . . . AN=0;DP=4;END=9999908 GT:DP:GQ:MIN_DP:PL ./.:4:12:4:0,12,149 -20 9999909 . A . . . AN=0;DP=4;END=9999911 GT:DP:GQ:MIN_DP:PL ./.:4:12:4:0,12,149 -20 9999912 . C . . . AN=0;DP=5;END=9999914 GT:DP:GQ:MIN_DP:PL ./.:5:15:5:0,15,187 -20 9999915 . C . . . AN=0;DP=6 GT:DP:GQ:MIN_DP:PL ./.:6:18:6:0,18,227 -20 9999916 . T . . . AN=0;DP=7 GT:DP:GQ:MIN_DP:PL ./.:7:21:7:0,21,272 -20 9999917 . G . . . AN=0;DP=9 GT:DP:GQ:MIN_DP:PL ./.:9:27:9:0,27,333 -20 9999918 . A . . . AN=0;DP=9 GT:DP:GQ:MIN_DP:PL ./.:9:27:9:0,27,333 -20 9999919 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./.:11:33:11:0,33,395 -20 9999920 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./.:11:33:11:0,33,395 -20 9999921 . A . . . AN=0;DP=13 GT:DP:GQ:MIN_DP:PL ./.:13:39:13:0,39,508 -20 9999922 . T . . . AN=0;DP=14 GT:DP:GQ:MIN_DP:PL ./.:14:42:14:0,42,537 -20 9999923 . A . . . AN=0;DP=16 GT:DP:GQ:MIN_DP:PL ./.:16:48:16:0,48,626 -20 9999924 . G . . . AN=0;DP=17;END=9999925 GT:DP:GQ:MIN_DP:PL ./.:17:51:17:0,51,641 -20 9999926 . T . . . AN=0;DP=18;END=9999929 GT:DP:GQ:MIN_DP:PL ./.:18:54:18:0,54,674 -20 9999930 . T . . . AN=0;DP=18 GT:DP:GQ:MIN_DP:PL ./.:18:54:18:0,54,674 -20 9999931 . T . . . AN=0;DP=21;END=9999933 GT:DP:GQ:MIN_DP:PL ./.:21:63:21:0,63,764 -20 9999934 . T . . . AN=0;DP=25 GT:DP:GQ:MIN_DP:PL ./.:25:60:25:0,60,920 -20 9999935 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./.:26:78:26:0,78,1020 -20 9999936 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./.:26:65:26:0,65,986 -20 9999937 . A . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./.:26:78:26:0,78,996 -20 9999938 . T . . . AN=0;DP=29;END=9999939 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0,81,1068 -20 9999940 . T . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0,81,1068 -20 9999941 . C . . . AN=0;DP=29;END=9999942 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0,81,1068 -20 9999943 . G . . . AN=0;DP=29;END=9999944 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0,81,1068 -20 9999945 . A . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./.:29:75:29:0,75,1008 -20 9999946 . C . . . AN=0;DP=33;END=9999952 GT:DP:GQ:MIN_DP:PL ./.:33:90:32:0,90,1208 -20 9999953 . T . . . AN=0;DP=38;END=9999954 GT:DP:GQ:MIN_DP:PL ./.:38:87:37:0,87,1305 -20 9999955 . G . . . AN=0;DP=41;END=9999956 GT:DP:GQ:MIN_DP:PL ./.:41:90:39:0,90,1350 -20 9999957 . T . . . AN=0;DP=45;END=9999959 GT:DP:GQ:MIN_DP:PL ./.:45:81:44:0,81,1215 -20 9999960 . C . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./.:48:72:48:0,72,1080 -20 9999961 . A . . . AN=0;DP=48;END=9999964 GT:DP:GQ:MIN_DP:PL ./.:48:60:48:0,60,900 -20 9999965 . A . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./.:48:60:48:0,60,900 -20 9999966 . C . . . AN=0;DP=49 GT:DP:GQ:MIN_DP:PL ./.:49:57:49:0,57,855 -20 9999967 . C . . . AN=0;DP=50 GT:DP:GQ:MIN_DP:PL ./.:50:48:50:0,48,720 -20 9999968 . T . . . AN=0;DP=52 GT:DP:GQ:MIN_DP:PL ./.:52:45:50:0,45,675 -20 9999969 . A . . . AN=0;DP=52;END=9999971 GT:DP:GQ:MIN_DP:PL ./.:52:45:50:0,45,675 -20 9999972 . T . . . AN=0;DP=54;END=9999975 GT:DP:GQ:MIN_DP:PL ./.:54:39:53:0,39,585 -20 9999976 . T . . . AN=0;DP=55;END=9999978 GT:DP:GQ:MIN_DP:PL ./.:55:33:54:0,33,495 -20 9999979 . C . . . AN=0;DP=57 GT:DP:GQ:MIN_DP:PL ./.:57:27:57:0,27,405 -20 9999980 . C . . . AN=0;DP=59 GT:DP:GQ:MIN_DP:PL ./.:59:21:59:0,21,315 -20 9999981 . T . . . AN=0;DP=60 GT:DP:GQ:MIN_DP:PL ./.:60:15:60:0,15,225 -20 9999982 . T . . . AN=0;DP=63;END=9999986 GT:DP:GQ:MIN_DP:PL ./.:63:12:62:0,12,180 -20 9999987 . C . . . AN=0;DP=67;END=9999991 GT:DP:GQ:MIN_DP:PL ./.:67:3:66:0,3,45 -20 9999992 . C . . . AN=0;DP=72;END=9999995 GT:DP:GQ:MIN_DP:PL ./.:72:0:68:0,0,0 +20 9999900 . G . . . AN=0;DP=0 GT:DP:GQ:MIN_DP:PL ./.:0:0:0:0 +20 9999901 . T . . . AN=0;DP=0 GT:DP:GQ:MIN_DP:PL ./.:0:0:0:0 +20 9999902 . T . . . AN=0;DP=1;END=9999903 GT:DP:GQ:MIN_DP:PL ./.:1:3:1:0 +20 9999904 . T . . . AN=0;DP=2 GT:DP:GQ:MIN_DP:PL ./.:2:6:2:0 +20 9999905 . T . . . AN=0;DP=2;END=9999906 GT:DP:GQ:MIN_DP:PL ./.:2:6:2:0 +20 9999907 . A . . . AN=0;DP=4;END=9999908 GT:DP:GQ:MIN_DP:PL ./.:4:12:4:0 +20 9999909 . A . . . AN=0;DP=4;END=9999911 GT:DP:GQ:MIN_DP:PL ./.:4:12:4:0 +20 9999912 . C . . . AN=0;DP=5;END=9999914 GT:DP:GQ:MIN_DP:PL ./.:5:15:5:0 +20 9999915 . C . . . AN=0;DP=6 GT:DP:GQ:MIN_DP:PL ./.:6:18:6:0 +20 9999916 . T . . . AN=0;DP=7 GT:DP:GQ:MIN_DP:PL ./.:7:21:7:0 +20 9999917 . G . . . AN=0;DP=9 GT:DP:GQ:MIN_DP:PL ./.:9:27:9:0 +20 9999918 . A . . . AN=0;DP=9 GT:DP:GQ:MIN_DP:PL ./.:9:27:9:0 +20 9999919 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./.:11:33:11:0 +20 9999920 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./.:11:33:11:0 +20 9999921 . A . . . AN=0;DP=13 GT:DP:GQ:MIN_DP:PL ./.:13:39:13:0 +20 9999922 . T . . . AN=0;DP=14 GT:DP:GQ:MIN_DP:PL ./.:14:42:14:0 +20 9999923 . A . . . AN=0;DP=16 GT:DP:GQ:MIN_DP:PL ./.:16:48:16:0 +20 9999924 . G . . . AN=0;DP=17;END=9999925 GT:DP:GQ:MIN_DP:PL ./.:17:51:17:0 +20 9999926 . T . . . AN=0;DP=18;END=9999929 GT:DP:GQ:MIN_DP:PL ./.:18:54:18:0 +20 9999930 . T . . . AN=0;DP=18 GT:DP:GQ:MIN_DP:PL ./.:18:54:18:0 +20 9999931 . T . . . AN=0;DP=21;END=9999933 GT:DP:GQ:MIN_DP:PL ./.:21:63:21:0 +20 9999934 . T . . . AN=0;DP=25 GT:DP:GQ:MIN_DP:PL ./.:25:60:25:0 +20 9999935 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./.:26:78:26:0 +20 9999936 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./.:26:65:26:0 +20 9999937 . A . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./.:26:78:26:0 +20 9999938 . T . . . AN=0;DP=29;END=9999939 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0 +20 9999940 . T . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0 +20 9999941 . C . . . AN=0;DP=29;END=9999942 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0 +20 9999943 . G . . . AN=0;DP=29;END=9999944 GT:DP:GQ:MIN_DP:PL ./.:29:81:27:0 +20 9999945 . A . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./.:29:75:29:0 +20 9999946 . C . . . AN=0;DP=33;END=9999952 GT:DP:GQ:MIN_DP:PL ./.:33:90:32:0 +20 9999953 . T . . . AN=0;DP=38;END=9999954 GT:DP:GQ:MIN_DP:PL ./.:38:87:37:0 +20 9999955 . G . . . AN=0;DP=41;END=9999956 GT:DP:GQ:MIN_DP:PL ./.:41:90:39:0 +20 9999957 . T . . . AN=0;DP=45;END=9999959 GT:DP:GQ:MIN_DP:PL ./.:45:81:44:0 +20 9999960 . C . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./.:48:72:48:0 +20 9999961 . A . . . AN=0;DP=48;END=9999964 GT:DP:GQ:MIN_DP:PL ./.:48:60:48:0 +20 9999965 . A . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./.:48:60:48:0 +20 9999966 . C . . . AN=0;DP=49 GT:DP:GQ:MIN_DP:PL ./.:49:57:49:0 +20 9999967 . C . . . AN=0;DP=50 GT:DP:GQ:MIN_DP:PL ./.:50:48:50:0 +20 9999968 . T . . . AN=0;DP=52 GT:DP:GQ:MIN_DP:PL ./.:52:45:50:0 +20 9999969 . A . . . AN=0;DP=52;END=9999971 GT:DP:GQ:MIN_DP:PL ./.:52:45:50:0 +20 9999972 . T . . . AN=0;DP=54;END=9999975 GT:DP:GQ:MIN_DP:PL ./.:54:39:53:0 +20 9999976 . T . . . AN=0;DP=55;END=9999978 GT:DP:GQ:MIN_DP:PL ./.:55:33:54:0 +20 9999979 . C . . . AN=0;DP=57 GT:DP:GQ:MIN_DP:PL ./.:57:27:57:0 +20 9999980 . C . . . AN=0;DP=59 GT:DP:GQ:MIN_DP:PL ./.:59:21:59:0 +20 9999981 . T . . . AN=0;DP=60 GT:DP:GQ:MIN_DP:PL ./.:60:15:60:0 +20 9999982 . T . . . AN=0;DP=63;END=9999986 GT:DP:GQ:MIN_DP:PL ./.:63:12:62:0 +20 9999987 . C . . . AN=0;DP=67;END=9999991 GT:DP:GQ:MIN_DP:PL ./.:67:3:66:0 +20 9999992 . C . . . AN=0;DP=72;END=9999995 GT:DP:GQ:MIN_DP:PL ./.:72:0:68:0 20 9999996 . A . . . AN=0;BaseQRankSum=-7.585e+00;DP=154;MQ=60.17;MQRankSum=-7.653e+00;ReadPosRankSum=-6.232e+00 GT:AD:GQ:PL:SAC:SB ./.:0:99:0:0,0:0,0,30,43 -20 9999997 . G . . . AN=0;DP=75 GT:DP:GQ:MIN_DP:PL ./.:75:0:75:0,0,0 -20 9999998 . T . . . AN=0;DP=83;END=10000116 GT:DP:GQ:MIN_DP:PL ./.:83:99:66:0,120,1800 +20 9999997 . G . . . AN=0;DP=75 GT:DP:GQ:MIN_DP:PL ./.:75:0:75:0 +20 9999998 . T . . . AN=0;DP=83;END=10000116 GT:DP:GQ:MIN_DP:PL ./.:83:99:66:0 20 10000117 . C . . . AN=0;DP=132;MQ=59.64 GT:AD:GQ:PL:SAC:SB ./.:0:99:0:0,0:0,0,36,28 -20 10000118 . T . . . AN=0;DP=58;END=10000210 GT:DP:GQ:MIN_DP:PL ./.:58:99:50:0,120,1800 +20 10000118 . T . . . AN=0;DP=58;END=10000210 GT:DP:GQ:MIN_DP:PL ./.:58:99:50:0 20 10000211 . C . . . AN=0;DP=128;MQ=59.62 GT:AD:GQ:PL:SAC:SB ./.:0:99:0:0,0:0,0,32,27 -20 10000212 . A . . . AN=0;DP=65;END=10000236 GT:DP:GQ:MIN_DP:PL ./.:65:99:60:0,120,1800 +20 10000212 . A . . . AN=0;DP=65;END=10000236 GT:DP:GQ:MIN_DP:PL ./.:65:99:60:0 diff --git a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACNonDiploid.vcf b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACNonDiploid.vcf index e22d0778d88..3cc412b8a21 100644 --- a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACNonDiploid.vcf +++ b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_SACNonDiploid.vcf @@ -175,83 +175,83 @@ ##contig= ##contig= #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12891 -20 9999900 . G . . . AN=0;DP=0;END=9999901 GT:DP:GQ:MIN_DP:PL ./././.:0:0:0:0,0,0,0,0 -20 9999902 . T . . . AN=0;DP=1 GT:DP:GQ:MIN_DP:PL ./././.:1:1:1:0,1,3,6,39 -20 9999903 . G . . . AN=0;DP=1 GT:DP:GQ:MIN_DP:PL ./././.:1:1:1:0,1,3,6,39 -20 9999904 . T . . . AN=0;DP=2 GT:DP:GQ:MIN_DP:PL ./././.:2:2:2:0,2,6,12,78 -20 9999905 . T . . . AN=0;DP=2;END=9999906 GT:DP:GQ:MIN_DP:PL ./././.:2:2:2:0,2,6,12,78 -20 9999907 . A . . . AN=0;DP=4;END=9999908 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0,5,12,24,149 -20 9999909 . A . . . AN=0;DP=4 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0,5,12,24,149 -20 9999910 . T . . . AN=0;DP=4 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0,5,12,24,149 -20 9999911 . T . . . AN=0;DP=4 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0,5,12,24,149 -20 9999912 . C . . . AN=0;DP=5 GT:DP:GQ:MIN_DP:PL ./././.:5:6:5:0,6,15,30,187 -20 9999913 . A . . . AN=0;DP=5 GT:DP:GQ:MIN_DP:PL ./././.:5:6:5:0,6,15,30,187 -20 9999914 . A . . . AN=0;DP=5 GT:DP:GQ:MIN_DP:PL ./././.:5:6:5:0,6,15,30,187 -20 9999915 . C . . . AN=0;DP=6 GT:DP:GQ:MIN_DP:PL ./././.:6:7:6:0,7,18,36,227 -20 9999916 . T . . . AN=0;DP=7 GT:DP:GQ:MIN_DP:PL ./././.:7:9:7:0,9,21,42,272 -20 9999917 . G . . . AN=0;DP=9;END=9999918 GT:DP:GQ:MIN_DP:PL ./././.:9:11:9:0,11,27,54,333 -20 9999919 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./././.:11:14:11:0,14,33,66,395 -20 9999920 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./././.:11:14:11:0,14,33,66,395 -20 9999921 . A . . . AN=0;DP=13 GT:DP:GQ:MIN_DP:PL ./././.:13:16:13:0,16,39,78,508 -20 9999922 . T . . . AN=0;DP=14 GT:DP:GQ:MIN_DP:PL ./././.:14:17:14:0,17,42,84,537 -20 9999923 . A . . . AN=0;DP=16 GT:DP:GQ:MIN_DP:PL ./././.:16:20:16:0,20,48,96,626 -20 9999924 . G . . . AN=0;DP=17 GT:DP:GQ:MIN_DP:PL ./././.:17:21:17:0,21,51,102,641 -20 9999925 . G . . . AN=0;DP=17 GT:DP:GQ:MIN_DP:PL ./././.:17:21:17:0,21,51,102,641 -20 9999926 . T . . . AN=0;DP=18;END=9999929 GT:DP:GQ:MIN_DP:PL ./././.:18:22:18:0,22,54,108,674 -20 9999930 . T . . . AN=0;DP=18 GT:DP:GQ:MIN_DP:PL ./././.:18:22:18:0,22,54,108,674 -20 9999931 . T . . . AN=0;DP=21;END=9999933 GT:DP:GQ:MIN_DP:PL ./././.:21:26:21:0,26,63,126,764 -20 9999934 . T . . . AN=0;DP=25 GT:DP:GQ:MIN_DP:PL ./././.:25:20:25:0,20,60,130,920 -20 9999935 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./././.:26:32:26:0,32,78,156,1020 -20 9999936 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./././.:26:23:26:0,23,65,138,986 -20 9999937 . A . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./././.:26:32:26:0,32,78,156,996 -20 9999938 . T . . . AN=0;DP=27 GT:DP:GQ:MIN_DP:PL ./././.:27:34:27:0,34,81,162,1068 -20 9999939 . T . . . AN=0;DP=28 GT:DP:GQ:MIN_DP:PL ./././.:28:35:28:0,35,84,168,1122 -20 9999940 . T . . . AN=0;DP=29;END=9999941 GT:DP:GQ:MIN_DP:PL ./././.:29:36:29:0,36,87,174,1097 -20 9999942 . T . . . AN=0;DP=29;END=9999943 GT:DP:GQ:MIN_DP:PL ./././.:29:36:29:0,36,87,174,1097 -20 9999944 . T . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./././.:29:36:29:0,36,87,174,1097 -20 9999945 . A . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./././.:29:28:29:0,28,75,157,1008 -20 9999946 . C . . . AN=0;DP=33;END=9999951 GT:DP:GQ:MIN_DP:PL ./././.:33:40:32:0,40,96,191,1208 -20 9999952 . G . . . AN=0;DP=36 GT:DP:GQ:MIN_DP:PL ./././.:36:37:36:0,37,90,181,1350 -20 9999953 . T . . . AN=0;DP=38 GT:DP:GQ:MIN_DP:PL ./././.:38:36:37:0,36,87,175,1305 -20 9999954 . A . . . AN=0;DP=38 GT:DP:GQ:MIN_DP:PL ./././.:38:36:37:0,36,87,175,1305 -20 9999955 . G . . . AN=0;DP=41 GT:DP:GQ:MIN_DP:PL ./././.:41:37:39:0,37,90,181,1350 -20 9999956 . A . . . AN=0;DP=41 GT:DP:GQ:MIN_DP:PL ./././.:41:37:39:0,37,90,181,1350 -20 9999957 . T . . . AN=0;DP=44 GT:DP:GQ:MIN_DP:PL ./././.:44:35:44:0,35,84,169,1260 -20 9999958 . T . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:34:45:0,34,81,163,1215 -20 9999959 . C . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:34:45:0,34,81,163,1215 -20 9999960 . C . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:30:48:0,30,72,144,1080 -20 9999961 . A . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:29:48:0,29,69,138,1035 -20 9999962 . T . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:27:48:0,27,66,132,990 -20 9999963 . T . . . AN=0;DP=49 GT:DP:GQ:MIN_DP:PL ./././.:49:25:48:0,25,60,120,900 -20 9999964 . G . . . AN=0;DP=49;END=9999965 GT:DP:GQ:MIN_DP:PL ./././.:49:25:48:0,25,60,120,900 -20 9999966 . C . . . AN=0;DP=49 GT:DP:GQ:MIN_DP:PL ./././.:49:24:49:0,24,57,114,855 -20 9999967 . C . . . AN=0;DP=50 GT:DP:GQ:MIN_DP:PL ./././.:50:20:50:0,20,48,96,720 -20 9999968 . T . . . AN=0;DP=52;END=9999971 GT:DP:GQ:MIN_DP:PL ./././.:52:19:50:0,19,45,90,675 -20 9999972 . T . . . AN=0;DP=54;END=9999975 GT:DP:GQ:MIN_DP:PL ./././.:54:16:53:0,16,39,78,585 -20 9999976 . T . . . AN=0;DP=55;END=9999977 GT:DP:GQ:MIN_DP:PL ./././.:55:14:54:0,14,33,66,495 -20 9999978 . T . . . AN=0;DP=55 GT:DP:GQ:MIN_DP:PL ./././.:55:14:54:0,14,33,66,495 -20 9999979 . C . . . AN=0;DP=57 GT:DP:GQ:MIN_DP:PL ./././.:57:11:57:0,11,27,54,405 -20 9999980 . C . . . AN=0;DP=59 GT:DP:GQ:MIN_DP:PL ./././.:59:9:59:0,9,21,42,315 -20 9999981 . T . . . AN=0;DP=60 GT:DP:GQ:MIN_DP:PL ./././.:60:6:60:0,6,15,30,225 -20 9999982 . T . . . AN=0;DP=63;END=9999983 GT:DP:GQ:MIN_DP:PL ./././.:63:5:62:0,5,12,24,180 -20 9999984 . T . . . AN=0;DP=63;END=9999985 GT:DP:GQ:MIN_DP:PL ./././.:63:5:62:0,5,12,24,180 -20 9999986 . C . . . AN=0;DP=63 GT:DP:GQ:MIN_DP:PL ./././.:63:5:62:0,5,12,24,180 -20 9999987 . C . . . AN=0;DP=67;END=9999988 GT:DP:GQ:MIN_DP:PL ./././.:67:1:66:0,1,3,6,45 -20 9999989 . G . . . AN=0;DP=67;END=9999990 GT:DP:GQ:MIN_DP:PL ./././.:67:1:66:0,1,3,6,45 -20 9999991 . A . . . AN=0;DP=67 GT:DP:GQ:MIN_DP:PL ./././.:67:1:66:0,1,3,6,45 -20 9999992 . C . . . AN=0;DP=72;END=9999995 GT:DP:GQ:MIN_DP:PL ./././.:72:0:68:0,0,0,0,0 +20 9999900 . G . . . AN=0;DP=0;END=9999901 GT:DP:GQ:MIN_DP:PL ./././.:0:0:0:0 +20 9999902 . T . . . AN=0;DP=1 GT:DP:GQ:MIN_DP:PL ./././.:1:1:1:0 +20 9999903 . G . . . AN=0;DP=1 GT:DP:GQ:MIN_DP:PL ./././.:1:1:1:0 +20 9999904 . T . . . AN=0;DP=2 GT:DP:GQ:MIN_DP:PL ./././.:2:2:2:0 +20 9999905 . T . . . AN=0;DP=2;END=9999906 GT:DP:GQ:MIN_DP:PL ./././.:2:2:2:0 +20 9999907 . A . . . AN=0;DP=4;END=9999908 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0 +20 9999909 . A . . . AN=0;DP=4 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0 +20 9999910 . T . . . AN=0;DP=4 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0 +20 9999911 . T . . . AN=0;DP=4 GT:DP:GQ:MIN_DP:PL ./././.:4:5:4:0 +20 9999912 . C . . . AN=0;DP=5 GT:DP:GQ:MIN_DP:PL ./././.:5:6:5:0 +20 9999913 . A . . . AN=0;DP=5 GT:DP:GQ:MIN_DP:PL ./././.:5:6:5:0 +20 9999914 . A . . . AN=0;DP=5 GT:DP:GQ:MIN_DP:PL ./././.:5:6:5:0 +20 9999915 . C . . . AN=0;DP=6 GT:DP:GQ:MIN_DP:PL ./././.:6:7:6:0 +20 9999916 . T . . . AN=0;DP=7 GT:DP:GQ:MIN_DP:PL ./././.:7:9:7:0 +20 9999917 . G . . . AN=0;DP=9;END=9999918 GT:DP:GQ:MIN_DP:PL ./././.:9:11:9:0 +20 9999919 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./././.:11:14:11:0 +20 9999920 . C . . . AN=0;DP=11 GT:DP:GQ:MIN_DP:PL ./././.:11:14:11:0 +20 9999921 . A . . . AN=0;DP=13 GT:DP:GQ:MIN_DP:PL ./././.:13:16:13:0 +20 9999922 . T . . . AN=0;DP=14 GT:DP:GQ:MIN_DP:PL ./././.:14:17:14:0 +20 9999923 . A . . . AN=0;DP=16 GT:DP:GQ:MIN_DP:PL ./././.:16:20:16:0 +20 9999924 . G . . . AN=0;DP=17 GT:DP:GQ:MIN_DP:PL ./././.:17:21:17:0 +20 9999925 . G . . . AN=0;DP=17 GT:DP:GQ:MIN_DP:PL ./././.:17:21:17:0 +20 9999926 . T . . . AN=0;DP=18;END=9999929 GT:DP:GQ:MIN_DP:PL ./././.:18:22:18:0 +20 9999930 . T . . . AN=0;DP=18 GT:DP:GQ:MIN_DP:PL ./././.:18:22:18:0 +20 9999931 . T . . . AN=0;DP=21;END=9999933 GT:DP:GQ:MIN_DP:PL ./././.:21:26:21:0 +20 9999934 . T . . . AN=0;DP=25 GT:DP:GQ:MIN_DP:PL ./././.:25:20:25:0 +20 9999935 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./././.:26:32:26:0 +20 9999936 . T . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./././.:26:23:26:0 +20 9999937 . A . . . AN=0;DP=26 GT:DP:GQ:MIN_DP:PL ./././.:26:32:26:0 +20 9999938 . T . . . AN=0;DP=27 GT:DP:GQ:MIN_DP:PL ./././.:27:34:27:0 +20 9999939 . T . . . AN=0;DP=28 GT:DP:GQ:MIN_DP:PL ./././.:28:35:28:0 +20 9999940 . T . . . AN=0;DP=29;END=9999941 GT:DP:GQ:MIN_DP:PL ./././.:29:36:29:0 +20 9999942 . T . . . AN=0;DP=29;END=9999943 GT:DP:GQ:MIN_DP:PL ./././.:29:36:29:0 +20 9999944 . T . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./././.:29:36:29:0 +20 9999945 . A . . . AN=0;DP=29 GT:DP:GQ:MIN_DP:PL ./././.:29:28:29:0 +20 9999946 . C . . . AN=0;DP=33;END=9999951 GT:DP:GQ:MIN_DP:PL ./././.:33:40:32:0 +20 9999952 . G . . . AN=0;DP=36 GT:DP:GQ:MIN_DP:PL ./././.:36:37:36:0 +20 9999953 . T . . . AN=0;DP=38 GT:DP:GQ:MIN_DP:PL ./././.:38:36:37:0 +20 9999954 . A . . . AN=0;DP=38 GT:DP:GQ:MIN_DP:PL ./././.:38:36:37:0 +20 9999955 . G . . . AN=0;DP=41 GT:DP:GQ:MIN_DP:PL ./././.:41:37:39:0 +20 9999956 . A . . . AN=0;DP=41 GT:DP:GQ:MIN_DP:PL ./././.:41:37:39:0 +20 9999957 . T . . . AN=0;DP=44 GT:DP:GQ:MIN_DP:PL ./././.:44:35:44:0 +20 9999958 . T . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:34:45:0 +20 9999959 . C . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:34:45:0 +20 9999960 . C . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:30:48:0 +20 9999961 . A . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:29:48:0 +20 9999962 . T . . . AN=0;DP=48 GT:DP:GQ:MIN_DP:PL ./././.:48:27:48:0 +20 9999963 . T . . . AN=0;DP=49 GT:DP:GQ:MIN_DP:PL ./././.:49:25:48:0 +20 9999964 . G . . . AN=0;DP=49;END=9999965 GT:DP:GQ:MIN_DP:PL ./././.:49:25:48:0 +20 9999966 . C . . . AN=0;DP=49 GT:DP:GQ:MIN_DP:PL ./././.:49:24:49:0 +20 9999967 . C . . . AN=0;DP=50 GT:DP:GQ:MIN_DP:PL ./././.:50:20:50:0 +20 9999968 . T . . . AN=0;DP=52;END=9999971 GT:DP:GQ:MIN_DP:PL ./././.:52:19:50:0 +20 9999972 . T . . . AN=0;DP=54;END=9999975 GT:DP:GQ:MIN_DP:PL ./././.:54:16:53:0 +20 9999976 . T . . . AN=0;DP=55;END=9999977 GT:DP:GQ:MIN_DP:PL ./././.:55:14:54:0 +20 9999978 . T . . . AN=0;DP=55 GT:DP:GQ:MIN_DP:PL ./././.:55:14:54:0 +20 9999979 . C . . . AN=0;DP=57 GT:DP:GQ:MIN_DP:PL ./././.:57:11:57:0 +20 9999980 . C . . . AN=0;DP=59 GT:DP:GQ:MIN_DP:PL ./././.:59:9:59:0 +20 9999981 . T . . . AN=0;DP=60 GT:DP:GQ:MIN_DP:PL ./././.:60:6:60:0 +20 9999982 . T . . . AN=0;DP=63;END=9999983 GT:DP:GQ:MIN_DP:PL ./././.:63:5:62:0 +20 9999984 . T . . . AN=0;DP=63;END=9999985 GT:DP:GQ:MIN_DP:PL ./././.:63:5:62:0 +20 9999986 . C . . . AN=0;DP=63 GT:DP:GQ:MIN_DP:PL ./././.:63:5:62:0 +20 9999987 . C . . . AN=0;DP=67;END=9999988 GT:DP:GQ:MIN_DP:PL ./././.:67:1:66:0 +20 9999989 . G . . . AN=0;DP=67;END=9999990 GT:DP:GQ:MIN_DP:PL ./././.:67:1:66:0 +20 9999991 . A . . . AN=0;DP=67 GT:DP:GQ:MIN_DP:PL ./././.:67:1:66:0 +20 9999992 . C . . . AN=0;DP=72;END=9999995 GT:DP:GQ:MIN_DP:PL ./././.:72:0:68:0 20 9999996 . A . . . AN=0;DP=158;MQ=60.21 GT:AD:GQ:PL:SAC:SB ./././.:0:96:0:0,0:0,0,30,43 -20 9999997 . G . . . AN=0;DP=75 GT:DP:GQ:MIN_DP:PL ./././.:75:0:75:0,0,0,0,0 -20 9999998 . T . . . AN=0;DP=83;END=10000116 GT:DP:GQ:MIN_DP:PL ./././.:83:50:66:0,50,120,241,1800 +20 9999997 . G . . . AN=0;DP=75 GT:DP:GQ:MIN_DP:PL ./././.:75:0:75:0 +20 9999998 . T . . . AN=0;DP=83;END=10000116 GT:DP:GQ:MIN_DP:PL ./././.:83:50:66:0 20 10000117 . C . . . AN=0;BaseQRankSum=-6.516e+00;DP=128;MQ=59.71;MQRankSum=-6.814e+00;ReadPosRankSum=-6.597e+00 GT:AD:GQ:PL:SAC:SB ./././.:0:80:0:0,0:0,0,36,28 -20 10000118 . T . . . AN=0;DP=67;END=10000158 GT:DP:GQ:MIN_DP:PL ./././.:67:50:55:0,50,120,241,1800 -20 10000159 . G . . . AN=0;DP=57 GT:DP:GQ:MIN_DP:PL ./././.:57:37:57:0,37,133,299,2178 -20 10000160 . G . . . AN=0;DP=56;END=10000181 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0,50,120,241,1800 -20 10000182 . A . . . AN=0;DP=56 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0,50,120,241,1800 -20 10000183 . A . . . AN=0;DP=56;END=10000184 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0,50,120,241,1800 -20 10000185 . C . . . AN=0;DP=56;END=10000186 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0,50,120,241,1800 -20 10000187 . G . . . AN=0;DP=56;END=10000201 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0,50,120,241,1800 -20 10000202 . G . . . AN=0;DP=56 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0,50,120,241,1800 -20 10000203 . A . . . AN=0;DP=56;END=10000210 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0,50,120,241,1800 +20 10000118 . T . . . AN=0;DP=67;END=10000158 GT:DP:GQ:MIN_DP:PL ./././.:67:50:55:0 +20 10000159 . G . . . AN=0;DP=57 GT:DP:GQ:MIN_DP:PL ./././.:57:37:57:0 +20 10000160 . G . . . AN=0;DP=56;END=10000181 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0 +20 10000182 . A . . . AN=0;DP=56 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0 +20 10000183 . A . . . AN=0;DP=56;END=10000184 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0 +20 10000185 . C . . . AN=0;DP=56;END=10000186 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0 +20 10000187 . G . . . AN=0;DP=56;END=10000201 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0 +20 10000202 . G . . . AN=0;DP=56 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0 +20 10000203 . A . . . AN=0;DP=56;END=10000210 GT:DP:GQ:MIN_DP:PL ./././.:56:50:50:0 20 10000211 . C . . . AN=0;BaseQRankSum=-6.023e+00;DP=114;MQ=59.65;MQRankSum=-6.236e+00;ReadPosRankSum=-5.845e+00 GT:AD:GQ:PL:SAC:SB ./././.:0:74:0:0,0:0,0,32,27 -20 10000212 . A . . . AN=0;DP=65;END=10000236 GT:DP:GQ:MIN_DP:PL ./././.:65:50:60:0,50,120,241,1800 +20 10000212 . A . . . AN=0;DP=65;END=10000236 GT:DP:GQ:MIN_DP:PL ./././.:65:50:60:0 diff --git a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/vcfexample.loseAlleleInSelection.vcf b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/vcfexample.loseAlleleInSelection.vcf index f650b046758..fc0eb1be760 100644 --- a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/vcfexample.loseAlleleInSelection.vcf +++ b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/vcfexample.loseAlleleInSelection.vcf @@ -4,4 +4,4 @@ #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12891 NA12892 20 10000000 . T G . PASS AC=2;AN=4;MLEAC=3 GT:PL 0/1:10,0,10 0/1:10,0,12 20 10000117 . C T . PASS AC=1;AN=4;MLEAC=2 GT:PL 0/1:10,0,10 0/0:0,10,80 -20 10000211 . C A,T . PASS AC=1,2;AN=4;MLEAC=1,2 GT:PL 0/1:10,0,10 2/2:90,10,0 +20 10000211 . C A,T . PASS AC=1,2;AN=4;MLEAC=1,2 GT:PL 0/1:10,0,10,40,40,60 2/2:90,10,60,10,50,0 diff --git a/src/testUtils/java/org/broadinstitute/hellbender/testutils/VariantContextTestUtils.java b/src/testUtils/java/org/broadinstitute/hellbender/testutils/VariantContextTestUtils.java index febf245b2ba..2fffce91d8a 100644 --- a/src/testUtils/java/org/broadinstitute/hellbender/testutils/VariantContextTestUtils.java +++ b/src/testUtils/java/org/broadinstitute/hellbender/testutils/VariantContextTestUtils.java @@ -539,6 +539,10 @@ public static void assertVariantContextsHaveSameGenotypes(final VariantContext a } } + public static void assertVariantContextMaxAltAlleleCount(final VariantContext actual, final Integer maxAltAlleles) { + Assert.assertTrue(actual.getAlternateAlleles().size() <= maxAltAlleles); + } + /** * Method which compares two variant contexts for equality regardless of different allele ordering. * @@ -597,6 +601,10 @@ public static Genotype makeG(final String sample, final Allele a1, final Allele return new GenotypeBuilder(sample, Arrays.asList(a1, a2)).PL(pls).make(); } + public static Genotype makeG(final String sample, final int gq, final Allele a1, final Allele a2, final int... pls) { + return new GenotypeBuilder(sample, Arrays.asList(a1, a2)).GQ(gq).PL(pls).make(); + } + public static VariantContext makeVC(final String source, final List alleles, final Genotype... genotypes) { final int start = 10; final int stop = start; // does the stop actually get validated??? If it does then `new VariantContextBuilder().computeEndFromAlleles(alleles)...`