diff --git a/CHANGELOG.md b/CHANGELOG.md index b94fd13..d01dc3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,5 +3,6 @@ - new modules: - bwa/index - bwa/mem + - also runs samtools sort & outputs index in bai format. - cutadapt - khmer/uniquekmers diff --git a/modules/CCBR/bwa/mem/main.nf b/modules/CCBR/bwa/mem/main.nf index d4bee76..f6eb0ee 100644 --- a/modules/CCBR/bwa/mem/main.nf +++ b/modules/CCBR/bwa/mem/main.nf @@ -9,8 +9,8 @@ process BWA_MEM { tuple val(meta_idx), path(index_files) output: - tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: versions + tuple val(meta), path("*.bam"), path("*.bai"), emit: bam + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -31,7 +31,9 @@ process BWA_MEM { -@ ${task.cpus} \\ -m 2G \\ -T \$TMP \\ - \$TMP/align.bam > ${prefix}.bam + --write-index \\ + -o ${prefix}.bam##idx##${prefix}.bam.bai \\ + \$TMP/align.bam cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -42,6 +44,6 @@ process BWA_MEM { stub: """ - touch ${meta.id}.bam versions.yml + touch ${meta.id}.bam ${meta.id}.bam.bai versions.yml """ } diff --git a/modules/CCBR/bwa/mem/meta.yml b/modules/CCBR/bwa/mem/meta.yml index 14feefe..a6dfccd 100644 --- a/modules/CCBR/bwa/mem/meta.yml +++ b/modules/CCBR/bwa/mem/meta.yml @@ -37,6 +37,10 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" + - bai: + type: file + description: Output BAI index file + pattern: "*.{bai}" - versions: type: file description: File containing software versions diff --git a/tests/modules/CCBR/bwa/mem/test.yml b/tests/modules/CCBR/bwa/mem/test.yml index 60b56c3..6299257 100644 --- a/tests/modules/CCBR/bwa/mem/test.yml +++ b/tests/modules/CCBR/bwa/mem/test.yml @@ -15,7 +15,18 @@ - path: output/bwa/bwa/genome.sa md5sum: ab3952cabf026b48cd3eb5bccbb636d1 - path: output/bwa/test.bam - md5sum: fe5a30103b245d81a8d37d6144794f56 + md5sum: 0f7b7413436295bcd839fec262eabb18 + - path: output/bwa/test.bam.bai + - path: output/bwa/versions.yml + +- name: bwa mem test_bwa_mem_single_end stub + command: nextflow run ./tests/modules/CCBR/bwa/mem -entry test_bwa_mem_single_end -c ./tests/config/nextflow.config -stub + tags: + - bwa/mem + - bwa + files: + - path: output/bwa/test.bam + - path: output/bwa/test.bam.bai - path: output/bwa/versions.yml - name: bwa mem test_bwa_mem_paired_end @@ -35,5 +46,6 @@ - path: output/bwa/bwa/genome.sa md5sum: ab3952cabf026b48cd3eb5bccbb636d1 - path: output/bwa/test.bam - md5sum: 06b8e7424d97add946ddb07e55f12962 + md5sum: ae4a49f2dd6a487d75f99c9d3b42858b + - path: output/bwa/test.bam.bai - path: output/bwa/versions.yml