mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2025-01-18 02:46:13 -05:00
Remove single_end if/else
This commit is contained in:
parent
31520fce97
commit
6b873d7d33
3 changed files with 15 additions and 39 deletions
|
@ -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
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -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: |
|
||||
|
|
|
@ -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 )
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue