Skip to content

Bug fix consensus#165

Open
robert-a-forsyth wants to merge 14 commits into
devfrom
bug_fix_consensus
Open

Bug fix consensus#165
robert-a-forsyth wants to merge 14 commits into
devfrom
bug_fix_consensus

Conversation

@robert-a-forsyth
Copy link
Copy Markdown
Collaborator

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

robert-a-forsyth and others added 11 commits April 29, 2026 14:29
Supports bcftools view -T <targets> to filter a VCF to only positions
present in a targets VCF file. Used to strip germline variants from the
phased somatic+germline VCF before emitting phased_somatic_vcf.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After LONGPHASE_PHASE_SOMATIC, use BCFTOOLS_VIEW -T to filter the
combined phased somatic+germline VCF against the original somatic VCF
positions. The emitted phased_somatic_vcf (used by SOMATIC_VEP) now
contains only somatic variants. Phase tags (PS/HP) are preserved.
This prevents germline variants from being double-annotated by both
GERMLINE_VEP and SOMATIC_VEP.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Scoped to the PHASING_HAPLOTYPING subworkflow to avoid matching any
future BCFTOOLS_VIEW calls. Output is intermediate (publishDir disabled).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…PHASE_SOMATIC

LONGPHASE_PHASE_SOMATIC now produces an intermediate combined
somatic+germline VCF (renamed to somatic_smallvariants_combined,
publish disabled). BCFTOOLS_VIEW produces the final somatic-only
phased VCF published as somatic_smallvariants to variants/phased/,
matching the previous output name and location.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- clair_only: rewritten to use test_sheet_2.csv (5 samples). Adds
  assertions for sample4 replicate merging (rep1/rep2 QC dirs, single
  merged output), sample5 custom ONT model override (VCF header check),
  phased VCF existence/size, BAM files, QC dirs, and VEP outputs.
- deep_only: enhanced with phased VCF size assertions and loop-based
  pattern consistent with other tests.
- consensus: new test — both callers, germline_var_combine='consensus',
  somatic_var_combine='consensus'. Asserts both caller raw outputs and
  phased consensus VCFs exist with data.
- union: new test — both callers, germline_var_combine='all',
  somatic_var_combine='all'. Explicit test for the union combine path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n PRs

Test tagging:
- default.nf.test: tag "small" — runs on every PR
- clair_only, deep_only, consensus, union: tag "extended" — skipped on PRs

Assertion enhancements (deep_only, consensus, union now match clair_only):
- BAM .bai index checks added to all three tests
- QC directory checks (cramino_aln, nanoplot_aln, mosdepth, samtools)
- VEP output directory checks (germline, somatic, SVs for paired)
- Severus SV outputs added to deep_only

CI (nf-test.yml):
- Pass tags: "small" to get-shards and nf-test actions on pull_request events
- Releases and workflow_dispatch continue to run the full extended suite

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 8, 2026 09:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 5e10c8b

+| ✅ 216 tests passed       |+
#| ❔  21 tests were ignored |#
!| ❗  34 tests had warnings |!
Details

❗ Test warnings:

  • pipeline_todos - TODO string in README.md: Include a figure that guides the user through the major workflow steps. Many nf-core
  • pipeline_todos - TODO string in nextflow.config: Specify your pipeline's command line flags
  • pipeline_todos - TODO string in nextflow.config: Update the field with the details of the contributors to your pipeline. New with Nextflow version 24.10.0
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in base.config: Customise requirements for specific processes.
  • pipeline_todos - TODO string in meta.yml: #Add a description of the module and list keywords
  • schema_description - No description provided in schema for parameter: autocorrelation
  • schema_description - No description provided in schema for parameter: vep_custom
  • schema_description - No description provided in schema for parameter: vep_custom_tbi
  • schema_description - No description provided in schema for parameter: severus_minsupport
  • schema_description - No description provided in schema for parameter: wakhan_chroms
  • local_component_structure - prepare_annotation.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - small_variant_consensus.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - phasing_haplotyping.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - prepare_reference_files.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - deepsomatic.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure

❔ Tests ignored:

  • files_exist - File is ignored: CODE_OF_CONDUCT.md
  • files_exist - File is ignored: assets/nf-core-lrsomatic_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-lrsomatic_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-lrsomatic_logo_dark.png
  • files_exist - File is ignored: .github/ISSUE_TEMPLATE/config.yml
  • files_exist - File is ignored: .github/workflows/awstest.yml
  • files_exist - File is ignored: .github/workflows/awsfulltest.yml
  • nextflow_config - Config variable ignored: manifest.name
  • nextflow_config - Config variable ignored: manifest.homePage
  • files_unchanged - File ignored due to lint config: CODE_OF_CONDUCT.md
  • files_unchanged - File ignored due to lint config: .github/CONTRIBUTING.md
  • files_unchanged - File ignored due to lint config: .github/ISSUE_TEMPLATE/bug_report.yml
  • files_unchanged - File does not exist: .github/ISSUE_TEMPLATE/config.yml
  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File ignored due to lint config: assets/email_template.txt
  • files_unchanged - File ignored due to lint config: assets/nf-core-lrsomatic_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-lrsomatic_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-lrsomatic_logo_dark.png
  • files_unchanged - File ignored due to lint config: docs/README.md
  • actions_awstest - 'awstest.yml' workflow not found: /home/runner/work/lrsomatic/lrsomatic/.github/workflows/awstest.yml
  • schema_params - schema_params

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.2
  • Run at 2026-05-13 08:34:16

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

This PR appears to address filename collisions and output correctness in the small-variant consensus/phasing parts of the lrsomatic Nextflow pipeline, and expands nf-test coverage around different caller-selection / combine-mode scenarios.

Changes:

  • Avoid VCF basename collisions by renaming DeepVariant/DeepSomatic outputs and by re-sorting/renaming bcftools isec consensus outputs in consensus mode.
  • Add a local bcftools view module and use it in phasing to publish a somatic-only phased VCF (filtering from the phased somatic+germline VCF using somatic calls as targets).
  • Add multiple new nf-test scenarios (union/all, consensus, deep-only, clair-only) and adjust CI to run only small-tagged tests on pull requests.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
subworkflows/local/small_variant_consensus.nf Renames/sorts consensus-mode outputs to prevent downstream filename collisions.
modules/nf-core/deepvariant/postprocessvariants/main.nf Changes DeepVariant output prefix to include _germline to avoid ambiguous basenames.
modules/local/deepsomatic/postprocessvariants/main.nf Changes DeepSomatic output prefix to include _somatic to avoid ambiguous basenames.
subworkflows/local/phasing_haplotyping.nf Adds bcftools view filtering so published phased somatic VCF is somatic-only.
modules/local/bcftools/view/main.nf New local module implementing bcftools view -T filtering with index writing.
modules/local/bcftools/view/meta.yml Metadata for the new bcftools view module.
modules/local/bcftools/view/environment.yml Conda environment for the new bcftools view module.
conf/modules.config Adjusts Longphase somatic prefix/publishing; publishes filtered somatic VCF; configures consensus-sort renaming.
subworkflows/local/paired/paired_smallvar_germline.nf Normalizes params.germline_var_keep handling (list vs scalar) and initializes channels.
subworkflows/local/paired/paired_smallvar_somatic.nf Normalizes params.somatic_var_keep handling (list vs scalar) and initializes channels.
subworkflows/local/tumor_only/tumoronly_smallvar.nf Normalizes *_var_keep handling (list vs scalar) and initializes channels.
tests/default.nf.test Adds small tag and updates expected DeepVariant/DeepSomatic filenames.
tests/default.nf.test.snap Snapshot updates for renamed outputs and added BCFTOOLS_VIEW version reporting.
tests/consensus.nf.test New nf-test for consensus combine mode.
tests/consensus.nf.test.snap Snapshot for consensus combine mode.
tests/union.nf.test New nf-test for “all/union” combine mode.
tests/union.nf.test.snap Snapshot for “all/union” combine mode.
tests/deep_only.nf.test New nf-test for running only DeepVariant+DeepSomatic.
tests/deep_only.nf.test.snap Snapshot for deep-only mode.
tests/clair_only.nf.test New nf-test for running only Clair callers (uses an extended samplesheet).
tests/clair_only.nf.test.snap Snapshot for clair-only mode.
conf/test.config Changes test profile genome to GRCh38.
nextflow.config Changes default caller selection/priorities (global defaults).
.github/workflows/nf-test.yml Runs only small-tagged nf-tests on pull requests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +260 to +264
// MODULE: BCFTOOLS_VIEW (label: process_medium)
// Filter the phased somatic+germline VCF to somatic-only positions.
// Uses the original somatic VCF as a targets (-T) file so only positions
// called as somatic are retained. Phase tags (PS/HP) on somatic variants
// are preserved; germline records are dropped.
Comment thread nextflow.config
Comment thread tests/clair_only.nf.test
Copilot AI review requested due to automatic review settings May 8, 2026 13:19
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.

Comment thread nextflow_schema.json
Comment on lines 70 to 77
"germline_var_keep": {
"type": "array",
"description": "List of germline variant callers to use. Must include at least one of [deepvariant, clair].",
"items": {
"type": "string",
"default": "['clair']",
"enum": ["deepvariant", "clair"]
},
Comment thread nextflow_schema.json
Comment on lines 83 to +85
"items": {
"type": "string",
"default": "['clair']",
@@ -121,7 +121,7 @@ process DEEPSOMATIC_POSTPROCESSVARIANTS {
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "DEEPVARIANT module does not support Conda. Please use Docker / Singularity / Podman instead."
Comment thread tests/clair_only.nf.test
when {
params {
outdir = "$outputDir"
input = "https://raw.githubusercontent.com/IntGenomicsLab/test-datasets/refs/heads/main/samplesheets/test_sheet_2.csv"
NFT_VER: ${{ env.NFT_VER }}
with:
max_shards: 7
tags: ${{ github.event_name == 'pull_request' && 'small' || '' }}
profile: ${{ matrix.profile }}
shard: ${{ matrix.shard }}
total_shards: ${{ env.TOTAL_SHARDS }}
tags: ${{ github.event_name == 'pull_request' && 'small' || '' }}
Comment thread nextflow.config
Comment on lines 16 to +22
// Small variant calling options
germline_var_keep = ['deepvariant', 'clair']
somatic_var_keep = ['deepsomatic', 'clair']
germline_var_keep = ['clair']
somatic_var_keep = ['clair']
germline_var_combine = 'all'
somatic_var_combine = 'all'
prioritize_caller_germline = 'deepvariant'
prioritize_caller_somatic = 'deepsomatic'
prioritize_caller_germline = 'clair'
prioritize_caller_somatic = 'clair'
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.

2 participants