Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the pipeline “no filters” execution path by making WRITEMAF filter arguments and outputs tolerant to empty/undefined filter criteria, preventing Nextflow from failing when expected filter-derived BED files are not produced.
Changes:
- Make cohort-level flagged BED outputs optional in the
WRITE_MAFSmodule to avoid missing-output failures when no filters are used. - Build
write_mafs.pyCLI args conditionally so--filters/--somatic-filtersare only passed when non-empty. - Guard
WRITEMAFconfigext.filters/ext.somatic_filtersagainst null/empty params.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| modules/local/writemaf/main.nf | Makes some outputs optional and conditionally constructs filter CLI arguments for write_mafs.py. |
| conf/modules.config | Safely derives WRITEMAF filter strings from params when criteria are unset/empty. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
m-huertasp
left a comment
There was a problem hiding this comment.
Thank you for taking a look at this and sorry for creating this problem! I think you've done nice with the filters, I didn't think about the possibility of having them empty.
Regarding the output of the bed files from WRITEMAFs being optional, I think there could be an easier solution. I think this is a problem caused by me in fact. I've already added what could be the problem in the comments.
If you have any question or need any help just tell me!
Nice job!
- not tested
This PR implements some changes to fix a bug created by the updates regarding the reporting of positions to be masked and so on.
AI summary
This pull request improves the handling of optional filter parameters and output files in the
WRITE_MAFSprocess. The changes ensure that filters are only applied when specified and that certain output files are treated as optional, making the workflow more robust to missing or empty inputs.Parameter handling improvements:
ext.filtersandext.somatic_filtersinconf/modules.configto set them to an empty string if the corresponding parameter is not provided, preventing errors from attempting to join a null value.filtersandsomatic_filterscommand-line arguments inmodules/local/writemaf/main.nfto only include these options if the corresponding values are set, avoiding unnecessary or empty arguments in the script call.Output file handling improvements:
all_samples.all-flagged-pos.bedandall_samples.cohort-wide-flagged-pos.bedas optional in theWRITE_MAFSprocess, so the workflow will not fail if these files are not generated.