Skip to content
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

Bug with passing max_alternate_alleles to GenomicsDB #7576

Merged
merged 5 commits into from
Jan 4, 2022

Conversation

nalinigans
Copy link
Collaborator

This was unearthed by #7542 and is plumbed correctly in this PR.

Note that we need to still address the broader issue of hooking arguments to GenomicsDB - #6456 . GenomicsDB exposes a whole set of export arguments all added in response of gatk requests, some of them are hardcoded by certain tools(e.g GenotypeGVCFs uses --max-alternate-alleles while SelectVariants does not), many are unused.

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nalinigans I have a few comments for you and also some vague complaints shouted into the void.

this.useBCFCodec = genomicsdbArgs.useBCFCodec;
this.sharedPosixFSOptimizations = genomicsdbArgs.sharedPosixFSOptimizations;
this.useGcsHdfsConnector = genomicsdbArgs.useGcsHdfsConnector;
if (genotypeCalcArgs != null) {
this.maxDiploidAltAllelesThatCanBeGenotyped = genotypeCalcArgs.MAX_ALTERNATE_ALLELES;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't your doing, but it's super confusing that this is in ALL_CAPS because it made me assume it was a constant and not the value that was set.

@@ -25,18 +25,24 @@ public GenomicsDBOptions(final Path reference) {
}

public GenomicsDBOptions(final Path reference, GenomicsDBArgumentCollection genomicsdbArgs) {
this(reference, genomicsdbArgs, new GenotypeCalculationArgumentCollection(), false);
this(reference, genomicsdbArgs, new GenotypeCalculationArgumentCollection());
}

public GenomicsDBOptions(final Path reference, final GenomicsDBArgumentCollection genomicsdbArgs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bleh, GenomicsDBOptions and GenomicsDBArgumentCollection are confusingly similar. We should probably revisit that at some point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should. As of now, GenomicsDBOptions is a combination of GenomicsDBArgumentCollection and GenotypeCalculationArgumentCollection.

@@ -173,8 +173,9 @@ public boolean requiresReference() {
@Override
protected GenomicsDBOptions getGenomicsDBOptions() {
if (genomicsDBOptions == null) {
genomicsdbArgs.maxDiploidAltAllelesThatCanBeGenotyped = PIPELINE_MAX_ALT_COUNT;
genomicsDBOptions = new GenomicsDBOptions(referenceArguments.getReferencePath(), genomicsdbArgs, genotypeArgs, CALL_GENOTYPES);
genomicsdbArgs.callGenotypes = CALL_GENOTYPES;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a minor bug. Previously I think it would force call if either --call-genotypes was set OR CALL_GENOTYPES was true. Now it only takes CALL_GENOTYPES into account.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since CALL_GENOTYPES is hardcoded to true, I wanted to explicitly override the arguments and be consistent with what is done for maxDiploidAltAllelesThatCanBeGenotyped.

try {
File output = runGenotypeGVCFS(genomicsDBUri, expected, args, reference);
Assert.assertTrue(output.exists());
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we catch a specific exception here instead of anything, otherwise it's possible the test is just passing because of a misspelled argument or something.

args.add("2"); // Too small max_alternate_alleles arg to GenomicsDB, should fail
try {
File output = runGenotypeGVCFS(genomicsDBUri, expected, args, reference);
Assert.assertTrue(output.exists());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're counting on this to fail instead of assertTrue(output.exists()) we should probably have a Assert.fail("Should have thrown an exception")

@nalinigans nalinigans requested a review from lbergelson January 3, 2022 03:09
Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @nalinigans

@lbergelson lbergelson merged commit 5b87367 into master Jan 4, 2022
@lbergelson lbergelson deleted the ng_genomicsdb_args branch January 4, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants