Skip to content

Commit

Permalink
Merge pull request #1344 from nf-core/paper_review_again
Browse files Browse the repository at this point in the history
enable qc when starting from VC
  • Loading branch information
FriederikeHanssen authored Dec 4, 2023
2 parents 6505161 + d99eed9 commit 33c1a25
Show file tree
Hide file tree
Showing 26 changed files with 1,065 additions and 64 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- [#1339](https://github.com/nf-core/sarek/pull/1339) - Update sentieon-modules
- [#1344](https://github.com/nf-core/sarek/pull/1344) - Enable CRAM QC, when starting from variantcalling

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions conf/modules/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ process {
]
}

if ((params.step == 'mapping' || params.step == 'markduplicates'|| params.step == 'prepare_recalibration'|| params.step == 'recalibrate') && (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator')))) {
withName: 'NFCORE_SAREK:SAREK:CRAM_QC_RECAL:MOSDEPTH' {
if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'))) {
withName: 'NFCORE_SAREK:SAREK:CRAM_SAMPLEQC:CRAM_QC_RECAL:MOSDEPTH' {
ext.prefix = { "${meta.id}.recal" }
}

withName: 'NFCORE_SAREK:SAREK:CRAM_QC_RECAL:SAMTOOLS_STATS' {
withName: 'NFCORE_SAREK:SAREK:CRAM_SAMPLEQC:CRAM_QC_RECAL:SAMTOOLS_STATS' {
ext.prefix = { "${meta.id}.recal.cram" }
ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) }
publishDir = [
Expand Down
Binary file modified docs/images/sarek_subway.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 30 additions & 40 deletions docs/images/sarek_subway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 23 additions & 5 deletions subworkflows/local/cram_sampleqc/main.nf
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
include { BAM_NGSCHECKMATE } from '../../../subworkflows/nf-core/bam_ngscheckmate/main'

include { BAM_NGSCHECKMATE } from '../../../subworkflows/nf-core/bam_ngscheckmate/main'
include { CRAM_QC_MOSDEPTH_SAMTOOLS as CRAM_QC_RECAL } from '../../../subworkflows/local/cram_qc_mosdepth_samtools/main'
workflow CRAM_SAMPLEQC {

take:
ch_cram // channel: [ val(meta), cram, crai ]
ngscheckmate_bed // channel: [ ngscheckmate_bed ]
fasta // channel: [ fasta ]
ch_cram // channel: [ val(meta), cram, crai ]
ngscheckmate_bed // channel: [ ngscheckmate_bed ]
fasta // channel: [ fasta ]
skip_baserecalibration // boolean:
intervals_for_preprocessing // channel:

main:

ch_versions = Channel.empty()
reports = Channel.empty()

if(!skip_baserecalibration){

CRAM_QC_RECAL(
ch_cram,
fasta,
intervals_for_preprocessing)

// Gather QC reports
reports = CRAM_QC_RECAL.out.reports.collect{ meta, report -> report }

// Gather used softwares versions
ch_versions = ch_versions.mix(CRAM_QC_RECAL.out.versions)
}

ch_ngscheckmate_bed = ngscheckmate_bed.map{bed -> [[id: "ngscheckmate"], bed]}

Expand All @@ -24,6 +41,7 @@ workflow CRAM_SAMPLEQC {
all = BAM_NGSCHECKMATE.out.all // channel: [ meta, all ]
vcf = BAM_NGSCHECKMATE.out.vcf // channel: [ meta, vcf ]
pdf = BAM_NGSCHECKMATE.out.pdf // channel: [ meta, pdf ]
reports

versions = ch_versions // channel: [ versions.yml ]
}
Expand Down
70 changes: 70 additions & 0 deletions tests/test_cnvkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@
md5sum: b4a49faf170e436ec32dcc21ccc3ce8f
- path: results/cnvkit
should_exist: false
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt
md5sum: 69e29702ef01fd8f6c7a5468fc35a16a
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt
md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt
md5sum: 103098d0bf76ed82d2b87d5f242b099a
- path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz
md5sum: b5888cf7395c57d39879a5faa6159eb3
- path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi
md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee
- path: results/reports/samtools/sample3/sample3.recal.cram.stats
# conda changes md5sums for test
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt
md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt
md5sum: 39005ffaac22871ffaaf19656fe69c5b
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt
md5sum: 68d4b98f17361fddf73052ead34fa370
- path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz
md5sum: 2819e995eafded35f53328c4ec19ba58
- path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi
md5sum: 393c2749068304d8545b501b9d4658e4
- path: results/reports/samtools/sample4/sample4.recal.cram.stats
# conda changes md5sums for test
- name: Run variant calling on tumor_only sample with cnvkit
command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools cnvkit --outdir results
tags:
Expand Down Expand Up @@ -88,6 +112,17 @@
md5sum: e6d0190c1c37ce6e41f76ca5b24ccca3
- path: results/cnvkit
should_exist: false
- path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt
md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27
- path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt
md5sum: 39005ffaac22871ffaaf19656fe69c5b
- path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt
md5sum: 68d4b98f17361fddf73052ead34fa370
- path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz
md5sum: 2819e995eafded35f53328c4ec19ba58
- path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi
md5sum: 393c2749068304d8545b501b9d4658e4
- path: results/reports/samtools/sample2/sample2.recal.cram.stats
- name: Run variant calling on germline sample with cnvkit
command: nextflow run main.nf -profile test_cache,tools_germline --tools cnvkit --outdir results
tags:
Expand Down Expand Up @@ -121,6 +156,17 @@
md5sum: 79aae7e9c135fb8c65f8fbda12610faf
- path: results/cnvkit
should_exist: false
- path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt
md5sum: 69e29702ef01fd8f6c7a5468fc35a16a
- path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt
md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a
- path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt
md5sum: 103098d0bf76ed82d2b87d5f242b099a
- path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz
md5sum: b5888cf7395c57d39879a5faa6159eb3
- path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi
md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee
- path: results/reports/samtools/sample1/sample1.recal.cram.stats
- name: Run variant calling on somatic samples with cnvkit and skip variant calling on matched normal
command: nextflow run main.nf -profile test_cache,tools_somatic --tools cnvkit --only_paired_variant_calling --outdir results
tags:
Expand Down Expand Up @@ -156,3 +202,27 @@
md5sum: d15bf5061d90c8edbcba04d2bd2a270c
- path: results/variant_calling/cnvkit/sample4_vs_sample3/test2.paired_end.recalibrated.sorted.targetcoverage.cnn
md5sum: b4a49faf170e436ec32dcc21ccc3ce8f
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt
md5sum: 69e29702ef01fd8f6c7a5468fc35a16a
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt
md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt
md5sum: 103098d0bf76ed82d2b87d5f242b099a
- path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz
md5sum: b5888cf7395c57d39879a5faa6159eb3
- path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi
md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee
- path: results/reports/samtools/sample3/sample3.recal.cram.stats
# conda changes md5sums for test
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt
md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt
md5sum: 39005ffaac22871ffaaf19656fe69c5b
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt
md5sum: 68d4b98f17361fddf73052ead34fa370
- path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz
md5sum: 2819e995eafded35f53328c4ec19ba58
- path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi
md5sum: 393c2749068304d8545b501b9d4658e4
- path: results/reports/samtools/sample4/sample4.recal.cram.stats
# conda changes md5sums for test
55 changes: 55 additions & 0 deletions tests/test_controlfreec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,30 @@
should_exist: false
- path: results/cnvkit
should_exist: false
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt
md5sum: 69e29702ef01fd8f6c7a5468fc35a16a
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt
md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a
- path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt
md5sum: 103098d0bf76ed82d2b87d5f242b099a
- path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz
md5sum: b5888cf7395c57d39879a5faa6159eb3
- path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi
md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee
- path: results/reports/samtools/sample3/sample3.recal.cram.stats
# conda changes md5sums for test
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt
md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt
md5sum: 39005ffaac22871ffaaf19656fe69c5b
- path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt
md5sum: 68d4b98f17361fddf73052ead34fa370
- path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz
md5sum: 2819e995eafded35f53328c4ec19ba58
- path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi
md5sum: 393c2749068304d8545b501b9d4658e4
- path: results/reports/samtools/sample4/sample4.recal.cram.stats
# conda changes md5sums for test
- name: Run variant calling on somatic samples with controlfreec without intervals
command: nextflow run main.nf -profile test_cache,tools_somatic --tools controlfreec --no_intervals -stub-run --outdir results
tags:
Expand Down Expand Up @@ -105,6 +129,26 @@
should_exist: false
- path: results/mpileup
should_exist: false
- path: results/reports/mosdepth/sample3/sample3.recal.global.dist.txt
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample3/sample3.recal.summary.txt
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz.csi
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/samtools/sample3/sample3.recal.cram.stats
# conda changes md5sums for test
- path: results/reports/mosdepth/sample4/sample4.recal.global.dist.txt
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample4/sample4.recal.summary.txt
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz.csi
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/samtools/sample4/sample4.recal.cram.stats
# conda changes md5sums for test
- name: Run variant calling on tumor_only sample with controlfreec
command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools controlfreec -stub-run --outdir results
tags:
Expand Down Expand Up @@ -148,3 +192,14 @@
should_exist: false
- path: results/mpileup
should_exist: false
- path: results/reports/mosdepth/sample2/sample2.recal.global.dist.txt
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample2/sample2.recal.region.dist.txt
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample2/sample2.recal.summary.txt
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: results/reports/samtools/sample2/sample2.recal.cram.stats
Loading

0 comments on commit 33c1a25

Please sign in to comment.