-
Notifications
You must be signed in to change notification settings - Fork 594
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
Conversation
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
Github actions tests reported job failures from actions build 2497440564
|
a7829e8
to
5880730
Compare
Codecov Report
@@ 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
|
Github actions tests reported job failures from actions build 2503081068
|
There was a problem hiding this 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( |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"rscript file"
Fixes #7697. Added argument option to generate and output rscript file without running it. |
Fixes #7697. Added argument to allow RScriptExecutor to disable but still output Rscript file.