Refactor optitype module to be more resilient to configuration issues - #229
Refactor optitype module to be more resilient to configuration issues#229SpikyClip wants to merge 10 commits into
Conversation
- Expose optitype config args as named inputs via ext.args2 so user doesn't have to be concerned about key syntax - Embed sensible defaults into module as fallback rather than relying on pipeline module args. This means if user only overrides 1 arg, the pipeline won't fail. - Allow solver to use multiple threads if glpk is not used - Extract seq_type independently of args, in my opinion there should be no reason for user to be able to override seq type in configs as it is already supplied by the samplesheet. This was the case in the prior version.
…style changes in schema and nextflow.config; test solver type. fix: beta parameter was not previously supplied to optitype module, leading to silent errors style: prefix optitype parameters now that pipeline has multiple hlatyping tools style: minor wording changes in schema.json test: test that solver parameter falls into only two valid options (cplex not bundled in optitype image?)
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 4.0.3. For more documentation on how to update your pipeline, please see the Synchronisation documentation. |
|
jonasscheid
left a comment
There was a problem hiding this comment.
thanks for contributing! Sounds reasonable to expose more params here. Please make sure to add a changelog entry since the existing cli params were renamed. Also the new optitype version 1.5 landed on bioconda, would you be interested in updating the nf-core module?
|
Am waiting on approval for this module PR so that I can pull that into this branch. The only tests that are failing are non deterministic md5 hash issues from other modules so I am not sure how to get around it or if it can be manually approved. |
|
Can you request a review in nf-core slack, I am not available until start of sept |
❌ nf-test failed with latest Nextflow versionNote Tests with Nextflow's latest version failed but it will not cause a CI workflow failure.
See the full run for details. |
|
I just had a bit of time to review your optitype pr, could you implement these changes in a new PR? |
b40be89 to
59cebad
Compare
I encountered an issue with the latest dev branch where moving
--${meta.seq_type}from the module itself tomodules.config'sext.argscaused issues if you had pre-existing configs (in my case,ext.args = "--enumerate 3") that overrided the defaults, causing the seq type to not get supplied to optitype.Fairly simple to solve without changing the source code but I figured that it was a good opportunity to refactor the module to be more resilient to configuration type issues. I took some inspiration from the ControlFREEC module which handles it quite elegantly by using a named list of parameters which removes a bit of friction from the user regarding the argument syntax, and also embeds sensible default fallbacks within the module itself, so the user doesn't have to supply every arg if they only need to override one.
I also fixed two issues:
cbcsolver (which I believe can use them?) with a fallback to 1 thread ifglpkis selected (single-threaded)betaparameter to the module viaext.argsStyle-wise, I thought it would be clearer to prefix the optitype args now that multiple callers are present, and I removed the solver argument from the tests to deduplicate unnecessary code.
I've also added a test for the solver in
nextflow_schema.jsonto allow only two valid options (If I'm not wrong,cplexis not installed in the container so it is not a working solver input in this case?).I'm keen to here your feedback, and am happy to make any necessary changes.