Skip to content

Fix no filters usecase#420

Merged
FerriolCalvet merged 4 commits intodevfrom
fix-no-filters
Feb 19, 2026
Merged

Fix no filters usecase#420
FerriolCalvet merged 4 commits intodevfrom
fix-no-filters

Conversation

@FerriolCalvet
Copy link
Copy Markdown
Member

@FerriolCalvet FerriolCalvet commented Feb 17, 2026

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_MAFS process. 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:

  • Updated the assignment of ext.filters and ext.somatic_filters in conf/modules.config to set them to an empty string if the corresponding parameter is not provided, preventing errors from attempting to join a null value.
  • Modified the construction of the filters and somatic_filters command-line arguments in modules/local/writemaf/main.nf to only include these options if the corresponding values are set, avoiding unnecessary or empty arguments in the script call.

Output file handling improvements:

  • Marked the output files all_samples.all-flagged-pos.bed and all_samples.cohort-wide-flagged-pos.bed as optional in the WRITE_MAFS process, so the workflow will not fail if these files are not generated.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_MAFS module to avoid missing-output failures when no filters are used.
  • Build write_mafs.py CLI args conditionally so --filters/--somatic-filters are only passed when non-empty.
  • Guard WRITEMAF config ext.filters / ext.somatic_filters against 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.

Comment thread modules/local/writemaf/main.nf Outdated
Comment thread modules/local/writemaf/main.nf Outdated
Comment thread modules/local/writemaf/main.nf
Comment thread modules/local/writemaf/main.nf
@FerriolCalvet FerriolCalvet self-assigned this Feb 17, 2026
Copy link
Copy Markdown
Collaborator

@m-huertasp m-huertasp left a comment

Choose a reason for hiding this comment

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

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!

Comment thread modules/local/writemaf/main.nf Outdated
Comment thread modules/local/writemaf/main.nf Outdated
Comment thread modules/local/writemaf/main.nf
@FerriolCalvet FerriolCalvet merged commit bf625b0 into dev Feb 19, 2026
@FerriolCalvet FerriolCalvet deleted the fix-no-filters branch March 6, 2026 09:12
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.

3 participants