Skip to content

BAM_MARKDUPLICATES emits duplicate alignment channel under -stub #2280

Description

@gburnett-nvidia

Description

BAM_MARKDUPLICATES mixes the bam and cram output channels from GATK4_MARKDUPLICATES together via .mix(), trusting that only one of the two is ever populated per sample. That assumption holds for real runs, but under -stub the module's stub block touches both bam and cram (plus their indices) unconditionally, so the mixed alignment channel emits twice per sample.

The duplication silently rides through baserecalibration/applybqsr and only surfaces downstream at the tumor-normal pairing join in workflows/sarek.nf (failOnDuplicate: true), throwing:

Detected join operation duplicate emission on right channel

Steps to reproduce

Run the pipeline with -stub on a tumor-normal test profile, e.g.:

nf-test test tests/default.nf.test --tag cpu_conda_stub --profile test,docker

Expected behaviour

GATK4_MARKDUPLICATES, GATK4_BASERECALIBRATOR, GATK4_APPLYBQSR, and INDEX_CRAM should each run once per sample under -stub, with no duplicate-emission error at the tumor-normal join.

Fix

Select the bam or cram branch explicitly by params.save_output_as_bam, instead of .mix()-ing both — same pattern already used in bam_sentieon_dedup.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions