Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9d81a0f
feat: add local BCFTOOLS_VIEW module for positional VCF filtering
robert-a-forsyth Apr 29, 2026
baf09d5
fix: filter phased somatic VCF to somatic-only positions
robert-a-forsyth Apr 29, 2026
929502c
config: add modules.config entry for PHASING_HAPLOTYPING:BCFTOOLS_VIEW
robert-a-forsyth Apr 29, 2026
f0e0c56
fix: publish somatic_smallvariants from BCFTOOLS_VIEW, not LONGPHASE_…
robert-a-forsyth Apr 29, 2026
5fbf4d0
Merge branch 'dev' into vep_quick_fix
robert-a-forsyth Apr 29, 2026
8979aae
fix consensus collision
robert-a-forsyth Apr 30, 2026
a522784
merge
robert-a-forsyth Apr 30, 2026
6385346
test: add extended test suite for all caller and combine modes
robert-a-forsyth May 6, 2026
c8829f8
test: add test tags, assert QC/VEP/BAM in extended tests, filter CI o…
robert-a-forsyth May 7, 2026
77f5086
fix caller issue, add tests
robert-a-forsyth May 8, 2026
4359a96
fix default
robert-a-forsyth May 8, 2026
ff34041
nextflow_schema.json
robert-a-forsyth May 8, 2026
61b5b2a
snap update
robert-a-forsyth May 8, 2026
5e10c8b
add read groups
robert-a-forsyth May 12, 2026
269f4b3
Merge branch 'dev' into bug_fix_consensus
robert-a-forsyth May 18, 2026
ecc7f70
update
robert-a-forsyth May 19, 2026
fa1eff8
fix snaps
robert-a-forsyth May 19, 2026
f94f288
update
robert-a-forsyth May 19, 2026
9c26aa1
update test
robert-a-forsyth May 26, 2026
6aa4d83
fix template
robert-a-forsyth May 27, 2026
4264458
precommit
robert-a-forsyth May 27, 2026
a210960
stupid template
robert-a-forsyth May 27, 2026
bf96f2b
Merge branch 'dev' into bug_fix_consensus
robert-a-forsyth May 28, 2026
02c6928
update snap
robert-a-forsyth May 28, 2026
49701e4
prettier
robert-a-forsyth May 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
NFT_VER: ${{ env.NFT_VER }}
with:
max_shards: 7
tags: ${{ github.event_name == 'pull_request' && 'small' || '' }}

- name: debug
run: |
Expand Down Expand Up @@ -98,6 +99,7 @@ jobs:
profile: ${{ matrix.profile }}
shard: ${{ matrix.shard }}
total_shards: ${{ env.TOTAL_SHARDS }}
tags: ${{ github.event_name == 'pull_request' && 'small' || '' }}

- name: Report test status
if: ${{ always() }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ testing*
*.pyc
null/
.lineage/
.nf-test/
.nf-test.log
4 changes: 4 additions & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ lint:
- .github/ISSUE_TEMPLATE/config.yml
- .github/workflows/awstest.yml
- .github/workflows/awsfulltest.yml
- .github/CONTRIBUTING.md
files_unchanged:
- CODE_OF_CONDUCT.md
- assets/nf-core-lrsomatic_logo_light.png
Expand All @@ -17,6 +18,9 @@ lint:
- .github/PULL_REQUEST_TEMPLATE.md
- assets/email_template.txt
- docs/README.md
- .github/workflows/branch.yml
- .github/workflows/linting_comment.yml
- .github/workflows/linting.yml
multiqc_config:
- report_comment
nextflow_config:
Expand Down
48 changes: 42 additions & 6 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,20 @@ process {
//

withName: '.*:MINIMAP2_ALIGN' {
ext.prefix = { "${meta.id}_${meta.type}_mapped" }
ext.prefix = { "${meta.id}_${meta.type}_rep${meta.replicate}_mapped" }
ext.args = {
def platform_arg = meta.platform == 'pb' ?
( params.minimap2_pb_model ? "-ax $params.minimap2_pb_model" : "-ax map-hifi" ) :
( params.minimap2_ont_model ? "-ax $params.minimap2_ont_model" : "-ax lr:hq" )
def secondary_arg = params.save_secondary_alignment ? "--secondary=yes" : "--secondary=no"
def pl = meta.platform == 'pb' ? 'PACBIO' : 'ONT'
def rg = "@RG\\tID:${meta.id}_${meta.type}_rep${meta.replicate}\\tSM:${meta.id}\\tLB:${meta.id}_${meta.type}\\tPL:${pl}"
[
meta.platform == 'pb' ? ( params.minimap2_pb_model ? "-ax $params.minimap2_pb_model" : "-ax map-hifi" ) :
( params.minimap2_ont_model ? "-ax $params.minimap2_ont_model" : "-ax lr:hq " ),
params.save_secondary_alignment ? "--secondary=yes " : "--secondary=no ",
platform_arg,
secondary_arg,
"-y",
"-Y"
"-Y",
"-R '${rg}'"
].join(' ').trim()
}
ext.args4 = "-T '*'"
Expand All @@ -303,6 +309,19 @@ process {
]
}

withName: '.*:SAMTOOLS_MERGE' {
ext.prefix = { "${meta.id}_${meta.type}_mapped" }
publishDir = [
enabled: false
]
}

withName: '.*:SAMTOOLS_INDEX_MERGE' {
publishDir = [
enabled: false
]
}

//
// Methylation related processes
//
Expand Down Expand Up @@ -359,13 +378,20 @@ process {
]
}
withName: '.*:LONGPHASE_PHASE_SOMATIC' {
ext.prefix = { "somatic_smallvariants" }
ext.prefix = { "somatic_smallvariants_combined" }
ext.args = {
[
meta.platform == 'pb' ? '--pb' : '--ont',
"--indels",
].join(' ').trim()
}
// Intermediate output (somatic+germline combined); filtered version published below
publishDir = [
enabled: false
]
}
withName: '.*:PHASING_HAPLOTYPING:BCFTOOLS_VIEW' {
ext.prefix = { "somatic_smallvariants" }
publishDir = [
path: { "${params.outdir}/${meta.id}/variants/phased" },
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -435,6 +461,16 @@ process {
enabled: false
]
}
withName: '.*:GERMLINE_CONSENSUS:BCFTOOLS_SORT_CONSENSUS' {
ext.prefix = { "${meta.id}_germline_sorted" }
ext.args = { '-Oz -W=tbi' }
publishDir = [ enabled: false ]
}
withName: '.*:SOMATIC_CONSENSUS:BCFTOOLS_SORT_CONSENSUS' {
ext.prefix = { "${meta.id}_somatic_sorted" }
ext.args = { '-Oz -W=tbi' }
publishDir = [ enabled: false ]
}
withName: '.*:GERMLINE_CONSENSUS:SORT_POST_NORM' {
ext.prefix = { "${meta.id}.${meta.caller}_norm_sorted" }
ext.args = { '-Oz -W=tbi' }
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ params {
fasta = "https://github.com/IntGenomicsLab/test-datasets/main/references/GRCh38_chr19.fasta.gz"

// Additional params
genome = "CHM13"
genome = "GRCh38"
vep_genome = "WBcel235"
vep_species = "caenorhabditis_elegans"
skip_wakhan = true
Expand Down
27 changes: 17 additions & 10 deletions conf/test_full.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
Nextflow config file for running full tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.
Defines input files and everything required to run a full pipeline test with both
callers in union combine mode.

Use as follows:
nextflow run IntGenomicsLab/lrsomatic -profile test,<docker/singularity> --outdir <OUTDIR>
nextflow run IntGenomicsLab/lrsomatic -profile test_full,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/
Expand All @@ -21,17 +22,23 @@ process {
}

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'
config_profile_name = 'Full test profile'
config_profile_description = 'Full test dataset with both callers in union combine mode'

// Input data
input = "https://github.com/IntGenomicsLab/test-datasets/main/samplesheets/samplesheet_lr-somatic.csv"
fasta = "https://github.com/IntGenomicsLab/test-datasets/main/references/GRCh38_chr19.fasta.gz"

// Additional params
genome = "GRCh38"
vep_genome = "WBcel235"
vep_species = "caenorhabditis_elegans"
skip_wakhan = true
skip_ascat = true
genome = "GRCh38"
vep_genome = "WBcel235"
vep_species = "caenorhabditis_elegans"
skip_wakhan = true
skip_ascat = true

// Both callers, union combine mode
germline_var_keep = 'clair, deepvariant'
somatic_var_keep = 'clair, deepsomatic'
germline_var_combine = 'all'
somatic_var_combine = 'all'
}
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
"git_sha": "1d2fbdcbca677bbe8da0f9d0d2bb7c02f2cab1c9",
"installed_by": ["modules"]
},
"samtools/merge": {
"branch": "master",
"git_sha": "6d46786420b4d7bc88eba026eb389c0c5535d120",
"installed_by": ["modules"]
},
"samtools/stats": {
"branch": "master",
"git_sha": "fe93fde0845f907fc91ad7cc7d797930408824df",
Expand Down
9 changes: 9 additions & 0 deletions modules/local/bcftools/view/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://github.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
# renovate: datasource=conda depName=bioconda/htslib
- bioconda::bcftools=1.22
- bioconda::htslib=1.22.1
40 changes: 40 additions & 0 deletions modules/local/bcftools/view/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
process BCFTOOLS_VIEW {
tag "${meta.id}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/47/474a5ea8dc03366b04df884d89aeacc4f8e6d1ad92266888e7a8e7958d07cde8/data'
: 'community.wave.seqera.io/library/bcftools_htslib:0a3fa2654b52006f'}"
Comment on lines +6 to +8

input:
tuple val(meta), path(vcf), path(tbi), path(targets), path(targets_tbi)

output:
tuple val(meta), path("*.vcf.gz"), emit: vcf
tuple val(meta), path("*.tbi"), emit: tbi
tuple val("${task.process}"), val('bcftools'), eval("bcftools --version | sed '1!d; s/^.*bcftools //'"), topic: versions, emit: versions_bcftools

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
bcftools view \\
-T ${targets} \\
-Oz \\
-W=tbi \\
${args} \\
-o ${prefix}.vcf.gz \\
${vcf}
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo '' | gzip > ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
"""
}
56 changes: 56 additions & 0 deletions modules/local/bcftools/view/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: bcftools_view
description: Filter VCF to positions defined by a targets file using bcftools view -T
keywords:
- filtering
- VCF
- variant calling
tools:
- view:
description: VCF/BCF conversion, view, subset and filter VCF/BCF files.
homepage: http://samtools.github.io/bcftools/bcftools.html
Comment on lines +7 to +10
documentation: http://www.htslib.org/doc/bcftools.html
tool_dev_url: https://github.com/samtools/bcftools
doi: "10.1093/bioinformatics/btp352"
licence: ["MIT"]
identifier: biotools:bcftools
Comment on lines +7 to +15
input:
- - meta:
type: map
description: Groovy Map containing sample information e.g. [ id:'test' ]
- vcf:
type: file
description: Input VCF/BCF file to filter
pattern: "*.{vcf.gz,vcf,bcf}"
- tbi:
type: file
description: Tabix index of the input VCF
pattern: "*.tbi"
- targets:
type: file
description: VCF file used as position filter (-T)
pattern: "*.{vcf.gz,vcf,bcf}"
- targets_tbi:
type: file
description: Tabix index of the targets VCF
pattern: "*.tbi"
output:
vcf:
- - meta:
type: map
description: Groovy Map containing sample information
- "*.vcf.gz":
type: file
description: Filtered VCF file
pattern: "*.vcf.gz"
tbi:
- - meta:
type: map
description: Groovy Map containing sample information
- "*.tbi":
type: file
description: Tabix index of filtered VCF
pattern: "*.tbi"
authors:
- "@rforsyth"
maintainers:
- "@rforsyth"
4 changes: 2 additions & 2 deletions modules/local/deepsomatic/postprocessvariants/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ process DEEPSOMATIC_POSTPROCESSVARIANTS {
error "DEEPSOMATIC module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
prefix = task.ext.prefix ?: "${meta.id}_somatic"

def regions = intervals ? "--regions ${intervals}" : ""
def variant_calls_tfrecord_name = variant_calls_tfrecord_files[0].name.replaceFirst(/-\d{5}-of-\d{5}/, "")
Expand Down Expand Up @@ -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 on lines 121 to 123
prefix = task.ext.prefix ?: "${meta.id}"
prefix = task.ext.prefix ?: "${meta.id}_somatic"
"""
echo "" | gzip > ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/deepvariant/postprocessvariants/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions modules/nf-core/samtools/merge/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions modules/nf-core/samtools/merge/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading