2021-02-17 16:09:24 +00:00
|
|
|
process SEQKIT_SPLIT2 {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
2021-07-28 08:10:44 +00:00
|
|
|
conda (params.enable_conda ? 'bioconda::seqkit=0.16.1' : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://depot.galaxyproject.org/singularity/seqkit:0.16.1--h9ee0642_0' :
|
|
|
|
'quay.io/biocontainers/seqkit:0.16.1--h9ee0642_0' }"
|
2021-02-17 16:09:24 +00:00
|
|
|
|
|
|
|
input:
|
2021-02-17 16:15:02 +00:00
|
|
|
tuple val(meta), path(reads)
|
2021-02-17 16:09:24 +00:00
|
|
|
|
|
|
|
output:
|
2021-09-28 13:37:47 +00:00
|
|
|
tuple val(meta), path("*${prefix}/*.gz"), emit: reads
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-02-17 16:09:24 +00:00
|
|
|
|
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
|
|
|
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
2021-02-23 13:09:46 +00:00
|
|
|
if(meta.single_end){
|
2021-09-28 13:37:47 +00:00
|
|
|
"""
|
|
|
|
seqkit \\
|
|
|
|
split2 \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2021-09-28 13:37:47 +00:00
|
|
|
--threads $task.cpus \\
|
|
|
|
-1 $reads \\
|
|
|
|
--out-dir $prefix
|
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
seqkit: \$(echo \$(seqkit 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
|
2021-09-28 13:37:47 +00:00
|
|
|
END_VERSIONS
|
|
|
|
"""
|
2021-02-23 13:09:46 +00:00
|
|
|
} else {
|
2021-09-28 13:37:47 +00:00
|
|
|
"""
|
|
|
|
seqkit \\
|
|
|
|
split2 \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2021-09-28 13:37:47 +00:00
|
|
|
--threads $task.cpus \\
|
|
|
|
-1 ${reads[0]} \\
|
|
|
|
-2 ${reads[1]} \\
|
|
|
|
--out-dir $prefix
|
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
seqkit: \$(echo \$(seqkit 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
|
2021-09-28 13:37:47 +00:00
|
|
|
END_VERSIONS
|
|
|
|
"""
|
2021-02-23 13:09:46 +00:00
|
|
|
}
|
2021-02-17 16:09:24 +00:00
|
|
|
}
|