Skip to content

Commit

Permalink
feat: try to improve index
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Mar 15, 2021
1 parent 1cad354 commit 35956ab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions modules/nf-core/software/bwa/index/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ process BWA_INDEX {
path fasta

output:
path "bwa" , emit: index
path "*.version.txt", emit: version
tuple val("bwa/$fasta.baseName"), path("bwa"), emit: index
path "*.version.txt" , emit: version

script:
def software = getSoftwareName(task.process)
Expand Down
6 changes: 2 additions & 4 deletions modules/nf-core/software/bwa/mem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ process BWA_MEM {

input:
tuple val(meta), path(reads)
path index
tuple val(index_name), path(index)

output:
tuple val(meta), path("*.bam"), emit: bam
Expand All @@ -31,13 +31,11 @@ process BWA_MEM {
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
bwa mem \\
$options.args \\
$read_group \\
-t $task.cpus \\
\$INDEX \\
$index_name \\
$reads \\
| samtools $options.args2 --threads $task.cpus -o ${prefix}.bam -
Expand Down
6 changes: 3 additions & 3 deletions modules/nf-core/software/bwamem2/index/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ process BWAMEM2_INDEX {
path fasta

output:
path "bwamem2" , emit: index
path "*.version.txt", emit: version
tuple val("bwamem2/$fasta.baseName"), path("bwamem2"), emit: index
path "*.version.txt" , emit: version

script:
def software = getSoftwareName(task.process)
"""
mkdir bwamem2
bwa-mem2 index $options.args $fasta -p bwamem2/${fasta}
bwa-mem2 index $options.args $fasta -p bwamem2/${fasta.baseName}
echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt
"""
}
6 changes: 2 additions & 4 deletions modules/nf-core/software/bwamem2/mem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ process BWAMEM2_MEM {

input:
tuple val(meta), path(reads)
path index
tuple val(index_name), path(index)

output:
tuple val(meta), path("*.bam"), emit: bam
Expand All @@ -31,13 +31,11 @@ process BWAMEM2_MEM {
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
bwa-mem2 mem \\
$options.args \\
$read_group \\
-t $task.cpus \\
\$INDEX \\
$index_name \\
$reads \\
| samtools $options.args2 -@ $task.cpus -o ${prefix}.bam -
Expand Down

0 comments on commit 35956ab

Please sign in to comment.