diff --git a/modules/bwa/index/main.nf b/modules/bwa/index/main.nf index 89102737787..ea3ee699c66 100644 --- a/modules/bwa/index/main.nf +++ b/modules/bwa/index/main.nf @@ -11,8 +11,8 @@ process BWA_INDEX { path fasta output: - path "bwa" , emit: index - path "versions.yml", emit: versions + tuple val("bwa/${fasta.baseName}"), path ("bwa") , emit: index + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' diff --git a/modules/bwa/mem/main.nf b/modules/bwa/mem/main.nf index 9695bd2dca1..17cf890d0f9 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -9,7 +9,7 @@ process BWA_MEM { input: tuple val(meta), path(reads) - path index + tuple val(index_path), path(index) val sort_bam output: @@ -23,13 +23,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_path \\ $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 e00538c919f..ca85d45dc12 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 + tuple val("bwamem2/${fasta}"), path("bwamem2"), emit: index + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' @@ -21,7 +21,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 6d4d8028edc..86aae1f1bd6 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -9,7 +9,7 @@ process BWAMEM2_MEM { input: tuple val(meta), path(reads) - path index + tuple val(index_path), path(index) val sort_bam output: @@ -23,14 +23,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_path \\ $reads \\ | samtools $samtools_command $args2 -@ $task.cpus -o ${prefix}.bam -