From 989fb7d5b7db55d1fa305fad23877f95591f1e1a Mon Sep 17 00:00:00 2001 From: suzannejin <43495634+suzannejin@users.noreply.github.com> Date: Fri, 26 Mar 2021 12:46:46 +0100 Subject: [PATCH] modify test path - module gatk4 + added new module gatk4/haplotypecaller (#382) * new module: samtools/fastq * solve conflict: pytest_software.yml * solve linting conflicts * solved EditorConfig linting problem * Module samtools/fastq: * output compressed fastq.gz file(s) * add if conditionals for single/paired reads * samtools/fastq: modified test.yml * samtools/fastq: modified main.nf to avoid duplicated part of the script section * fix README.md * modify test path gatk4 * fix config * Add new module gatk4/haplotypecaller * solve check issues * fix test.yml file * fix test.yml gz.tbi * Update software/gatk4/haplotypecaller/main.nf Co-authored-by: Harshil Patel * Update software/gatk4/haplotypecaller/main.nf Co-authored-by: Harshil Patel * Update software/gatk4/haplotypecaller/main.nf Co-authored-by: Harshil Patel * Update software/gatk4/haplotypecaller/meta.yml Co-authored-by: Harshil Patel * Update software/gatk4/haplotypecaller/meta.yml Co-authored-by: Harshil Patel * Update tests/software/gatk4/haplotypecaller/main.nf Co-authored-by: Harshil Patel * Apply suggestions from code review Co-authored-by: suzannejin Co-authored-by: Harshil Patel --- software/gatk4/haplotypecaller/functions.nf | 60 ++++++++++++++++++ software/gatk4/haplotypecaller/main.nf | 52 +++++++++++++++ software/gatk4/haplotypecaller/meta.yml | 63 +++++++++++++++++++ tests/config/pytest_software.yml | 4 ++ tests/software/gatk4/applybqsr/main.nf | 26 ++++---- tests/software/gatk4/applybqsr/test.yml | 12 ++-- tests/software/gatk4/baserecalibrator/main.nf | 62 +++++++++--------- .../software/gatk4/baserecalibrator/test.yml | 8 +-- .../software/gatk4/bedtointervallist/main.nf | 4 +- .../software/gatk4/bedtointervallist/test.yml | 4 +- .../gatk4/createsequencedictionary/main.nf | 2 +- .../gatk4/createsequencedictionary/test.yml | 8 +-- tests/software/gatk4/fastqtosam/main.nf | 6 +- tests/software/gatk4/fastqtosam/test.yml | 4 +- tests/software/gatk4/haplotypecaller/main.nf | 17 +++++ tests/software/gatk4/haplotypecaller/test.yml | 13 ++++ .../software/gatk4/mergebamalignment/main.nf | 8 +-- .../software/gatk4/mergebamalignment/test.yml | 6 +- tests/software/gatk4/mergevcfs/main.nf | 14 ++--- tests/software/gatk4/mergevcfs/test.yml | 13 ++-- tests/software/gatk4/revertsam/main.nf | 2 +- tests/software/gatk4/revertsam/test.yml | 6 +- tests/software/gatk4/samtofastq/main.nf | 4 +- tests/software/gatk4/samtofastq/test.yml | 16 ++--- tests/software/gatk4/splitncigarreads/main.nf | 8 +-- .../software/gatk4/splitncigarreads/test.yml | 6 +- 26 files changed, 319 insertions(+), 109 deletions(-) create mode 100644 software/gatk4/haplotypecaller/functions.nf create mode 100644 software/gatk4/haplotypecaller/main.nf create mode 100644 software/gatk4/haplotypecaller/meta.yml create mode 100644 tests/software/gatk4/haplotypecaller/main.nf create mode 100644 tests/software/gatk4/haplotypecaller/test.yml diff --git a/software/gatk4/haplotypecaller/functions.nf b/software/gatk4/haplotypecaller/functions.nf new file mode 100644 index 00000000..f177f0c8 --- /dev/null +++ b/software/gatk4/haplotypecaller/functions.nf @@ -0,0 +1,60 @@ +/* + * ----------------------------------------------------- + * Utility functions used in nf-core DSL2 module files + * ----------------------------------------------------- + */ + +/* + * Extract name of software tool from process name using $task.process + */ +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +/* + * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules + */ +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_id = args.publish_by_id ?: false + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +/* + * Tidy up and join elements of a list to return a path string + */ +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +/* + * Function to save/publish module results + */ +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_id) { + path_list.add(args.publish_id) + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} diff --git a/software/gatk4/haplotypecaller/main.nf b/software/gatk4/haplotypecaller/main.nf new file mode 100644 index 00000000..d8938297 --- /dev/null +++ b/software/gatk4/haplotypecaller/main.nf @@ -0,0 +1,52 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process GATK4_HAPLOTYPECALLER { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + + conda (params.enable_conda ? "bioconda::gatk4=4.2.0.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0" + } else { + container "quay.io/biocontainers/gatk4:4.2.0.0--0" + } + + input: + tuple val(meta), path(bam), path(bai) + path fasta + path fai + path dict + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi + path "*.version.txt" , emit: version + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK HaplotypeCaller] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk \\ + --java-options "-Xmx${avail_mem}g" \\ + HaplotypeCaller \\ + -R $fasta \\ + -I $bam \\ + -O ${prefix}.vcf.gz \\ + $options.args + + gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt + """ +} diff --git a/software/gatk4/haplotypecaller/meta.yml b/software/gatk4/haplotypecaller/meta.yml new file mode 100644 index 00000000..f0fc3910 --- /dev/null +++ b/software/gatk4/haplotypecaller/meta.yml @@ -0,0 +1,63 @@ +name: gatk4_haplotypecaller +description: Call germline SNPs and indels via local re-assembly of haplotypes +keywords: + - gatk4 + - haplotypecaller + - haplotype +tools: + - gatk4: + description: | + Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools + with a primary focus on variant discovery and genotyping. Its powerful processing engine + and high-performance computing features make it capable of taking on projects of any size. + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + doi: 10.1158/1538-7445.AM2017-3590 + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file + pattern: "*.bam" + - bai: + type: file + description: Index of BAM file + pattern: "*.bam.bai" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" + - vcf: + type: file + description: Compressed VCF file + pattern: "*.vcf.gz" + - tbi: + type: file + description: Index of VCF file + pattern: "*.vcf.gz.tbi" + +authors: + - "@suzannejin" diff --git a/tests/config/pytest_software.yml b/tests/config/pytest_software.yml index 554d30d8..16aa1a31 100755 --- a/tests/config/pytest_software.yml +++ b/tests/config/pytest_software.yml @@ -202,6 +202,10 @@ gatk4_fastqtosam: - software/gatk4/fastqtosam/** - tests/software/gatk4/fastqtosam/** +gatk4_haplotypecaller: + - software/gatk4/haplotypecaller/** + - tests/software/gatk4/haplotypecaller/** + gatk4_mergebamalignment: - software/gatk4/mergebamalignment/** - tests/software/gatk4/mergebamalignment/** diff --git a/tests/software/gatk4/applybqsr/main.nf b/tests/software/gatk4/applybqsr/main.nf index 0029a508..2d3e532c 100644 --- a/tests/software/gatk4/applybqsr/main.nf +++ b/tests/software/gatk4/applybqsr/main.nf @@ -6,25 +6,25 @@ include { GATK4_APPLYBQSR } from '../../../../software/gatk4/applybqsr/main.nf' workflow test_gatk4_applybqsr { input = [ [ id:'test' ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/gatk/test.table", checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_baserecalibrator_table'], checkIfExists: true) ] - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - fai = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true) - dict = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) GATK4_APPLYBQSR ( input, fasta, fai, dict, [] ) } workflow test_gatk4_applybqsr_intervals { - input = [ [ id:'test' ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/gatk/test.table", checkIfExists: true) - ] - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - fai = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true) - dict = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) - intervals = file("${launchDir}/tests/data/genomics/sarscov2/genome/bed/test.bed", checkIfExists: true) + input = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_baserecalibrator_table'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + intervals = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) GATK4_APPLYBQSR ( input, fasta, fai, dict, intervals ) } diff --git a/tests/software/gatk4/applybqsr/test.yml b/tests/software/gatk4/applybqsr/test.yml index 9744aaa0..b17ffbe2 100644 --- a/tests/software/gatk4/applybqsr/test.yml +++ b/tests/software/gatk4/applybqsr/test.yml @@ -1,18 +1,18 @@ - name: gatk4 applybqsr test_gatk4_applybqsr command: nextflow run tests/software/gatk4/applybqsr -entry test_gatk4_applybqsr -c tests/config/nextflow.config tags: - - gatk4 - gatk4_applybqsr + - gatk4 files: - path: output/gatk4/test.bam - md5sum: 943a43de5f575a0435fe13072cbc15c8 + md5sum: 139a5ffc7601ce3cfa7a896cd381542a -- name: "\e[3~" +- name: gatk4 applybqsr test_gatk4_applybqsr_intervals command: nextflow run tests/software/gatk4/applybqsr -entry test_gatk4_applybqsr_intervals -c tests/config/nextflow.config tags: - - gatk4 - - gatk4_applybqsr_intervals - gatk4_applybqsr + - gatk4_applybqsr_intervals + - gatk4 files: - path: output/gatk4/test.bam - md5sum: a92238a9a78da48bf437fd5b7d9790a3 + md5sum: 5b1f6fa2525124c281f71e5a76d28482 diff --git a/tests/software/gatk4/baserecalibrator/main.nf b/tests/software/gatk4/baserecalibrator/main.nf index c93ef044..302ddb1f 100644 --- a/tests/software/gatk4/baserecalibrator/main.nf +++ b/tests/software/gatk4/baserecalibrator/main.nf @@ -5,45 +5,45 @@ nextflow.enable.dsl = 2 include { GATK4_BASERECALIBRATOR } from '../../../../software/gatk4/baserecalibrator/main.nf' addParams( options: [:] ) workflow test_gatk4_baserecalibrator { - input = [ [ id:'test' ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam", checkIfExists: true) - ] - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - fai = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true) - dict = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) - sites = file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz", checkIfExists: true) - sites_tbi = file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi", checkIfExists: true) + input = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + sites = file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) + sites_tbi = file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) - GATK4_BASERECALIBRATOR ( input, fasta, fai, dict, [], sites, sites_tbi ) + GATK4_BASERECALIBRATOR ( input, fasta, fai, dict, [], sites, sites_tbi ) } workflow test_gatk4_baserecalibrator_intervals { - input = [ [ id:'test' ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam", checkIfExists: true) - ] - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - fai = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true) - dict = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) - intervals = file("${launchDir}/tests/data/genomics/sarscov2/genome/bed/test.bed", checkIfExists: true) - sites = file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz", checkIfExists: true) - sites_tbi = file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi", checkIfExists: true) + input = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + intervals = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + sites = file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) + sites_tbi = file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) - GATK4_BASERECALIBRATOR ( input, fasta, fai, dict, intervals, sites, sites_tbi ) + GATK4_BASERECALIBRATOR ( input, fasta, fai, dict, intervals, sites, sites_tbi ) } workflow test_gatk4_baserecalibrator_multiple_sites { - input = [ [ id:'test' ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.sorted.bam", checkIfExists: true) - ] - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - fai = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true) - dict = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) - sites = [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz", checkIfExists: true) - ] - sites_tbi = [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi", checkIfExists: true) - ] + input = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + sites = [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) + ] + sites_tbi = [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) + ] GATK4_BASERECALIBRATOR ( input, fasta, fai, dict, [], sites, sites_tbi ) } diff --git a/tests/software/gatk4/baserecalibrator/test.yml b/tests/software/gatk4/baserecalibrator/test.yml index 61dd2283..c0011152 100644 --- a/tests/software/gatk4/baserecalibrator/test.yml +++ b/tests/software/gatk4/baserecalibrator/test.yml @@ -1,8 +1,8 @@ - name: gatk4 baserecalibrator test_gatk4_baserecalibrator command: nextflow run tests/software/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator -c tests/config/nextflow.config tags: - - gatk4 - gatk4_baserecalibrator + - gatk4 files: - path: output/gatk4/test.table md5sum: e2e43abdc0c943c1a54dae816d0b9ea7 @@ -10,9 +10,9 @@ - name: gatk4 baserecalibrator test_gatk4_baserecalibrator_intervals command: nextflow run tests/software/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator_intervals -c tests/config/nextflow.config tags: - - gatk4 - - gatk4_baserecalibrator - gatk4_baserecalibrator_intervals + - gatk4_baserecalibrator + - gatk4 files: - path: output/gatk4/test.table md5sum: 9ecb5f00a2229291705addc09c0ec231 @@ -21,8 +21,8 @@ command: nextflow run tests/software/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator_multiple_sites -c tests/config/nextflow.config tags: - gatk4_baserecalibrator_multiple_sites - - gatk4 - gatk4_baserecalibrator + - gatk4 files: - path: output/gatk4/test.table md5sum: e2e43abdc0c943c1a54dae816d0b9ea7 diff --git a/tests/software/gatk4/bedtointervallist/main.nf b/tests/software/gatk4/bedtointervallist/main.nf index 4b8c32d9..37cb164d 100644 --- a/tests/software/gatk4/bedtointervallist/main.nf +++ b/tests/software/gatk4/bedtointervallist/main.nf @@ -6,9 +6,9 @@ include { GATK4_BEDTOINTERVALLIST } from '../../../../software/gatk4/bedtointerv workflow test_gatk4_bedtointervallist { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/genome/bed/test.bed", checkIfExists: true)] + [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] ] - dict = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) GATK4_BEDTOINTERVALLIST ( input, dict ) } diff --git a/tests/software/gatk4/bedtointervallist/test.yml b/tests/software/gatk4/bedtointervallist/test.yml index 6612cd19..a8bb7bf0 100644 --- a/tests/software/gatk4/bedtointervallist/test.yml +++ b/tests/software/gatk4/bedtointervallist/test.yml @@ -1,5 +1,5 @@ -- name: gatk4 bedtointervallist - command: nextflow run ./tests/software/gatk4/bedtointervallist -entry test_gatk4_bedtointervallist -c tests/config/nextflow.config +- name: gatk4 bedtointervallist test_gatk4_bedtointervallist + command: nextflow run tests/software/gatk4/bedtointervallist -entry test_gatk4_bedtointervallist -c tests/config/nextflow.config tags: - gatk4 - gatk4_bedtointervallist diff --git a/tests/software/gatk4/createsequencedictionary/main.nf b/tests/software/gatk4/createsequencedictionary/main.nf index 5dfeb8cb..ff798693 100644 --- a/tests/software/gatk4/createsequencedictionary/main.nf +++ b/tests/software/gatk4/createsequencedictionary/main.nf @@ -5,7 +5,7 @@ nextflow.enable.dsl = 2 include { GATK4_CREATESEQUENCEDICTIONARY } from '../../../../software/gatk4/createsequencedictionary/main.nf' addParams( options: [:] ) workflow test_gatk4_createsequencedictionary { - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) GATK4_CREATESEQUENCEDICTIONARY ( fasta ) } diff --git a/tests/software/gatk4/createsequencedictionary/test.yml b/tests/software/gatk4/createsequencedictionary/test.yml index bbee03d7..4b849d5a 100644 --- a/tests/software/gatk4/createsequencedictionary/test.yml +++ b/tests/software/gatk4/createsequencedictionary/test.yml @@ -1,8 +1,8 @@ -- name: gatk4 createsequencedictionary - command: nextflow run ./tests/software/gatk4/createsequencedictionary -entry test_gatk4_createsequencedictionary -c tests/config/nextflow.config +- name: gatk4 createsequencedictionary test_gatk4_createsequencedictionary + command: nextflow run tests/software/gatk4/createsequencedictionary -entry test_gatk4_createsequencedictionary -c tests/config/nextflow.config tags: - gatk4 - gatk4_createsequencedictionary files: - - path: ./output/gatk4/test_genome.dict - md5sum: 829dd07bd0c9d3be2fd060238c0b37c3 + - path: output/gatk4/genome.dict + md5sum: 7362679f176e0f52add03c08f457f646 diff --git a/tests/software/gatk4/fastqtosam/main.nf b/tests/software/gatk4/fastqtosam/main.nf index a9d11295..82ddcb99 100644 --- a/tests/software/gatk4/fastqtosam/main.nf +++ b/tests/software/gatk4/fastqtosam/main.nf @@ -6,7 +6,7 @@ include { GATK4_FASTQTOSAM } from '../../../../software/gatk4/fastqtosam/main.nf workflow test_gatk4_fastqtosam_single_end { input = [ [ id:'test', single_end:true ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] GATK4_FASTQTOSAM ( input ) @@ -14,8 +14,8 @@ workflow test_gatk4_fastqtosam_single_end { workflow test_gatk4_fastqtosam_paired_end { input = [ [ id:'test', single_end:false ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/fastq/test_2.fastq.gz", checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] GATK4_FASTQTOSAM ( input ) diff --git a/tests/software/gatk4/fastqtosam/test.yml b/tests/software/gatk4/fastqtosam/test.yml index 7d4926b4..2674ab59 100644 --- a/tests/software/gatk4/fastqtosam/test.yml +++ b/tests/software/gatk4/fastqtosam/test.yml @@ -2,8 +2,8 @@ command: nextflow run tests/software/gatk4/fastqtosam -entry test_gatk4_fastqtosam_single_end -c tests/config/nextflow.config tags: - gatk4_fastqtosam_single_end - - gatk4_fastqtosam - gatk4 + - gatk4_fastqtosam files: - path: output/gatk4/test.bam md5sum: 4967100b2e4912c0e4ce0976d946bafb @@ -12,8 +12,8 @@ command: nextflow run tests/software/gatk4/fastqtosam -entry test_gatk4_fastqtosam_paired_end -c tests/config/nextflow.config tags: - gatk4_fastqtosam_paired_end - - gatk4_fastqtosam - gatk4 + - gatk4_fastqtosam files: - path: output/gatk4/test.bam md5sum: 4967100b2e4912c0e4ce0976d946bafb diff --git a/tests/software/gatk4/haplotypecaller/main.nf b/tests/software/gatk4/haplotypecaller/main.nf new file mode 100644 index 00000000..9e77d6aa --- /dev/null +++ b/tests/software/gatk4/haplotypecaller/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_HAPLOTYPECALLER } from '../../../../software/gatk4/haplotypecaller/main.nf' addParams( options: [:] ) + +workflow test_gatk4_haplotypecaller { + input = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + + GATK4_HAPLOTYPECALLER ( input, fasta, fai, dict ) +} diff --git a/tests/software/gatk4/haplotypecaller/test.yml b/tests/software/gatk4/haplotypecaller/test.yml new file mode 100644 index 00000000..42fd9e18 --- /dev/null +++ b/tests/software/gatk4/haplotypecaller/test.yml @@ -0,0 +1,13 @@ +- name: gatk4 haplotypecaller test_gatk4_haplotypecaller + command: nextflow run tests/software/gatk4/haplotypecaller -entry test_gatk4_haplotypecaller -c tests/config/nextflow.config + tags: + - gatk4_haplotypecaller + - gatk4 + files: + - path: output/gatk4/test.vcf.gz + should_exist: true + contains: + - 'MT192765.1' + - '54.60' + - '37.32' + - path: output/gatk4/test.vcf.gz.tbi diff --git a/tests/software/gatk4/mergebamalignment/main.nf b/tests/software/gatk4/mergebamalignment/main.nf index 31c8a99e..302f9db3 100644 --- a/tests/software/gatk4/mergebamalignment/main.nf +++ b/tests/software/gatk4/mergebamalignment/main.nf @@ -6,11 +6,11 @@ include { GATK4_MERGEBAMALIGNMENT } from '../../../../software/gatk4/mergebamali workflow test_gatk4_mergebamalignment { input = [ [ id:'test' ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_single_end.bam", checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) ] - unmapped = file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_unaligned.bam", checkIfExists: true) - fasta = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) - dict = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) + unmapped = file(params.test_data['sarscov2']['illumina']['test_unaligned_bam'], checkIfExists: true) + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) GATK4_MERGEBAMALIGNMENT ( input, unmapped, fasta, dict ) } diff --git a/tests/software/gatk4/mergebamalignment/test.yml b/tests/software/gatk4/mergebamalignment/test.yml index 088cd5d9..2fb1be5f 100644 --- a/tests/software/gatk4/mergebamalignment/test.yml +++ b/tests/software/gatk4/mergebamalignment/test.yml @@ -1,8 +1,8 @@ -- name: gatk4 mergebamalignment - command: nextflow run ./tests/software/gatk4/mergebamalignment -entry test_gatk4_mergebamalignment -c tests/config/nextflow.config +- name: gatk4 mergebamalignment test_gatk4_mergebamalignment + command: nextflow run tests/software/gatk4/mergebamalignment -entry test_gatk4_mergebamalignment -c tests/config/nextflow.config tags: - gatk4 - gatk4_mergebamalignment files: - path: output/gatk4/test.merged.bam - md5sum: 825816a6b288d644318c46cc9968e129 + md5sum: bd4a5e2ea916826aadebb5878333e26f diff --git a/tests/software/gatk4/mergevcfs/main.nf b/tests/software/gatk4/mergevcfs/main.nf index c7a3345e..26549c34 100644 --- a/tests/software/gatk4/mergevcfs/main.nf +++ b/tests/software/gatk4/mergevcfs/main.nf @@ -6,10 +6,10 @@ include { GATK4_MERGEVCFS } from '../../../../software/gatk4/mergevcfs/main.nf' workflow test_gatk4_mergevcfs { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test2.vcf", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf'], checkIfExists: true) ] ] - dict = file('tests/data/genomics/sarscov2/genome/genome.dict', checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) GATK4_MERGEVCFS ( input, dict, false ) } @@ -17,10 +17,10 @@ workflow test_gatk4_mergevcfs { workflow test_gatk4_mergevcfs_refdict { def input = [] input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test2.vcf", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf'], checkIfExists: true) ] ] - dict = file('tests/data/genomics/sarscov2/genome/genome.dict', checkIfExists: true) + dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) - GATK4_MERGEVCFS ( input, ref_dict, true ) + GATK4_MERGEVCFS ( input, dict, true ) } diff --git a/tests/software/gatk4/mergevcfs/test.yml b/tests/software/gatk4/mergevcfs/test.yml index 2bd2e50c..c461710b 100644 --- a/tests/software/gatk4/mergevcfs/test.yml +++ b/tests/software/gatk4/mergevcfs/test.yml @@ -1,17 +1,18 @@ -- name: gatk4 mergevcfs - command: nextflow run ./tests/software/gatk4/mergevcfs -entry test_gatk4_mergevcfs -c tests/config/nextflow.config +- name: gatk4 mergevcfs test_gatk4_mergevcfs + command: nextflow run tests/software/gatk4/mergevcfs -entry test_gatk4_mergevcfs -c tests/config/nextflow.config tags: - - gatk4 - gatk4_mergevcfs + - gatk4 files: - path: output/gatk4/test.merged.vcf.gz md5sum: ff48f175e26db2d4b2957762f6d1c715 -- name: gatk4 mergevcfs refdict - command: nextflow run ./tests/software/gatk4/mergevcfs -entry test_gatk4_mergevcfs_refdict -c tests/config/nextflow.config +- name: gatk4 mergevcfs test_gatk4_mergevcfs_refdict + command: nextflow run tests/software/gatk4/mergevcfs -entry test_gatk4_mergevcfs_refdict -c tests/config/nextflow.config tags: - - gatk4 - gatk4_mergevcfs + - gatk4 + - gatk4_mergevcfs_refdict files: - path: output/gatk4/test.merged.vcf.gz md5sum: ff48f175e26db2d4b2957762f6d1c715 diff --git a/tests/software/gatk4/revertsam/main.nf b/tests/software/gatk4/revertsam/main.nf index b452d0b5..2bc45f74 100644 --- a/tests/software/gatk4/revertsam/main.nf +++ b/tests/software/gatk4/revertsam/main.nf @@ -6,7 +6,7 @@ include { GATK4_REVERTSAM } from '../../../../software/gatk4/revertsam/main.nf' workflow test_gatk4_revertsam { input = [ [ id:'test' ], // meta map - file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.bam", checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ] GATK4_REVERTSAM ( input ) diff --git a/tests/software/gatk4/revertsam/test.yml b/tests/software/gatk4/revertsam/test.yml index 7689af98..221975bf 100644 --- a/tests/software/gatk4/revertsam/test.yml +++ b/tests/software/gatk4/revertsam/test.yml @@ -1,8 +1,8 @@ -- name: gatk4 revertsam - command: nextflow run ./tests/software/gatk4/revertsam -entry test_gatk4_revertsam -c tests/config/nextflow.config +- name: gatk4 revertsam test_gatk4_revertsam + command: nextflow run tests/software/gatk4/revertsam -entry test_gatk4_revertsam -c tests/config/nextflow.config tags: - gatk4 - gatk4_revertsam files: - path: output/gatk4/test.reverted.bam - md5sum: 6de199f7a0577e2a3fe7b3a9cb4ae25d + md5sum: f778310b18b83b49929eb648594f96dc diff --git a/tests/software/gatk4/samtofastq/main.nf b/tests/software/gatk4/samtofastq/main.nf index 1fb58138..9c3e5341 100644 --- a/tests/software/gatk4/samtofastq/main.nf +++ b/tests/software/gatk4/samtofastq/main.nf @@ -6,7 +6,7 @@ include { GATK4_SAMTOFASTQ } from '../../../../software/gatk4/samtofastq/main.nf workflow test_gatk4_samtofastq_single_end { input = [ [ id:'test', single_end: true ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_single_end.bam", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) ] ] GATK4_SAMTOFASTQ ( input ) @@ -14,7 +14,7 @@ workflow test_gatk4_samtofastq_single_end { workflow test_gatk4_samtofastq_paired_end { input = [ [ id:'test', single_end: false ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.bam", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ] ] GATK4_SAMTOFASTQ ( input ) diff --git a/tests/software/gatk4/samtofastq/test.yml b/tests/software/gatk4/samtofastq/test.yml index e47ac6eb..a2a900a1 100644 --- a/tests/software/gatk4/samtofastq/test.yml +++ b/tests/software/gatk4/samtofastq/test.yml @@ -1,21 +1,21 @@ -- name: gatk4 samtofastq single-end - command: nextflow run ./tests/software/gatk4/samtofastq -entry test_gatk4_samtofastq_single_end -c tests/config/nextflow.config +- name: gatk4 samtofastq test_gatk4_samtofastq_single_end + command: nextflow run tests/software/gatk4/samtofastq -entry test_gatk4_samtofastq_single_end -c tests/config/nextflow.config tags: - gatk4 - gatk4_samtofastq - gatk4_samtofastq_single_end files: - - path: ./output/gatk4/test.fastq.gz + - path: output/gatk4/test.fastq.gz md5sum: 50ace41d4c24467f24f8b929540a7797 -- name: gatk4 samtofastq paired-end - command: nextflow run ./tests/software/gatk4/samtofastq -entry test_gatk4_samtofastq_paired_end -c tests/config/nextflow.config +- name: gatk4 samtofastq test_gatk4_samtofastq_paired_end + command: nextflow run tests/software/gatk4/samtofastq -entry test_gatk4_samtofastq_paired_end -c tests/config/nextflow.config tags: - gatk4 - gatk4_samtofastq - gatk4_samtofastq_paired_end files: - - path: ./output/gatk4/test_2.fastq.gz - md5sum: 613bf64c023609e1c62ad6ce9e4be8d7 - - path: ./output/gatk4/test_1.fastq.gz + - path: output/gatk4/test_1.fastq.gz md5sum: cfea607c9d75fd9ea9704780ad3a499c + - path: output/gatk4/test_2.fastq.gz + md5sum: 613bf64c023609e1c62ad6ce9e4be8d7 diff --git a/tests/software/gatk4/splitncigarreads/main.nf b/tests/software/gatk4/splitncigarreads/main.nf index 5c3848f7..8dba64cb 100644 --- a/tests/software/gatk4/splitncigarreads/main.nf +++ b/tests/software/gatk4/splitncigarreads/main.nf @@ -6,11 +6,11 @@ include { GATK4_SPLITNCIGARREADS } from '../../../../software/gatk4/splitncigarr workflow test_gatk4_splitncigarreads { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/bam/test_paired_end.bam", checkIfExists: true)] + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ] ] - fasta = [ file("tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true), - file("tests/data/genomics/sarscov2/genome/genome.fasta.fai", checkIfExists: true), - file("tests/data/genomics/sarscov2/genome/genome.dict", checkIfExists: true) + fasta = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) ] GATK4_SPLITNCIGARREADS ( input, fasta ) diff --git a/tests/software/gatk4/splitncigarreads/test.yml b/tests/software/gatk4/splitncigarreads/test.yml index 4afa9fcf..8f08899d 100644 --- a/tests/software/gatk4/splitncigarreads/test.yml +++ b/tests/software/gatk4/splitncigarreads/test.yml @@ -1,8 +1,8 @@ -- name: gatk4 splitncigarreads - command: nextflow run ./tests/software/gatk4/splitncigarreads -entry test_gatk4_splitncigarreads -c tests/config/nextflow.config +- name: gatk4 splitncigarreads test_gatk4_splitncigarreads + command: nextflow run tests/software/gatk4/splitncigarreads -entry test_gatk4_splitncigarreads -c tests/config/nextflow.config tags: - gatk4 - gatk4_splitncigarreads files: - path: output/gatk4/test.split_cigar.bam - md5sum: 9dd44d3988b9ff238a6b4771cdf13eba + md5sum: a8473bd4abc7b13751fc51b92531da4c