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

Consolidate code in PedigreeAnnotation #7277

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

bbimber
Copy link
Contributor

@bbimber bbimber commented May 26, 2021

Consolidate code in PedigreeAnnotation, provide getters, and allow PedigreeValidationType to be set

@bbimber
Copy link
Contributor Author

bbimber commented May 26, 2021

@cmnbroad The use case behind this PR is custom PedigreeAnnotations outside GATK. Many of my proposed changes are just fixing typos or code-consolidation. The only other changes are adding protected getters for pedigreeFile, pedigreeValidationType, and sampleDB. I add a setter for pedigreeValidationType. Overall these should be pretty contained changes.

@bbimber
Copy link
Contributor Author

bbimber commented Jun 2, 2021

@cmnbroad Sorry to bug here, but I am wondering if it would be possible for someone to review. This is a limited change that basically consolidates some internal code in PedigreeAnnotation and exposes a couple protected getters. Tests are passing. Thanks in advance.

Copy link
Collaborator

@cmnbroad cmnbroad left a comment

Choose a reason for hiding this comment

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

@bbimber The existing implementation of the Pedigree annotation hierarchy is pretty cumbersome, and the changes proposed here somewhat exacerbate that. We really want to go in the direction of separating out Founder annotations from base Pedigree annotaionts as started here, but nobody has had the the bandwidth to finish that. I suggested a simpler alternative for the interim that hopefully addresses the issue (assuming the issue is just being able to control the validation param).

@bbimber
Copy link
Contributor Author

bbimber commented Jun 3, 2021

OK - PedigreeValidationType is now set in the constructor and is final. This does not separate the two intertwined codepaths around PedigreeFile vs. FounderIds, but that was a pre-existing problem. It doesnt doesnt change the pre-existing weirdness around the timing of setting pedigreeFile and/or founderIds within GATKAnnotationPluginDescriptor, where PedigreeAnnotation gets special treatment. I dont think this makes that situation any worse.

if you still have concerns on this proposal, I actually think I could make our code work if you simply exposed a protected getPedigreeFile() method on PedigreeAnnotation. I can make the SampleDB instance in my code without needed to share code here. It seemed useful to expose some of that code to avoid duplication, but if it's going to over-complicate we can remove it.

Also: that one test failure seems potentially unrelated (https://travis-ci.com/github/broadinstitute/gatk/jobs/510624560)? A compile issue with javadoc?

@cmnbroad
Copy link
Collaborator

cmnbroad commented Jun 7, 2021

@bbimber I was hoping this could be reduced to a single new File, PedigreeValidationType constructor overload, and the new File getter (and without any changes to the existing subclasses). Its also not a perfect solution, but I'd prefer to minimize addition of any new methods that expose founderIDs or SampleDB, since we aspire to factor out the existing code that uses those from this class completely. As for the failed test, it looks like the tests timed out for some reason, hopefully transient, but it I'm guessing its unrelated.

@bbimber
Copy link
Contributor Author

bbimber commented Jun 7, 2021

@cmnbroad OK - what about this proposal? I just added a protected getter and fixed the typo in 'annotation'? We could expose a constructor based way to set PedigreeValidationType, but if you dont really want to expose more of the guts of PedigreeAnnotation to subclasses prior to splitting apart founderIds and pedigree, what about keeping this as simple and minimal as possible?

@cmnbroad
Copy link
Collaborator

cmnbroad commented Jun 7, 2021

If that solves your issue, then thats even better. The one change I'd request then is that you add javadoc saying that the getter can return null, since its possible to construct a PedigreeAnnotation without a File. Then once tests pass it should be good.

@bbimber
Copy link
Contributor Author

bbimber commented Jun 7, 2021

@cmnbroad OK, added. travisci doesnt seem to have been kicked off - is that b/c github thinks there are unresolved change requests?

Copy link
Collaborator

@cmnbroad cmnbroad left a comment

Choose a reason for hiding this comment

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

LGTM once tests run and pass. @bbimber The issue with CI tests not running is being looked into. It may take a day or two to resolve.

@bbimber
Copy link
Contributor Author

bbimber commented Jun 7, 2021

@cmnbroad OK. so will you be able to squash/merge on github or do you want me to do it and push here?

@cmnbroad
Copy link
Collaborator

cmnbroad commented Jun 7, 2021

I can squash when I merge - thanks.

@cmnbroad
Copy link
Collaborator

cmnbroad commented Jun 8, 2021

@bbimber this should run on travis now, but you probably have to push the branch again to trigger it to start.

…digreeValidationType to be set

Consolidate constructors

Add final

Revert change to minimal needed getter

Revert prior change

Revert prior change

Add single getter for pedigreeFile

Add javadoc
@bbimber bbimber force-pushed the PedigreeAnnotation branch from 3f41d71 to 2b7f0c9 Compare June 8, 2021 15:45
@bbimber
Copy link
Contributor Author

bbimber commented Jun 8, 2021

@cmnbroad is seems there's a docker rate-limit issue again: https://travis-ci.com/github/broadinstitute/gatk/jobs/512098673

@cmnbroad cmnbroad merged commit 35e4ea8 into broadinstitute:master Jun 9, 2021
@bbimber bbimber deleted the PedigreeAnnotation branch June 9, 2021 13:41
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