Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
Kevin Menden 2020-12-09 15:45:05 +01:00 committed by GitHub
parent fee0707af1
commit 560a6a578b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,21 +19,24 @@ process BOWTIE_ALIGN {
path index path index
output: output:
tuple val(meta), path("*.sam") , emit: sam tuple val(meta), path("*.sam"), emit: sam
tuple val(meta), path("*.out") , emit: log tuple val(meta), path("*.out"), emit: log
path "bowtie.version.txt" , emit: version path "bowtie.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
index_array = index.collect() def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped" : ''
index = index_array[0].baseName - ~/.\d$/
""" """
bowtie $options.args \\ INDEX=`find -L ./ -name "*.1.ebwt" | sed 's/.1.ebwt//'`
--threads $task.cpus \\ bowtie \\
${index} \\ --threads $task.cpus \\
-q ${reads} \\ $options.args \\
--un ${prefix}.unAl > ${prefix}.sam 2> ${prefix}.out $INDEX \\
-q ${reads} \\
$unaligned \\
> ${prefix}.sam 2> ${prefix}.out
bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt
""" """
} }