mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-15 06:03:10 +00:00
d473a247d2
* Replace remaining task.ext.suffix with task.ext.prefix
50 lines
1.4 KiB
Text
50 lines
1.4 KiB
Text
process SEQKIT_SPLIT2 {
|
|
tag "$meta.id"
|
|
label 'process_medium'
|
|
|
|
conda (params.enable_conda ? 'bioconda::seqkit=2.1.0' : null)
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
'https://depot.galaxyproject.org/singularity/seqkit:2.1.0--h9ee0642_0' :
|
|
'quay.io/biocontainers/seqkit:2.1.0--h9ee0642_0' }"
|
|
|
|
input:
|
|
tuple val(meta), path(reads)
|
|
|
|
output:
|
|
tuple val(meta), path("**/*.gz"), emit: reads
|
|
path "versions.yml" , emit: versions
|
|
|
|
script:
|
|
def args = task.ext.args ?: ''
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
if(meta.single_end){
|
|
"""
|
|
seqkit \\
|
|
split2 \\
|
|
$args \\
|
|
--threads $task.cpus \\
|
|
$reads \\
|
|
--out-dir ${prefix}
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
"${task.process}":
|
|
seqkit: \$(echo \$(seqkit 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
|
|
END_VERSIONS
|
|
"""
|
|
} else {
|
|
"""
|
|
seqkit \\
|
|
split2 \\
|
|
$args \\
|
|
--threads $task.cpus \\
|
|
--read1 ${reads[0]} \\
|
|
--read2 ${reads[1]} \\
|
|
--out-dir ${prefix}
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
"${task.process}":
|
|
seqkit: \$(echo \$(seqkit 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
|
|
END_VERSIONS
|
|
"""
|
|
}
|
|
}
|