2021-02-09 10:50:32 +00:00
|
|
|
process UNTAR {
|
|
|
|
tag "$archive"
|
2021-03-16 17:16:47 +00:00
|
|
|
label 'process_low'
|
2021-02-09 10:50:32 +00:00
|
|
|
|
2022-03-01 11:41:20 +00:00
|
|
|
conda (params.enable_conda ? "conda-forge::tar=1.32" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' :
|
|
|
|
'biocontainers/biocontainers:v1.2.0_cv1' }"
|
2021-02-09 10:50:32 +00:00
|
|
|
|
|
|
|
input:
|
2022-03-21 13:49:28 +00:00
|
|
|
tuple val(meta), path(archive)
|
2021-02-09 10:50:32 +00:00
|
|
|
|
|
|
|
output:
|
2022-03-21 13:49:28 +00:00
|
|
|
tuple val(meta), path("$untar"), emit: untar
|
|
|
|
path "versions.yml" , emit: versions
|
2021-02-09 10:50:32 +00:00
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2021-02-09 10:50:32 +00:00
|
|
|
script:
|
2022-03-21 13:49:28 +00:00
|
|
|
def args = task.ext.args ?: ''
|
2021-11-26 07:58:40 +00:00
|
|
|
def args2 = task.ext.args2 ?: ''
|
2022-03-21 13:49:28 +00:00
|
|
|
untar = archive.toString() - '.tar.gz'
|
2021-02-09 10:50:32 +00:00
|
|
|
"""
|
2021-09-28 05:56:27 +00:00
|
|
|
tar \\
|
|
|
|
-xzvf \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
|
|
|
$archive \\
|
|
|
|
$args2 \\
|
2021-09-28 05:56:27 +00:00
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-02-09 10:50:32 +00:00
|
|
|
"""
|
2022-03-28 15:48:39 +00:00
|
|
|
|
|
|
|
stub:
|
|
|
|
untar = archive.toString() - '.tar.gz'
|
|
|
|
"""
|
|
|
|
touch $untar
|
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
"${task.process}":
|
|
|
|
untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
|
|
|
|
END_VERSIONS
|
|
|
|
"""
|
2021-02-09 10:50:32 +00:00
|
|
|
}
|