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

Fix NPE in VariantEval when run with no intervals/reference #6283

Merged
merged 4 commits into from
Dec 18, 2019

Conversation

lbergelson
Copy link
Member

@droazen droazen self-assigned this Dec 9, 2019
Copy link
Contributor

@droazen droazen left a comment

Choose a reason for hiding this comment

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

One question/comment @lbergelson, otherwise looks good

@@ -488,6 +492,7 @@ public void onComplete() {

@Override
public void apply(VariantContext variant, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext) {
referencePositionsCoveredByVariants += variant.getLengthOnReference();
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't you double-count territory for overlapping variants? Does this matter?

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed in person, it might be preferable, instead of returning a nonsense value here, to add a requiresReference() (or similar) method to the VariantEvaluator class, interrogate the selected evaluations in onTraversalStart() in VariantEval, and throw an error if any of the selected evaluations require a reference.

* Fixes an NPE that happened when using certain evaluators with VariantEval and not specifying a reference or intervals
* Fixes #6212
@gatk-bot
Copy link

gatk-bot commented Dec 10, 2019

Travis reported job failures from build 28328
Failures in the following jobs:

Test Type JDK Job ID Logs
python openjdk8 28328.5 logs
python openjdk8 28328.5 logs

@lbergelson
Copy link
Member Author

@droazen I responded to your comments. This is way to much code to deal with this trivial edge case, but now it's Done Right™

Copy link
Contributor

@droazen droazen left a comment

Choose a reason for hiding this comment

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

Two minor comments to address @lbergelson , otherwise looks good. Feel free to merge after addressing them.

}

private void assertThatTerritoryIsSpecifiedIfNecessary() {
final Set<String> evaluatorsWichRequireTerritory = stratManager.values()
Copy link
Contributor

Choose a reason for hiding this comment

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

Wich -> Which

Copy link
Member Author

Choose a reason for hiding this comment

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

whoops, good catch

@@ -0,0 +1,18 @@
package org.broadinstitute.hellbender.tools.walkers.varianteval.evaluators;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned that this test class will be picked up by the reflection code in the main tool and exposed to the user, since it's in the standard evaluator package.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a reasonable concern, but this is in the test code, so it should not be available to the main tool at runtime.

@droazen droazen assigned lbergelson and unassigned droazen Dec 18, 2019
@gatk-bot
Copy link

Travis reported job failures from build 28412
Failures in the following jobs:

Test Type JDK Job ID Logs
python openjdk8 28412.5 logs

@lbergelson lbergelson merged commit 617d565 into master Dec 18, 2019
@lbergelson lbergelson deleted the lb_variant_eval_npe branch December 18, 2019 22:17
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.

NullPointerException error while running VariantEval
3 participants