-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert AF calculation bug and yet another reblocking fix #7670
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5562afe
Fix automatic zeroing of array end/non-ref data because sometimes the…
ldgauthier 7339c05
Previous version had bad AN values
ldgauthier a245499
Be more clear about max alts arg; don't let no-calls get inferred
ldgauthier baab476
Hook up new max alt GDB arg to Gnarly
ldgauthier 04cd52c
Allow Gnarly's max alt count to be changed via GenotypeCalculateArgs
ldgauthier d107744
Oops, broke GGVCFs
ldgauthier b8456e5
Add regression test for GGVCFs max alt arg mixup
ldgauthier b51cb54
Every. Single. Time.
ldgauthier dc9ccd5
Address review comments; just cleanup
ldgauthier 8f71a0d
Actually delete empty test
ldgauthier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,7 +156,12 @@ public Object[][] gvcfsToGenotype() { | |
{getTestFile( "combined.single.sample.pipeline.gatk3.vcf"), | ||
getTestFile( "expected/includeLowQualSites.vcf"), | ||
Arrays.asList( " --" + GenotypeGVCFs.ALL_SITES_LONG_NAME + " -L 20:10,012,730-10,012,740"), | ||
b37_reference_20_21} | ||
b37_reference_20_21}, | ||
|
||
//23 highly multi-allelic sites across 54 1000G exomes to test allele subsetting and QUAL calculation | ||
{getTestFile("multiallelicQualRegression.vcf "), | ||
getTestFile("multiallelicQualRegression.expected.vcf"), | ||
NO_EXTRA_ARGS, hg38Reference} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You've confirmed that this new test case fails with 4.2.5.0? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes -- it fails like the Hindenburg. |
||
}; | ||
} | ||
|
||
|
@@ -281,23 +286,35 @@ public void assertMatchingGenotypesFromGenomicsDB(File input, File expected, Loc | |
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<String> args = new ArrayList<String>(); | ||
@Test //here GDBMaxAlts is greater than GGVCFsMaxAlts | ||
public void testMaxAltsToCombineInGenomicsDB() throws IOException { | ||
//multi-input tests | ||
//8 ALT VC will get dropped if GDB max is < 8 because GDB doesn't return PLs and GGVCFs drops variants with no PLs | ||
final String gnarlyTestPath = toolsTestDir + "walkers/GnarlyGenotyper/"; | ||
final List<File> inputs = Arrays.asList(new File(gnarlyTestPath + "sample6.vcf"), | ||
new File(gnarlyTestPath + "sample7.vcf"), | ||
new File(gnarlyTestPath + "sample8.vcf"), | ||
new File(gnarlyTestPath + "sample9.vcf")); | ||
final SimpleInterval interval = new SimpleInterval("chr20", 257008, 257008); | ||
final File tempGenomicsDB2 = GenomicsDBTestUtils.createTempGenomicsDB(inputs, interval); | ||
final String genomicsDBUri2 = GenomicsDBTestUtils.makeGenomicsDBUri(tempGenomicsDB2); | ||
final List<String> args = new ArrayList<>(); | ||
args.add("--"+GenomicsDBArgumentCollection.MAX_ALTS_LONG_NAME); | ||
args.add("7"); | ||
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.add("5"); | ||
final File output = runGenotypeGVCFS(genomicsDBUri2, null, args, hg38Reference); | ||
final Pair<VCFHeader, List<VariantContext>> outputDataNoVariant = VariantContextTestUtils.readEntireVCFIntoMemory(output.getAbsolutePath()); | ||
Assert.assertTrue(outputDataNoVariant.getRight().isEmpty()); | ||
|
||
args.clear(); | ||
//8 ALT VC will be output if GDB max is >= 8, but with only as many ALTs are requested in the GenotypeCalculationArguments | ||
final List<String> args2 = new ArrayList<String>(); | ||
args.add("--"+GenomicsDBArgumentCollection.MAX_ALTS_LONG_NAME); | ||
args.add("15"); | ||
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); | ||
args.add("5"); | ||
runGenotypeGVCFSAndAssertComparison(genomicsDBUri2, getTestFile("fourSamplesEightAlts.expected.vcf"), args2, | ||
VariantContextTestUtils::assertVariantContextsHaveSameGenotypes, hg38Reference); | ||
} | ||
|
||
@Test(expectedExceptions = UserException.BadInput.class) | ||
|
@@ -333,7 +350,7 @@ private void runAndCheckGenomicsDBOutput(final ArgumentsBuilder args, final File | |
runCommandLine(args); | ||
|
||
// Note that if this isn't working it will take *FOREVER* | ||
// runs in 0.06 minutes with no input intervals specfied | ||
// runs in 0.06 minutes with no input intervals specified | ||
final List<VariantContext> expectedVC = VariantContextTestUtils.getVariantContexts(expected); | ||
final List<VariantContext> actualVC = VariantContextTestUtils.getVariantContexts(output); | ||
assertForEachElementInLists(actualVC, expectedVC, VariantContextTestUtils::assertVariantContextsHaveSameGenotypes); | ||
|
@@ -422,6 +439,10 @@ private void runGenotypeGVCFSAndAssertComparison(File input, File expected, List | |
); | ||
} | ||
|
||
|
||
/** | ||
* Note that this method does not use expected for comparison, but rather for updating exact match outputs | ||
*/ | ||
private File runGenotypeGVCFS(String input, File expected, List<String> additionalArguments, String reference) { | ||
final File output = UPDATE_EXACT_MATCH_EXPECTED_OUTPUTS ? expected : createTempFile("genotypegvcf", ".vcf"); | ||
final ArgumentsBuilder args = new ArgumentsBuilder(); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment documenting why we're using
GenotypeAssignmentMethod.USE_PLS_TO_ASSIGN
here instead of theGenotypeAssignmentMethod.BEST_MATCH_TO_ORIGINAL
we're using everywhere else.