diff --git a/software/bwamem2/index/main.nf b/software/bwamem2/index/main.nf index 36e4d4cd..dce96899 100644 --- a/software/bwamem2/index/main.nf +++ b/software/bwamem2/index/main.nf @@ -22,14 +22,14 @@ process BWAMEM2_INDEX { path fasta output: - path "bwamem2" , emit: index + path "bwamem2" , emit: index path "*.version.txt", emit: version script: def software = getSoftwareName(task.process) """ - mkdir bwa - bwa-mem2 index $ioptions.args $fasta -p bwamem2/${fasta.baseName} + mkdir bwamem2 + bwa-mem2 index $options.args $fasta -p bwamem2/${fasta} echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt """ } diff --git a/software/bwamem2/mem/main.nf b/software/bwamem2/mem/main.nf index 05702a3c..82bbd564 100644 --- a/software/bwamem2/mem/main.nf +++ b/software/bwamem2/mem/main.nf @@ -21,6 +21,7 @@ process BWAMEM2_MEM { input: tuple val(meta), path(reads) path index + path fasta output: tuple val(meta), path("*.bam"), emit: bam diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.0123 b/tests/data/index/E_coli/bwamem2/NC_010473.fa.0123 new file mode 100644 index 00000000..a51298f8 Binary files /dev/null and b/tests/data/index/E_coli/bwamem2/NC_010473.fa.0123 differ diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.amb b/tests/data/index/E_coli/bwamem2/NC_010473.fa.amb new file mode 100644 index 00000000..7355c4ea --- /dev/null +++ b/tests/data/index/E_coli/bwamem2/NC_010473.fa.amb @@ -0,0 +1,3 @@ +4686137 1 2 +20895 1 Y +142347 1 R diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.ann b/tests/data/index/E_coli/bwamem2/NC_010473.fa.ann new file mode 100644 index 00000000..ddfe94ec --- /dev/null +++ b/tests/data/index/E_coli/bwamem2/NC_010473.fa.ann @@ -0,0 +1,3 @@ +4686137 1 11 +0 gi|170079663|ref|NC_010473.1| Escherichia coli str. K-12 substr. DH10B, complete genome +0 4686137 2 diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.bwt.2bit.64 b/tests/data/index/E_coli/bwamem2/NC_010473.fa.bwt.2bit.64 new file mode 100644 index 00000000..12ca5419 Binary files /dev/null and b/tests/data/index/E_coli/bwamem2/NC_010473.fa.bwt.2bit.64 differ diff --git a/tests/data/index/E_coli/bwamem2/NC_010473.fa.pac b/tests/data/index/E_coli/bwamem2/NC_010473.fa.pac new file mode 100644 index 00000000..3aebd5a6 Binary files /dev/null and b/tests/data/index/E_coli/bwamem2/NC_010473.fa.pac differ diff --git a/tests/software/bwamem2/index/main.nf b/tests/software/bwamem2/index/main.nf new file mode 100644 index 00000000..2c6085a6 --- /dev/null +++ b/tests/software/bwamem2/index/main.nf @@ -0,0 +1,9 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWAMEM2_INDEX } from '../../../../software/bwamem2/index/main.nf' addParams( options: [:] ) + +workflow test_bwamem2_index { + BWAMEM2_INDEX ( file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ) +} \ No newline at end of file diff --git a/tests/software/bwamem2/index/test.yml b/tests/software/bwamem2/index/test.yml new file mode 100644 index 00000000..b7ccf304 --- /dev/null +++ b/tests/software/bwamem2/index/test.yml @@ -0,0 +1,16 @@ +- name: bwamem2 index + command: nextflow run ./tests/software/bwamem2/index -entry test_bwamem2_index -c tests/config/nextflow.config + tags: + - bwamem2 + - bwamem2_index + files: + - path: output/bwamem2/bwamem2/NC_010473.fa.0123 + md5sum: e112e4d2fd893fb939d306b27ece9de5 + - path: output/bwamem2/bwamem2/NC_010473.fa.amb + md5sum: 942a990ae872f1c0b8d72dda2db405d5 + - path: output/bwamem2/bwamem2/NC_010473.fa.ann + md5sum: ebf1a0279cf5b8d7f1a8cb855a3a3705 + - path: output/bwamem2/bwamem2/NC_010473.fa.bwt.2bit.64 + md5sum: f0154573be12440aee294b726cd88c86 + - path: output/bwamem2/bwamem2/NC_010473.fa.pac + md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad diff --git a/tests/software/bwamem2/mem/main.nf b/tests/software/bwamem2/mem/main.nf new file mode 100644 index 00000000..e23c3c6a --- /dev/null +++ b/tests/software/bwamem2/mem/main.nf @@ -0,0 +1,38 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWAMEM2_MEM } from '../../../../software/bwamem2/mem/main.nf' addParams( options: [:] ) + +/* + * Test with single-end data + */ +workflow test_bwamem2_mem_single_end { + + def input = [] + input = [ [ id:'test', single_end:true ], // meta map + [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] + + BWAMEM2_MEM ( + input, + file("${launchDir}/tests/data/index/E_coli/bwamem2/", checkIfExists: true), + file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + ) +} + +/* + * Test with paired-end data + */ +workflow test_bwamem2_mem_paired_end { + + def input = [] + input = [ [ id:'test', single_end:false ], // meta map + [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ] + + BWAMEM2_MEM ( + input, + file("${launchDir}/tests/data/index/E_coli/bwamem2/", checkIfExists: true), + file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + ) +} diff --git a/tests/software/bwamem2/mem/test.yml b/tests/software/bwamem2/mem/test.yml new file mode 100644 index 00000000..6eeb6b14 --- /dev/null +++ b/tests/software/bwamem2/mem/test.yml @@ -0,0 +1,19 @@ +- name: bwamem2 mem single-end + command: nextflow run ./tests/software/bwamem2/mem -entry test_bwamem2_mem_single_end -c tests/config/nextflow.config + tags: + - bwamem2 + - bwamem2_mem + - bwamem2_mem_single_end + files: + - path: output/bwamem2/test.bam + md5sum: 354acd3b7033a2d4ee69452df18c0a4d + +- name: bwamem2 mem paired-end + command: nextflow run ./tests/software/bwamem2/mem -entry test_bwamem2_mem_paired_end -c tests/config/nextflow.config + tags: + - bwamem2 + - bwamem2_mem + - bwamem2_mem_paired_end + files: + - path: output/bwamem2/test.bam + md5sum: 26187528a7bde13a2a9e9dd549b9bcd0