Remove single_end if/else

This commit is contained in:
Michael L Heuer 2021-02-05 11:35:11 -06:00
parent 31520fce97
commit 6b873d7d33
3 changed files with 15 additions and 39 deletions

View file

@ -2,7 +2,7 @@
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def options = initOptions(params.options)
process MINIMAP2_ALIGN {
tag "$meta.id"
@ -24,33 +24,20 @@ process MINIMAP2_ALIGN {
output:
tuple val(meta), path("*.paf"), emit: paf
path "*.version.txt" , emit: version
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
if (meta.single_end) {
"""
minimap2 \\
$options.args \\
-t $task.cpus \\
$reference \\
$reads \\
> ${prefix}.paf
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def input_reads = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
"""
minimap2 \\
$options.args \\
-t $task.cpus \\
$reference \\
$input_reads \\
> ${prefix}.paf
echo \$(minimap2 --version 2>&1) > ${software}.version.txt
"""
} else {
"""
minimap2 \\
$options.args \\
-t $task.cpus \\
$reference \\
${reads[0]} \\
${reads[1]} \\
> ${prefix}.paf
echo \$(minimap2 --version 2>&1) > ${software}.version.txt
"""
}
echo \$(minimap2 --version 2>&1) > ${software}.version.txt
"""
}

View file

@ -43,8 +43,8 @@ input:
- reads:
type: file
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
List of input FASTA or FASTQ files of size 1 and 2 for single-end
and paired-end data, respectively.
- reference:
type: file
description: |

View file

@ -24,14 +24,3 @@ workflow test_minimap2_align_paired_end {
file("${launchDir}/tests/data/fastq/rna/test_R2.fastq.gz", checkIfExists: true) ] ]
MINIMAP2_ALIGN ( input, fasta )
}
workflow test_minimap2_align_pairwise {
def fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true)
def input = []
input = [ [ id:'test', single_end:false ], // meta map
[ fasta ] ]
MINIMAP2_ALIGN ( input, fasta )
}