From 889465cb2b6f4f386af115f6787d22ed28e95a79 Mon Sep 17 00:00:00 2001 From: Mark-S-Hill <76998971+Mark-S-Hill@users.noreply.github.com> Date: Wed, 24 Mar 2021 18:14:11 +0000 Subject: [PATCH] update test data paths (#373) * update test data paths * Update test md5sums * gatk test fixes & update variantfiltration main * few extra fixes after review * fix suspected format error * Update software/gatk4/variantfiltration/main.nf * Update software/gatk4/variantfiltration/main.nf * Apply suggestions from code review Co-authored-by: Harshil Patel --- software/gatk4/variantfiltration/main.nf | 10 ++++++---- tests/software/bcftools/consensus/main.nf | 6 +++--- tests/software/bcftools/consensus/test.yml | 6 +++--- tests/software/bcftools/filter/main.nf | 2 +- tests/software/bcftools/filter/test.yml | 6 +++--- tests/software/bcftools/isec/main.nf | 8 ++++---- tests/software/bcftools/isec/test.yml | 12 ++++++------ tests/software/bcftools/merge/main.nf | 8 ++++---- tests/software/bcftools/merge/test.yml | 6 +++--- tests/software/bcftools/mpileup/main.nf | 4 ++-- tests/software/bcftools/mpileup/test.yml | 14 +++++++------- tests/software/bcftools/stats/main.nf | 2 +- tests/software/bcftools/stats/test.yml | 4 ++-- tests/software/gatk4/variantfiltration/main.nf | 14 +++++++------- tests/software/gatk4/variantfiltration/test.yml | 9 +++++---- 15 files changed, 57 insertions(+), 54 deletions(-) diff --git a/software/gatk4/variantfiltration/main.nf b/software/gatk4/variantfiltration/main.nf index e11e6038..698dfb4c 100644 --- a/software/gatk4/variantfiltration/main.nf +++ b/software/gatk4/variantfiltration/main.nf @@ -20,11 +20,13 @@ process GATK4_VARIANTFILTRATION { input: tuple val(meta), path(vcf) - tuple path(fasta), path(fai), path(dict) + path fasta + path fai + path dict output: - tuple val(meta), path("*filtered.vcf"), emit: vcf - path "*.version.txt" , emit: version + tuple val(meta), path("*.vcf"), emit: vcf + path "*.version.txt" , emit: version script: @@ -34,7 +36,7 @@ process GATK4_VARIANTFILTRATION { gatk VariantFiltration \\ -R $fasta \\ -V $vcf \\ - -O ${prefix}.filtered.vcf \\ + -O ${prefix}.vcf \\ $options.args gatk --version | grep Picard | sed "s/Picard Version: //g" > ${software}.version.txt diff --git a/tests/software/bcftools/consensus/main.nf b/tests/software/bcftools/consensus/main.nf index 0db78b20..822b6d57 100644 --- a/tests/software/bcftools/consensus/main.nf +++ b/tests/software/bcftools/consensus/main.nf @@ -6,9 +6,9 @@ include { BCFTOOLS_CONSENSUS } from '../../../../software/bcftools/consensus/mai workflow test_bcftools_consensus { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz", checkIfExists: true) ], - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi", checkIfExists: true) ], - [ file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ], + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) ], + [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] ] BCFTOOLS_CONSENSUS ( input ) diff --git a/tests/software/bcftools/consensus/test.yml b/tests/software/bcftools/consensus/test.yml index 9d239bc2..32c159ed 100644 --- a/tests/software/bcftools/consensus/test.yml +++ b/tests/software/bcftools/consensus/test.yml @@ -1,8 +1,8 @@ -- name: bcftools consensus - command: nextflow run ./tests/software/bcftools/consensus -entry test_bcftools_consensus -c tests/config/nextflow.config +- name: bcftools consensus test_bcftools_consensus + command: nextflow run tests/software/bcftools/consensus -entry test_bcftools_consensus -c tests/config/nextflow.config tags: - - bcftools - bcftools_consensus + - bcftools files: - path: output/bcftools/test.fa md5sum: e57d3e4d113f989bc069c5fd61627091 diff --git a/tests/software/bcftools/filter/main.nf b/tests/software/bcftools/filter/main.nf index fffc8814..d36811a2 100644 --- a/tests/software/bcftools/filter/main.nf +++ b/tests/software/bcftools/filter/main.nf @@ -7,7 +7,7 @@ include { BCFTOOLS_FILTER } from '../../../../software/bcftools/filter/main.nf' workflow test_bcftools_filter { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] ] BCFTOOLS_FILTER ( input ) diff --git a/tests/software/bcftools/filter/test.yml b/tests/software/bcftools/filter/test.yml index b1dfdfba..3b4d736a 100644 --- a/tests/software/bcftools/filter/test.yml +++ b/tests/software/bcftools/filter/test.yml @@ -1,8 +1,8 @@ -- name: bcftools filter - command: nextflow run ./tests/software/bcftools/filter -entry test_bcftools_filter -c tests/config/nextflow.config +- name: bcftools filter test_bcftools_filter + command: nextflow run tests/software/bcftools/filter -entry test_bcftools_filter -c tests/config/nextflow.config tags: - - bcftools - bcftools_filter + - bcftools files: - path: output/bcftools/test.vcf.gz md5sum: 9d491cfa84067450342ba8e66c75e5b8 diff --git a/tests/software/bcftools/isec/main.nf b/tests/software/bcftools/isec/main.nf index 488b57c4..aee566a9 100644 --- a/tests/software/bcftools/isec/main.nf +++ b/tests/software/bcftools/isec/main.nf @@ -6,10 +6,10 @@ include { BCFTOOLS_ISEC } from '../../../../software/bcftools/isec/main.nf' addP workflow test_bcftools_isec { input = [ [ id:'test' ], // meta map - [ 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)], - [ 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)] + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true)], + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true)] ] BCFTOOLS_ISEC ( input ) diff --git a/tests/software/bcftools/isec/test.yml b/tests/software/bcftools/isec/test.yml index 9fe06207..97520d8a 100644 --- a/tests/software/bcftools/isec/test.yml +++ b/tests/software/bcftools/isec/test.yml @@ -1,18 +1,18 @@ -- name: bcftools isec - command: nextflow run ./tests/software/bcftools/isec -entry test_bcftools_isec -c tests/config/nextflow.config +- name: bcftools isec test_bcftools_isec + command: nextflow run tests/software/bcftools/isec -entry test_bcftools_isec -c tests/config/nextflow.config tags: - bcftools - bcftools_isec files: - path: output/bcftools/test/0000.vcf.gz md5sum: fc178eb342a91dc0d1d568601ad8f8e2 + - path: output/bcftools/test/0001.vcf.gz.tbi + md5sum: 36e11bf96ed0af4a92caa91a68612d64 + - path: output/bcftools/test/sites.txt + md5sum: 1cea3fbde7f6d3c97f3d39036f9690df - path: output/bcftools/test/0000.vcf.gz.tbi md5sum: 36e11bf96ed0af4a92caa91a68612d64 - path: output/bcftools/test/0001.vcf.gz md5sum: fc178eb342a91dc0d1d568601ad8f8e2 - - path: output/bcftools/test/0001.vcf.gz.tbi - md5sum: 36e11bf96ed0af4a92caa91a68612d64 - path: output/bcftools/test/README.txt md5sum: 10fc33b66522645600d44afbd41fb792 - - path: output/bcftools/test/sites.txt - md5sum: 1cea3fbde7f6d3c97f3d39036f9690df diff --git a/tests/software/bcftools/merge/main.nf b/tests/software/bcftools/merge/main.nf index 1b8c74ef..63c0623e 100644 --- a/tests/software/bcftools/merge/main.nf +++ b/tests/software/bcftools/merge/main.nf @@ -7,10 +7,10 @@ include { BCFTOOLS_MERGE } from '../../../../software/bcftools/merge/main.nf' ad workflow test_bcftools_merge { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test3.vcf.gz", checkIfExists: true) ], - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi", checkIfExists: true), - file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true) ], + [ file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test3_vcf_gz_tbi'], checkIfExists: true) ] ] BCFTOOLS_MERGE ( input ) diff --git a/tests/software/bcftools/merge/test.yml b/tests/software/bcftools/merge/test.yml index d31ed1b9..9686df01 100644 --- a/tests/software/bcftools/merge/test.yml +++ b/tests/software/bcftools/merge/test.yml @@ -1,8 +1,8 @@ -- name: bcftools merge - command: nextflow run ./tests/software/bcftools/merge -entry test_bcftools_merge -c tests/config/nextflow.config +- name: bcftools merge test_bcftools_merge + command: nextflow run tests/software/bcftools/merge -entry test_bcftools_merge -c tests/config/nextflow.config tags: - - bcftools - bcftools_merge + - bcftools files: - path: output/bcftools/test.vcf.gz md5sum: 52165fc4149c61547e63800b876c9661 diff --git a/tests/software/bcftools/mpileup/main.nf b/tests/software/bcftools/mpileup/main.nf index d8c888e2..8952b2dd 100644 --- a/tests/software/bcftools/mpileup/main.nf +++ b/tests/software/bcftools/mpileup/main.nf @@ -7,8 +7,8 @@ include { BCFTOOLS_MPILEUP } from '../../../../software/bcftools/mpileup/main.nf workflow test_bcftools_mpileup { 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) ] + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ]] + fasta = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] BCFTOOLS_MPILEUP ( input, fasta ) } diff --git a/tests/software/bcftools/mpileup/test.yml b/tests/software/bcftools/mpileup/test.yml index 3703286a..51711dd2 100644 --- a/tests/software/bcftools/mpileup/test.yml +++ b/tests/software/bcftools/mpileup/test.yml @@ -1,12 +1,12 @@ -- name: bcftools mpileup - command: nextflow run ./tests/software/bcftools/mpileup -entry test_bcftools_mpileup -c tests/config/nextflow.config +- name: bcftools mpileup test_bcftools_mpileup + command: nextflow run tests/software/bcftools/mpileup -entry test_bcftools_mpileup -c tests/config/nextflow.config tags: - - bcftools - bcftools_mpileup + - bcftools files: - - path: output/bcftools/test.vcf.gz - md5sum: 518f770a9d04004c4493fc2167280653 - - path: output/bcftools/test.vcf.gz.tbi - md5sum: f4be4d707434b3b960fde100b7ec3bf3 - path: output/bcftools/test.bcftools_stats.txt md5sum: 2d506e32837a53a01fea0fc90402632a + - path: output/bcftools/test.vcf.gz.tbi + md5sum: 11d90b5b35e4adf6b44fc53bec93bed3 + - path: output/bcftools/test.vcf.gz + md5sum: 2cf273a9fa3784383799b6b24df2f88c diff --git a/tests/software/bcftools/stats/main.nf b/tests/software/bcftools/stats/main.nf index 069438d6..c591218d 100644 --- a/tests/software/bcftools/stats/main.nf +++ b/tests/software/bcftools/stats/main.nf @@ -6,7 +6,7 @@ include { BCFTOOLS_STATS } from '../../../../software/bcftools/stats/main.nf' ad workflow test_bcftools_stats { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf", checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] ] BCFTOOLS_STATS ( input ) diff --git a/tests/software/bcftools/stats/test.yml b/tests/software/bcftools/stats/test.yml index fa097efc..8a5d0c66 100644 --- a/tests/software/bcftools/stats/test.yml +++ b/tests/software/bcftools/stats/test.yml @@ -1,5 +1,5 @@ -- name: bcftools stats - command: nextflow run ./tests/software/bcftools/stats -entry test_bcftools_stats -c tests/config/nextflow.config +- name: bcftools stats test_bcftools_stats + command: nextflow run tests/software/bcftools/stats -entry test_bcftools_stats -c tests/config/nextflow.config tags: - bcftools - bcftools_stats diff --git a/tests/software/gatk4/variantfiltration/main.nf b/tests/software/gatk4/variantfiltration/main.nf index 13523045..efed5813 100644 --- a/tests/software/gatk4/variantfiltration/main.nf +++ b/tests/software/gatk4/variantfiltration/main.nf @@ -2,17 +2,17 @@ nextflow.enable.dsl = 2 -test_options = ['args': '--filter-name "test_filter" --filter-expression "MQ0 > 0"'] +test_options = ['args': '--filter-name "test_filter" --filter-expression "MQ0 > 0"', 'suffix': '.filtered'] include { GATK4_VARIANTFILTRATION } from '../../../../software/gatk4/variantfiltration/main.nf' addParams( options: test_options ) workflow test_gatk4_variantfiltration { input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/genomics/sarscov2/illumina/vcf/test.vcf", 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) + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], 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) ] + genome_dict = [ file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) ] - GATK4_VARIANTFILTRATION ( input, fasta ) + + GATK4_VARIANTFILTRATION ( input, fasta, fai, genome_dict ) } diff --git a/tests/software/gatk4/variantfiltration/test.yml b/tests/software/gatk4/variantfiltration/test.yml index 01031519..9b9ac948 100644 --- a/tests/software/gatk4/variantfiltration/test.yml +++ b/tests/software/gatk4/variantfiltration/test.yml @@ -1,8 +1,9 @@ -- name: Run tests for gatk4/variantfiltration - test_gatk4_variantfiltration - command: nextflow run tests/software/gatk4/variantfiltration -entry test_gatk4_variantfiltration - -c tests/config/nextflow.config +- name: gatk4 variantfiltration test_gatk4_variantfiltration + command: nextflow run tests/software/gatk4/variantfiltration -entry test_gatk4_variantfiltration -c tests/config/nextflow.config tags: - - gatk4 - gatk4_variantfiltration + - gatk4 files: - path: output/gatk4/test.filtered.vcf + contains: + - "AC=2;AN=2;DP=1;DP4=0,0,1,0;MQ=60;MQ0F=0;SGB=-0.379885"