Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Initial release of nf-core/createpanelrefs, created with the [nf-core](https://n
- [#54](https://github.com/nf-core/createpanelrefs/pull/54) - Update nft-utils to 0.0.4
- [#55](https://github.com/nf-core/createpanelrefs/pull/55) - Prepare relase 1.0.0
- [#63](https://github.com/nf-core/createpanelrefs/pull/63) - Template update for nf-core/tools v3.5.0dev
- [#66](https://github.com/nf-core/createpanelrefs/pull/66) - Update `GENS` to allow for creating a long-read PON

### `Fixed`

Expand All @@ -56,6 +57,7 @@ Initial release of nf-core/createpanelrefs, created with the [nf-core](https://n
| gatk4 | | 4.6.2.0 |
| gawk | | 5.3.0 |
| htslib | | 1.22.1 |
| mosdepth | | 0.3.11 |
| multiqc | | 1.32 |
| samtools | | 1.22.1 |

Expand Down
66 changes: 57 additions & 9 deletions conf/modules/gens_pon.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,70 @@ process {
]
}

withName: '.*GENS_PON:CAT_CAT' {
ext.prefix = { "${meta.id}_concat" }
}

withName: '.*GENS_PON:GATK4_COLLECTREADCOUNTS' {
ext.args = {"--format ${params.gens_readcount_format} --imr OVERLAPPING_ONLY"}
ext.args = { "--format ${params.gens_readcount_format} --imr OVERLAPPING_ONLY" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/gens_pon/readcounts" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
mode: params.publish_dir_mode,
path: { "${params.outdir}/gens_pon/readcounts" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: '.*GENS_PON:INTERVAL_LIST_TO_BED' {
ext.prefix = { "gens_coverage_bins" }
ext.suffix = "bed"
ext.args2 = '\'BEGIN { FS=OFS="\t" } $2 < $3 { print $1, $2, $3 }\''
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/references/intervals/gens_pon/" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: '.*GENS_PON:GATK4_CREATEREADCOUNTPANELOFNORMALS' {
ext.args = { ["--minimum-interval-median-percentile ${params.gens_min_interval_median_percentile}",
"--maximum-chunk-size ${params.gens_maximum_chunk_size}"].join(" ")}
ext.args = {
[
"--minimum-interval-median-percentile ${params.gens_min_interval_median_percentile}",
"--maximum-chunk-size ${params.gens_maximum_chunk_size}",
].join(" ")
}
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/gens_pon/createreadcountpanelofnormals" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
mode: params.publish_dir_mode,
path: { "${params.outdir}/gens_pon/createreadcountpanelofnormals" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: '.*GENS_PON:MOSDEPTH' {
ext.args = {
[
'--no-per-base',
'--fast-mode',
].join(' ')
}
}

withName: '.*GENS_PON:MOSDEPTH_GATK_FORMAT' {
ext.prefix = { "${meta.id}_gatk_formatted" }
ext.suffix = "gatk_format.tsv"
ext.args = { "-v sample=${meta.id}" }
ext.args2 = '\'BEGIN { OFS="\\t" } { $4 = int($4 + 0.5); $2++; print $1, $2, $3, $4 }\''
}

withName: '.*GENS_PON:MOSDEPTH_GATK_HEADER' {
// This requires meta.id to be the same as the sample name in the BAM/CRAM header
ext.args = { "-v sample=${meta.id}" }
ext.args2 = '\'{ print } END { print "@RG\\tID:GATKCopyNumber\\tSM:" sample; print "CONTIG\\tSTART\\tEND\\tCOUNT" }\''
ext.prefix = { "${meta.id}" }
ext.suffix = 'mosdepth_gatk_header.tsv'
}

withName: '.*GENS_PON:SAMTOOLS_VIEW' {
ext.args = '-H --output-fmt sam'
ext.prefix = { "${meta.id}.mosdepth_gatk_header" }
}
}
3 changes: 3 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ The reference file contains coverage information normalized across the cohort an
- `{pon_name}.hdf5`: Final panel of normals file in HDF5 format.
- `references/intervals/gens_pon/`
- `*.interval_list`: Interval list file used for read count collection.
- `*.bed`: BED versions of interval list file used for read count collection for long-reads.

</details>

[GENS](https://github.com/Clinical-Genomics-Lund/gens) creates a panel of normals for read-count denoising to improve somatic variant detection. The workflow: (1) indexes BAM/CRAM files if needed, (2) collects read counts at specified intervals using GATK's CollectReadCounts, and (3) creates a panel of normals using GATK's CreateReadCountPanelOfNormals. This panel can be used with GENS for somatic variant calling to reduce technical noise and improve variant detection sensitivity.

When `gens_analysis_type` is set to 'lrs', a modified version of the workflow above is run where coverage calculated by mosdepth is used instead of read counts.

### MultiQC

<details markdown="1">
Expand Down
4 changes: 4 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,17 @@ If you are running the pipeline to generate references for the GENS workflow, yo
| ------------- | --------------------- |
| fasta/genomes | fai |
| | dict |
| | gens_analysis_type |
| | gens_bin_length |
| | gens_pon_name |
| | gens_readcount_format |
| | gens_interval_list |

The GENS workflow creates a panel of normals for read-count denoising from normal samples. This panel can be used with GENS for somatic variant calling to reduce technical noise and improve variant detection. For more information, see the [GENS documentation](https://github.com/Clinical-Genomics-Lund/gens).

> [!NOTE]
> If `--gens_analysis_type` is set to 'lrs', this reqires the sample ID set in the sample sheet to be equal to the `SM` tag in the BAM-file.

### germlinecnvcaller

If you are running the pipeline to generate references for the GATK's germlinecnvcalling workflow, you should ensure that you have provided all the mandatory options specified in the table below.
Expand Down
4 changes: 3 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ workflow {
PIPELINE_INITIALISATION.out.samplesheet,
params.tools ?: "no_tools",
params.gcnv_model_name,
params.gens_analysis_type,
params.gens_pon_name,
params.mutect2_pon_name,
fasta,
Expand Down Expand Up @@ -232,6 +233,7 @@ workflow NFCORE_CREATEPANELREFS {
samplesheet // channel: samplesheet read in from --input
tools // string: comma separated list of tools to run
gcnv_model_name // string: name of gcnv model
gens_analysis_type // string: type of analysis for gens pon ('lrs' or 'srs')
gens_pon_name // string: name of gens pon
mutect2_pon_name // string: name of mutect2 pon
fasta // channel: [meta, fasta]
Expand All @@ -250,7 +252,7 @@ workflow NFCORE_CREATEPANELREFS {

main:
// WORKFLOW: Run pipeline
CREATEPANELREFS(samplesheet, tools, gcnv_model_name, gens_pon_name, mutect2_pon_name, fasta, dict, fai, cnvkit_targets, gcnv_exclude_bed, gcnv_exclude_interval_list, gcnv_mappable_regions, gcnv_ploidy_priors, gcnv_segmental_duplications, gcnv_target_bed, gcnv_target_interval_list, gens_interval_list, mutect2_target_bed)
CREATEPANELREFS(samplesheet, tools, gcnv_model_name, gens_analysis_type, gens_pon_name, mutect2_pon_name, fasta, dict, fai, cnvkit_targets, gcnv_exclude_bed, gcnv_exclude_interval_list, gcnv_mappable_regions, gcnv_ploidy_priors, gcnv_segmental_duplications, gcnv_target_bed, gcnv_target_interval_list, gens_interval_list, mutect2_target_bed)

emit:
versions = CREATEPANELREFS.out.versions // channel: versions.yml
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"cat/cat": {
"branch": "master",
"git_sha": "69614d4579a6bd9b8a2ecffb35959809d9c36559",
"installed_by": ["modules"]
},
"cnvkit/batch": {
"branch": "master",
"git_sha": "09223d6de1dab602242c4c57ab2a4599d460e528",
Expand Down Expand Up @@ -85,6 +90,11 @@
"git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46",
"installed_by": ["modules"]
},
"mosdepth": {
"branch": "master",
"git_sha": "6832b69ef7f98c54876d6436360b6b945370c615",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "af27af1be706e6a2bb8fe454175b0cdf77f47b49",
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/cat/cat/environment.yml

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

78 changes: 78 additions & 0 deletions modules/nf-core/cat/cat/main.nf

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

63 changes: 63 additions & 0 deletions modules/nf-core/cat/cat/meta.yml

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

Loading