diff --git a/CHANGELOG.md b/CHANGELOG.md index 57e357c1d7..07d05e56b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [1695](https://github.com/nf-core/sarek/pull/1695) - Fix and update input_schema.json - [1702](https://github.com/nf-core/sarek/pull/1702) - Update nf-schema tests that were not failing on lenient mode - [1712](https://github.com/nf-core/sarek/pull/1712) - Fix missing import statements on error messages when starting without samplesheet +- [1733](https://github.com/nf-core/sarek/pull/1733) - Use original quality values if DeepVariant is run on recalibrated data ### Removed diff --git a/conf/modules/deepvariant.config b/conf/modules/deepvariant.config index ef5e31b796..222810e21f 100644 --- a/conf/modules/deepvariant.config +++ b/conf/modules/deepvariant.config @@ -16,7 +16,10 @@ process { withName: 'DEEPVARIANT_RUNDEEPVARIANT' { - ext.args = { params.wes ? "--model_type=WES" : "--model_type=WGS" } + ext.args = [ + params.wes ? "--model_type=WES" : "--model_type=WGS" , + !params.skip_tools?.contains("baserecalibrator") ? "--make_examples_extra_args '--parse_sam_aux_fields=true,--use_original_quality_scores=true'" : '' + ].join(' ').trim() ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.deepvariant" : "${meta.id}.deepvariant.${intervals.baseName}" } ext.when = { params.tools && params.tools.split(',').contains('deepvariant') } publishDir = [ diff --git a/nextflow.config b/nextflow.config index f01ed136d2..06b3cd1a31 100644 --- a/nextflow.config +++ b/nextflow.config @@ -296,7 +296,6 @@ profiles { targeted { includeConfig 'conf/test/targeted.config' } tools { includeConfig 'conf/test/tools.config' } tools_germline { includeConfig 'conf/test/tools_germline.config' } - tools_germline_deepvariant { includeConfig 'conf/test/tools_germline_deepvariant.config' } tools_somatic { includeConfig 'conf/test/tools_somatic.config' } tools_somatic_ascat { includeConfig 'conf/test/tools_somatic_ascat.config' } tools_tumoronly { includeConfig 'conf/test/tools_tumoronly.config' } diff --git a/tests/variant_calling_deepvariant.nf.test b/tests/variant_calling_deepvariant.nf.test new file mode 100644 index 0000000000..d8ea496c92 --- /dev/null +++ b/tests/variant_calling_deepvariant.nf.test @@ -0,0 +1,93 @@ +nextflow_pipeline { + + name "Test pipeline" + script "../main.nf" + tag "pipeline" + tag "pipeline_sarek" + + test("Run with profile test | --tools deepvariant") { + + when { + params { + modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' + fasta = "${params.modules_testdata_base_path}/genomics/homo_sapiens/genome/genome.fasta" + fasta_fai = "${params.modules_testdata_base_path}/genomics/homo_sapiens/genome/genome.fasta.fai" + intervals = "${params.modules_testdata_base_path}/genomics/homo_sapiens/genome/genome.bed" + input = "${projectDir}/tests/csv/3.0/mapped_single_cram.csv" + outdir = "$outputDir" + nucleotides_per_second = 20 + step = "variant_calling" + tools = 'deepvariant' + wes = true + } + } + + then { + // stable_name: All files + folders in ${params.outdir}/ with a stable name + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) + // stable_path: All files in ${params.outdir}/ with stable content + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') + // cram_files: All cram files + def cram_files = getAllFilesFromDir(params.outdir, include: ['**/*.cram']) + def fasta = params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta' + assertAll( + { assert workflow.success}, + { assert snapshot( + // Number of successful tasks + workflow.trace.succeeded().size(), + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions + removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), + // All stable path name, with a relative path + stable_name, + // All files with stable contents + stable_path, + // All cram files + cram_files.collect{ file -> [ file.getName(), cram(file.toString(), fasta).getReadsMD5() ] } + ).match() } + ) + } + } + + test("Run with profile test | --tools deepvariant --no_intervals") { + + when { + params { + modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' + fasta = "${params.modules_testdata_base_path}/genomics/homo_sapiens/genome/genome.fasta" + fasta_fai = "${params.modules_testdata_base_path}/genomics/homo_sapiens/genome/genome.fasta.fai" + intervals = "${params.modules_testdata_base_path}/genomics/homo_sapiens/genome/genome.bed" + input = "${projectDir}/tests/csv/3.0/mapped_single_cram.csv" + outdir = "$outputDir" + no_intervals = true + step = "variant_calling" + tools = 'deepvariant' + wes = true + } + } + + then { + // stable_name: All files + folders in ${params.outdir}/ with a stable name + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) + // stable_path: All files in ${params.outdir}/ with stable content + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') + // cram_files: All cram files + def cram_files = getAllFilesFromDir(params.outdir, include: ['**/*.cram']) + def fasta = params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta' + assertAll( + { assert workflow.success}, + { assert snapshot( + // Number of successful tasks + workflow.trace.succeeded().size(), + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions + removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), + // All stable path name, with a relative path + stable_name, + // All files with stable contents + stable_path, + // All cram files + cram_files.collect{ file -> [ file.getName(), cram(file.toString(), fasta).getReadsMD5() ] } + ).match() } + ) + } + } +}