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

rebase Dgs configure plugin packages #5573

Merged
merged 6 commits into from
Jan 23, 2019
Merged

Conversation

lbergelson
Copy link
Member

rebase of #4611 with fixes

@jamesemery
Copy link
Collaborator

@lbergelson Looks like the build failed with exception...

Copy link
Collaborator

@jamesemery jamesemery left a comment

Choose a reason for hiding this comment

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

After you fix the compiler error, you should really add a test for this plugin, maybe create a dummy annotation and/or read/filter in the test utils, then write a test that asserts that a tool can indeed detect both those annotations and the default annotations when you ask for a list of the annotations present.

@jamesemery jamesemery assigned lbergelson and unassigned jamesemery Jan 17, 2019
@lbergelson lbergelson force-pushed the dgs_configure_plugin_packages branch 2 times, most recently from 152f123 to 6dbc1c5 Compare January 18, 2019 21:50
@lbergelson
Copy link
Member Author

@jamesemery I think this is actually ready for review this time...

@codecov-io
Copy link

codecov-io commented Jan 18, 2019

Codecov Report

Merging #5573 into master will decrease coverage by 0.003%.
The diff coverage is 64.516%.

@@               Coverage Diff               @@
##              master     #5573       +/-   ##
===============================================
- Coverage     87.046%   87.043%   -0.003%     
- Complexity     31524     31533        +9     
===============================================
  Files           1928      1930        +2     
  Lines         145340    145387       +47     
  Branches       16089     16088        -1     
===============================================
+ Hits          126513    126549       +36     
- Misses         12966     12981       +15     
+ Partials        5861      5857        -4
Impacted Files Coverage Δ Complexity Δ
...ools/walkers/annotator/VariantAnnotatorEngine.java 91.304% <ø> (ø) 70 <0> (ø) ⬇️
...line/GATKPlugin/testpluggables/TestAnnotation.java 0% <0%> (ø) 0 <0> (?)
...line/GATKPlugin/testpluggables/TestReadFilter.java 0% <0%> (ø) 0 <0> (?)
...dinstitute/hellbender/engine/GATKToolUnitTest.java 91.017% <100%> (+0.473%) 71 <0> (ø) ⬇️
...ine/GATKPlugin/GATKReadFilterPluginDescriptor.java 83.846% <100%> (+0.252%) 49 <2> (ø) ⬇️
...GATKPlugin/GATKReadFilterPluginDescriptorTest.java 88.62% <50%> (-1.76%) 48 <1> (+1)
...Plugin/GATKAnnotationPluginDescriptorUnitTest.java 88.235% <63.158%> (-1.43%) 58 <1> (+1)
...rg/broadinstitute/hellbender/utils/ClassUtils.java 86.842% <75%> (+1.128%) 21 <2> (+2) ⬆️
...ine/GATKPlugin/GATKAnnotationPluginDescriptor.java 76.875% <83.333%> (+0.293%) 57 <3> (ø) ⬇️
.../tools/walkers/haplotypecaller/RefVsAnyResult.java 100% <0%> (ø) 3% <0%> (+1%) ⬆️
... and 5 more

magicDGS and others added 5 commits January 23, 2019 13:12
* added tests to show that the Annotation /ReadFilter loading is
controlled by the config file
* added a new method to base test runToolInNewJvm which lets you run a
gatk tool in a clean jvm so you can alter static state like which config
file was used.

Co-authored-by: Louis Bergelson <louisb@broadinstitute.org>
Copy link
Collaborator

@jamesemery jamesemery left a comment

Choose a reason for hiding this comment

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

A bunch of minor things, the only one I think is necessary are the changes to the dummy Annotation/Filter files as they will be incredibly confusing in the future when we have forgotten about this test. Feel free to merge once these issues are addressed.


import org.broadinstitute.hellbender.engine.filters.ReadFilter;
import org.broadinstitute.hellbender.utils.read.GATKRead;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm... Is there an issue with putting these explicitly in the test 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.

They're in the test package specifically so they're not discoverable under normal circumstances. They aren't found by the plugin unless you explicitly tell it to look in this package.

package org.broadinstitute.hellbender.cmdline.GATKPlugin.testpluggables;

import org.broadinstitute.hellbender.tools.walkers.annotator.Annotation;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a comment explaining that these are just for testing purposes and maybe even a link to the exact test so nobody is confused in the future, as these are discovered by reflection and its not easy to track down their purpose.

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea, done

@@ -1,5 +1,6 @@
package org.broadinstitute.hellbender.utils.config;

import com.netflix.servo.util.VisibleForTesting;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Its nice to think that the gatk is dependent on netflix....

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed, it now depends on myspace

@Test
public void testConfigFileControlsAnnotationPackages() throws IOException {
final File output = createTempFile("annotations", "txt");
final File configFile = new File("src/test/resources/org/broadinstitute/hellbender/cmdline/GATKPlugin/changePluginPackages.properties");
Copy link
Collaborator

Choose a reason for hiding this comment

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

should probably use the default test dir constants.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@Test
public void testConfigFileControlsReadFiltersPackages() throws IOException {
final File output = createTempFile("annotations", "txt");
final File configFile = new File("src/test/resources/org/broadinstitute/hellbender/cmdline/GATKPlugin/changePluginPackages.properties");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment as above.

Copy link
Member Author

Choose a reason for hiding this comment

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

same comment as above

* @param arguments arguments to provide to the tool
*/
public static void runToolInNewJVM(String toolName, ArgumentsBuilder arguments){
final String javaHome = System.getProperty("java.home");
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be useful to have

Copy link
Member Author

Choose a reason for hiding this comment

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

hopefully!

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.

4 participants