diff --git a/modules/bwa/index/main.nf b/modules/bwa/index/main.nf index 3affbf16bc3..d99ae090c1b 100644 --- a/modules/bwa/index/main.nf +++ b/modules/bwa/index/main.nf @@ -11,7 +11,7 @@ process BWA_INDEX { path fasta output: - path "bwa" , emit: index + path "bwa/*" , emit: index path "versions.yml", emit: versions when: diff --git a/modules/bwa/mem/main.nf b/modules/bwa/mem/main.nf index 27ea6f42e5e..79bc44b0d45 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -26,13 +26,11 @@ process BWA_MEM { def read_group = meta.read_group ? "-R ${meta.read_group}" : "" def samtools_command = sort_bam ? 'sort' : 'view' """ - INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` - bwa mem \\ $args \\ $read_group \\ -t $task.cpus \\ - \$INDEX \\ + ${index[0].baseName} \\ $reads \\ | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - diff --git a/modules/bwamem2/index/main.nf b/modules/bwamem2/index/main.nf index 900f27d472a..71352dbd997 100644 --- a/modules/bwamem2/index/main.nf +++ b/modules/bwamem2/index/main.nf @@ -11,8 +11,8 @@ process BWAMEM2_INDEX { path fasta output: - path "bwamem2" , emit: index - path "versions.yml" , emit: versions + path "bwamem2/*" , emit: index + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -24,7 +24,8 @@ process BWAMEM2_INDEX { bwa-mem2 \\ index \\ $args \\ - $fasta -p bwamem2/${fasta} + -p bwamem2/${fasta} \\ + $fasta cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/bwamem2/mem/main.nf b/modules/bwamem2/mem/main.nf index e3a3d164eaa..8dc4df4ea4c 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -26,14 +26,12 @@ process BWAMEM2_MEM { def read_group = meta.read_group ? "-R ${meta.read_group}" : "" def samtools_command = sort_bam ? 'sort' : 'view' """ - INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` - bwa-mem2 \\ mem \\ $args \\ $read_group \\ -t $task.cpus \\ - \$INDEX \\ + ${index[0].baseName} \\ $reads \\ | samtools $samtools_command $args2 -@ $task.cpus -o ${prefix}.bam -