Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
271c486
first commit for CPGR module
Feb 15, 2026
009526a
update vcf_preprocessing to split output into somatic and germline
Feb 15, 2026
7f7e545
update workflow to include the cpsr module
Feb 15, 2026
b3aa83a
first commit for modules.config for cpsr
Feb 15, 2026
e3040ee
Merge branch 'dev' into 15-implement-cancer-predisposition-sequencing…
famosab Feb 20, 2026
712f0ed
Add cpsr test
famosab Feb 23, 2026
027853b
Add cpsr test
famosab Feb 23, 2026
e92065e
add snap
famosab Feb 23, 2026
40039ac
update snaps
famosab Feb 23, 2026
725f919
remove unstable files
famosab Feb 23, 2026
e198c38
enhance docs and use more callers for test
famosab Feb 23, 2026
75e9b60
investigate md5sum mismatch
famosab Feb 23, 2026
a05fa0c
update full size
famosab Feb 23, 2026
42c1680
revert lib changes
famosab Feb 23, 2026
1e0641f
revert lib changes
famosab Feb 23, 2026
5ad39af
Add concat of germline vcfs
famosab Feb 24, 2026
8b13de5
Add concatenation
famosab Feb 24, 2026
206929a
update docs
famosab Feb 24, 2026
ea2032f
Add handling for one vs multiple vcfs
famosab Feb 24, 2026
dec50c6
try combined container
famosab Feb 25, 2026
02a22eb
remove germline preprocessing add note in docs
famosab Feb 25, 2026
312d1ee
update snap
famosab Feb 25, 2026
6753083
fix linting
famosab Feb 25, 2026
574bccb
Changelog and full-test
famosab Feb 25, 2026
9b21a8a
Fix output docs
famosab Feb 25, 2026
26b8d3a
Update modules/local/cpsr/run/main.nf
famosab Mar 2, 2026
fc52a0d
Merge branch 'dev' into 15-implement-cancer-predisposition-sequencing…
famosab Mar 5, 2026
5f29f19
fix: add check for unique ids
famosab Mar 6, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Team from October 2025 nf-core Hackathon: @georgiakes, @petanska, @maxibor, @eol
- [#58](https://github.com/nf-core/variantprioritization/pull/58) - Defined a function that extract the variantcaller from the vcf (@yussab)
- [#59](https://github.com/nf-core/variantprioritization/pull/59) - Enable conda usage for the entire pipeline (@yussab)
- [#63](https://github.com/nf-core/variantprioritization/pull/63) - Restructure local modules (@famosab)
- [#68](https://github.com/nf-core/variantprioritization/pull/68) - Cancer Predisposition Reporter (@yussab, @famosab)

### `Fixed`

Expand Down
30 changes: 30 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,34 @@ process {
mode: params.publish_dir_mode,
]
}

withName: CPSR_RUN {
ext.prefix = { "${meta.patient}.${meta.sample}" }
ext.genome = { params.genome.toLowerCase() }
ext.database = { params.database }
ext.args = {
[
"",
// CPSR params
"--panel_id ${params.panel_id}",
params.diagnostic_grade_only ? "--diagnostic_grade_only" : "",
params.ignore_noncoding ? "--ignore_noncoding" : "",
params.pop_gnomad ? "--pop_gnomad ${params.pop_gnomad}" : "",
params.maf_upper_threshold ? "--maf_upper_threshold ${params.maf_upper_threshold}" : "",
params.classify_all ? "--classify_all" : "",
params.clinvar_ignore_noncancer ? "--clinvar_ignore_noncancer" : "",

// VEP params
params.vep_n_forks ? "--vep_n_forks ${params.vep_n_forks}" : "",
params.vep_buffer_size ? "--vep_buffer_size ${params.vep_buffer_size}" : "",
params.vep_gencode_basic ? "--vep_gencode_basic" : "",
params.vep_pick_order ? "--vep_pick_order ${params.vep_pick_order}" : "",
params.vep_no_intergenic ? "--vep_no_intergenic" : "",
].join(" ").trim()
}
publishDir = [
path: { "${params.outdir}/cpsr" },
mode: params.publish_dir_mode,
]
}
}
2 changes: 2 additions & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ params {
filter_strelka_snvs = "-i 'FILTER=\"PASS\"'"
// html report generation throws errors with downsampled cache
no_html = true
vep_gencode_basic = true
vep_no_intergenic = true
}
18 changes: 17 additions & 1 deletion docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [Reference data](#reference-data) – PCGR and VEP resources when downloaded or provided as archives
- [VCF preprocessing](#vcf-preprocessing) – optional bgzip/tabix, left-normalisation and filtering
- [Variant formatting and intersection](#variant-formatting-and-intersection) – reheader VCFs, merge caller support, and reformat CNAs
- [PCGR](#pcgr) – combined variant annotation and reporting
- [PCGR](#pcgr) – combined somatic variant annotation and reporting
- [CPSR](#cpsr) – combined germline variant annotation and reporting
- [MultiQC](#multiqc) – aggregate QC and provenance reporting
- [Pipeline information](#pipeline-information) – run metadata and software versions

Expand Down Expand Up @@ -80,6 +81,21 @@ Variants are first intersected across somatic callers to capture support per too

PCGR ingests the unified somatic VCF (and optional allele-specific CNA table) together with the provided reference bundle and VEP cache to produce interactive and machine-readable reports per sample.

### CPSR

<details markdown="1">
<summary>Output files</summary>

- `cpsr/{sample}/`
- `{sample}.cpsr.{assembly}.html`: interactive CPSR report.
- `{sample}.cpsr.{assembly}.xlsx`: Excel summary of annotated variants.
- `{sample}.cpsr.{assembly}.pass.*`: PASS-filtered TSV/VCF summaries (e.g. `.pass.tsv.gz`, `.pass.vcf.gz` + `.tbi`).
- `{sample}.cpsr.{assembly}.conf.yaml`: configuration used by CPSR.

</details>

CPSR ingests each germline VCF together with the provided reference bundle and VEP cache to produce interactive and machine-readable reports per sample.

### MultiQC

<details markdown="1">
Expand Down
9 changes: 7 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Introduction

nf-core/variantprioritization consumes small variant calls (SNVs/InDels) in VCF format and optionally copy number alteration (CNA) segments, and produces annotated reports using PCGR.
nf-core/variantprioritization consumes small variant calls (SNVs/InDels) in VCF format and optionally copy number alteration (CNA) segments, and produces annotated reports for the somatic case using PCGR / for the germline case using CPSR.

The pipeline is designed to work well with outputs from nf-core/sarek (e.g. Mutect2, Strelka), but any compatible VCFs can be used.

Expand All @@ -22,7 +22,9 @@ It must be a comma-separated file with a header row and the following required c
- `sample`: Sample identifier (no spaces)
- `vcf`: Path to a VCF / VCF.GZ file

Optionally, you can provide:
The PCGR / CPSR implementation runs based on the input: If the samplesheet contains both status `0` and `1`, both reporting tools will be used.

Optionally (somatic analysis only), you can provide:

- `cna`: Path to a CNA segments file (required for somatic rows when `--cna_analysis` is enabled)

Expand All @@ -34,6 +36,9 @@ Optionally, you can provide:

If you have multiple VCFs for the same sample (e.g. one per caller), provide one row per VCF. The pipeline will keep caller-specific files separate during preprocessing and then consolidate/intersect somatic calls per sample for PCGR reporting.

> [!NOTE]
> Intersection of calls is only implemented for the somatic reporting. For germline calls please provide unique sample ids.

### CNA files

If you run with `--cna_analysis`, CNA segments are required for somatic (`status=1`) rows.
Expand Down
7 changes: 7 additions & 0 deletions modules/local/cpsr/run/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
channels:
- pcgr
- conda-forge
- bioconda
dependencies:
- pcgr::pcgr=2.2.1
- pcgr::r-pcgrr=2.2.1
48 changes: 48 additions & 0 deletions modules/local/cpsr/run/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process CPSR_RUN {
tag "${meta.patient}.${meta.sample}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'docker.io/sigven/pcgr:2.2.1'
Comment thread
famosab marked this conversation as resolved.
: 'docker.io/sigven/pcgr:2.2.1'}"

input:
tuple val(meta), path(vcf), path(tbi)
path pcgr_dir
path vep_cache

output:
tuple val(meta), path("${prefix}"), emit: cpsr_reports
tuple val("${task.process}"), val('cpsr'), eval("cpsr --version | sed 's/cpsr //g'"), topic: versions, emit: versions_cpsr

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

script:
def genome = task.ext.genome ?: ''
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
export XDG_CACHE_HOME=/tmp
export XDG_DATA_HOME=/tmp
export QUARTO_PRINT_STACK=true

mkdir -p ${prefix}

cpsr \\
--input_vcf ${vcf} \\
--vep_dir ${vep_cache} \\
--refdata_dir ${pcgr_dir} \\
--output_dir ${prefix} \\
--genome_assembly ${genome} \\
--sample_id ${prefix} \\
${args}
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p ${prefix}
"""
}
1 change: 1 addition & 0 deletions modules/local/pcgr/run/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ channels:
- bioconda
dependencies:
- pcgr::pcgr=2.2.1
- pcgr::r-pcgrr=2.2.1
Comment thread
famosab marked this conversation as resolved.
3 changes: 0 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ params {
outdir = null
email = null
multiqc_title = null
outdir = null
email = null
multiqc_title = null
}

// Load base.config by default for all pipelines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix'
include { TABIX_TABIX } from '../../../modules/nf-core/tabix/tabix'
include { BCFTOOLS_NORM } from '../../../modules/nf-core/bcftools/norm'
include { BCFTOOLS_FILTER } from '../../../modules/nf-core/bcftools/filter'
include { BCFTOOLS_FILTER } from '../../../modules/nf-core/bcftools/filter'
include { BCFTOOLS_NORM } from '../../../modules/nf-core/bcftools/norm'
include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix'
include { TABIX_TABIX } from '../../../modules/nf-core/tabix/tabix'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN MAIN WORKFLOW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

workflow VCF_PREPROCESSING {
workflow FILE_PREPROCESSING {
take:
ch_samplesheet // channel: samplesheet read in from --input and processed by PIPELINE_INITIALISATION
fasta
Expand Down Expand Up @@ -60,15 +60,21 @@ workflow VCF_PREPROCESSING {

// Create index for files that need tabix
ch_vcf.to_tabix
.map { meta, vcf, _tbi ->
vcf: [meta, vcf]
}
.map { meta, vcf, _tbi -> tuple(meta.id, meta, vcf) }
.set { ch_vcf_to_tabix_keyed }

ch_vcf_to_tabix_keyed
.map { _id, meta, vcf -> [meta, vcf] }
.set { ch_vcf_to_tabix }

TABIX_TABIX(ch_vcf_to_tabix)

ch_vcf_to_tabix
.join(TABIX_TABIX.out.index)
ch_vcf_to_tabix_keyed
.join(
TABIX_TABIX.out.index.map { meta, tbi -> tuple(meta.id, meta, tbi) },
by: 0
)
.map { _id, meta, vcf, _meta2, tbi -> [meta, vcf, tbi] }
.set { ch_vcf_with_tabix }

// Combine all processed files into a final channel
Expand All @@ -84,7 +90,11 @@ workflow VCF_PREPROCESSING {
BCFTOOLS_FILTER(norm_ch)
filtered_ch = BCFTOOLS_FILTER.out.vcf.join(BCFTOOLS_FILTER.out.tbi)

normalised_germline = filtered_ch.filter { meta, _vcf, _tbi -> meta.status == 'germline' }
normalised_somatic = filtered_ch.filter { meta, _vcf, _tbi -> meta.status == 'somatic' }

emit:
filtered_ch // channel: [ meta, path(vcf_file), path(tbi_file), path(cna_file) ]
normalised_germline
normalised_somatic
ch_cna_files
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include { PCGR_PREPAREVCF } from '../../../modules/local/pcgr/preparevcf'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

workflow FORMAT_FILES {
workflow PREPARE_SOMATIC {
take:
vcf_files
cna_files
Expand Down
Loading