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

making gatk --version print the version #5537

Merged
merged 4 commits into from Jan 3, 2019
Merged

making gatk --version print the version #5537

merged 4 commits into from Jan 3, 2019

Conversation

lbergelson
Copy link
Member

closes #5533

@lbergelson
Copy link
Member Author

./gatk --version
Using GATK wrapper script /Users/louisb/Workspace/gatk/build/install/gatk/bin/gatk
Running:
    /Users/louisb/Workspace/gatk/build/install/gatk/bin/gatk --version
The Genome Analysis Toolkit (GATK) v4.0.12.0-1-g10aa8c7-SNAPSHOT

This is different than the output of the tool --version...

Using GATK wrapper script /Users/louisb/Workspace/gatk/build/install/gatk/bin/gatk
Running:
    /Users/louisb/Workspace/gatk/build/install/gatk/bin/gatk PrintReads --version
Version:4.0.12.0-1-g10aa8c7-SNAPSHOT
Tool returned:
0

I can change this to be that version, or we can change barclay to do it differently and provide more info. It might be useful to print the library versions with both commands as well.. that's printed during the normal run...

14:19:57.172 INFO  PrintReads - HTSJDK Version: 2.18.1
14:19:57.173 INFO  PrintReads - Picard Version: 2.18.16

@cmnbroad What do you think?

System.out.println(String.format("%s v%s", getToolkitName(), getVersion()));
return 0;
}
}.doWork();
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to find a solution that worked for downstream toolkits - I think this would only work if they repackaged GATK classes in their own jar ? I'm not sure I see an obvious solution that doesn't involve a lot more work though.

Either way, what do you think about adding a couple of methods to RuntimeUtils or somewhere that get the toolkit name and version number from the manifest, and then call those from here and from the corresponding CommandLineProgram methods ? It still wouldn't completely solve the downstream toolkit issue, but at least we wouldn't have to spin up a dummy CLP. Longer term I really want to fix the special argument handling and delegation in Barclay.

Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW, by "from the manifest" I meant "they way they do now", ie., getClass().getPackage().getImplementationVersion().

@sooheelee
Copy link
Contributor

This is great. For what it's worth, I would love for the Picard and HTSJDK versions to print also with gatk --version.

@lbergelson lbergelson force-pushed the lb_version branch 2 times, most recently from ce58ba3 to 54cb2be Compare December 21, 2018 18:15
@lbergelson
Copy link
Member Author

@cmnbroad I extracted a bunch of methods to RunTimeUtils and made it cleaner. I fixed a todo in CommandLineProgram that was related as well. It's hard to test these things because the tests sometimes but don't always the jar with a manifest so I didn't test most of the new methods. I can try to do something more clever if you think it's necessary though...

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.

Looks great when test pass - thx for doing all that.

@codecov-io
Copy link

codecov-io commented Jan 2, 2019

Codecov Report

Merging #5537 into master will decrease coverage by 0.009%.
The diff coverage is 72.917%.

@@               Coverage Diff               @@
##              master     #5537       +/-   ##
===============================================
- Coverage     87.085%   87.075%   -0.009%     
- Complexity     31222     31227        +5     
===============================================
  Files           1915      1915               
  Lines         144079    144097       +18     
  Branches       15891     15899        +8     
===============================================
+ Hits          125471    125473        +2     
- Misses         12837     12841        +4     
- Partials        5771      5783       +12
Impacted Files Coverage Δ Complexity Δ
...ls/runtime/StreamingProcessControllerUnitTest.java 91% <ø> (-2.694%) 16 <0> (-2)
...t/java/org/broadinstitute/hellbender/MainTest.java 82.927% <100%> (+0.876%) 6 <1> (+1) ⬆️
...stitute/hellbender/utils/runtime/RuntimeUtils.java 70.588% <66.667%> (-3.096%) 10 <4> (+4)
...hellbender/utils/runtime/RuntimeUtilsUnitTest.java 87.5% <66.667%> (-12.5%) 4 <1> (+1)
.../main/java/org/broadinstitute/hellbender/Main.java 72.43% <69.231%> (-0.207%) 51 <1> (+3)
...stitute/hellbender/cmdline/CommandLineProgram.java 85.333% <80%> (+2.216%) 44 <6> (+1) ⬆️
...nder/utils/runtime/StreamingProcessController.java 67.299% <0%> (-4.265%) 33% <0%> (-4%)
...lotypecaller/readthreading/ReadThreadingGraph.java 88.861% <0%> (+0.253%) 145% <0%> (+1%) ⬆️

* extracting methods from CommandLineProgram -> RuntimeUtils for getting version and manifest attributes
* fixing a todo in CommandLineProgram
* opportunistically changing an instance of map.entryset().stream().foreach() -> map.foreach()
I was told that it is a flakey test that tests something that is no longer necessary.
@lbergelson
Copy link
Member Author

resolving merge conflicts...

@lbergelson
Copy link
Member Author

@cmnbroad You're ok with this test being removed? Just wanted to double check before merging.

@cmnbroad
Copy link
Collaborator

cmnbroad commented Jan 2, 2019

@lbergelson Yes - this test is a leftover artifact of the original implementation, but we're no longer dependent on the features tested it so its fine to remove.

@lbergelson lbergelson merged commit 9562a48 into master Jan 3, 2019
@lbergelson lbergelson deleted the lb_version branch January 3, 2019 03:33
@lbergelson lbergelson mentioned this pull request Feb 1, 2019
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.

running gatk --version should print the version instead of UserException
4 participants