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

Added argument to disable RscriptExecutor #7900

Merged
merged 5 commits into from
Jun 24, 2022

Conversation

orlicohen
Copy link
Contributor

Fixes #7697. Added argument to allow RScriptExecutor to disable but still output Rscript file.

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.

It looks like this is rebased off of one of your previous branches. We should fix that. I also think make the tests a little more agnostic to whatever settings were being tested in testVariantRecalibratorSampling.

@@ -472,6 +478,21 @@ protected GenomicsDBOptions getGenomicsDBOptions() {
public void onTraversalStart() {
final Map<String, VCFHeader> vcfHeaders = Collections.singletonMap(getDrivingVariantsFeatureInput().getName(), getHeaderForVariants());

final List<String> genotypeField = getHeaderForVariants().getGenotypeSamples();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is from the wrong PR. #7887. Can you rebase and remove the SelectVariants commit please?

@@ -403,9 +409,12 @@ public void onTraversalStart() {
if (RSCRIPT_FILE != null) {
rScriptExecutor = new RScriptExecutor();
if(!rScriptExecutor.externalExecutableExists()) {
Utils.warnUser(logger, String.format(
if(!disableRScriptExecutor) {
throw new UserException("Rscript not found in environment path. Fix executor or run with disableRScriptExecutor argument to generate Rscript without running.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you are adding an argument "--" so its easy for the user to paste it into their command line.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also be sure that the argument is properly kebab-cased (--disable-rscriptexecutor) in the message.

@@ -67,6 +67,20 @@ public void testExpressionSelection() throws IOException {
spec.executeTest("testSimpleExpressionSelection--" + testFile, this);
}

@Test(expectedExceptions = UserException.ValidationFailure.class)
public void testResortingFileWarning() throws IOException {
final String testFile = getToolTestDataDir() + "unsortedGenotypeFieldsTestFile.vcf";
Copy link
Collaborator

Choose a reason for hiding this comment

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

more wrong-pr code.

@@ -388,6 +392,65 @@ public void testVariantRecalibratorSampling() throws IOException {
spec.executeTest("testVariantRecalibratorSampling"+ inputFile, this);
}

// Expected exception is a UserException but gets wrapped in a RuntimeException
@Test(expectedExceptions = RuntimeException.class)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should fail now no? You changed that to a user exception?.

// Expected exception is a UserException but gets wrapped in a RuntimeException
@Test(expectedExceptions = RuntimeException.class)
public void testVariantRecalibratorFailedRscriptOutput() throws IOException {
final String inputFile = getLargeVQSRTestDataDir() + "phase1.projectConsensus.chr20.1M-10M.raw.snps.vcf";
Copy link
Collaborator

Choose a reason for hiding this comment

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

The integration test spec and these arguments are a lot. I would recommend taking the String[] VQSRSNPParamsWithResources above and adding your rscript arguments to it and running that through the runCommandLineArguments() method. Furthermore i think this test is actually sketchy since it could be the case that R is properly installed... The second one is probably sufficient.

@gatk-bot
Copy link

Github actions tests reported job failures from actions build 2497440564
Failures in the following jobs:

Test Type JDK Job ID Logs
integration 8 2497440564.0 logs

@orlicohen orlicohen force-pushed the oc_fix7697_disablerscriptexecutor branch from a7829e8 to 5880730 Compare June 15, 2022 14:47
@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #7900 (161a164) into master (d22b752) will increase coverage by 0.074%.
The diff coverage is 61.290%.

❗ Current head 161a164 differs from pull request most recent head b860120. Consider uploading reports for the commit b860120 to get more accurate results

@@               Coverage Diff               @@
##              master     #7900       +/-   ##
===============================================
+ Coverage     86.933%   87.007%   +0.074%     
- Complexity     36950     36977       +27     
===============================================
  Files           2221      2221               
  Lines         173833    173849       +16     
  Branches       18778     18782        +4     
===============================================
+ Hits          151118    151260      +142     
+ Misses         16083     15956      -127     
- Partials        6632      6633        +1     
Impacted Files Coverage Δ
...bender/tools/walkers/vqsr/VariantRecalibrator.java 86.168% <8.333%> (+24.841%) ⬆️
...lkers/vqsr/VariantRecalibratorIntegrationTest.java 98.315% <94.737%> (-0.481%) ⬇️
.../tools/walkers/vqsr/VariantRecalibratorEngine.java 81.538% <0.000%> (+1.538%) ⬆️
...lbender/tools/walkers/vqsr/VariantDataManager.java 78.947% <0.000%> (+7.287%) ⬆️

@gatk-bot
Copy link

gatk-bot commented Jun 15, 2022

Github actions tests reported job failures from actions build 2503081068
Failures in the following jobs:

Test Type JDK Job ID Logs
integration 11 2503081068.12 logs
integration 8 2503081068.0 logs

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.

Two very minor style comments and then you can merge.

Utils.warnUser(logger, String.format(
if(!disableRScriptExecutor) {
throw new UserException("Rscript not found in environment path. Fix executor or run with --dont-run-rscript argument to generate Rscript without running.");
/* Utils.warnUser(logger, String.format(
Copy link
Collaborator

Choose a reason for hiding this comment

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

drop quoted code.

@@ -356,6 +356,12 @@ public class VariantRecalibrator extends MultiVariantWalker {
@VisibleForTesting
protected int max_attempts = 1;

@Advanced
@Argument(fullName="dont-run-rscript",
doc="Disable the RScriptExecutor to allow RScript to be generated but not run",
Copy link
Collaborator

Choose a reason for hiding this comment

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

"rscript file"

@orlicohen
Copy link
Contributor Author

Fixes #7697. Added argument option to generate and output rscript file without running it.

@orlicohen orlicohen merged commit a28dfff into master Jun 24, 2022
@orlicohen orlicohen deleted the oc_fix7697_disablerscriptexecutor branch June 24, 2022 21:13
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.

Option to not run VariantRecalibrator's Rscript
5 participants