mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-14 17:23:09 +00:00
Update UNTAR module
This commit is contained in:
parent
727291999b
commit
661cfbe012
3 changed files with 18 additions and 18 deletions
|
@ -173,7 +173,7 @@
|
||||||
},
|
},
|
||||||
"multiqc": {
|
"multiqc": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"git_sha": "ee80d14721e76e2e079103b8dcd5d57129e584ba",
|
"git_sha": "f2d63bd5b68925f98f572eed70993d205cc694b7",
|
||||||
"installed_by": ["modules"]
|
"installed_by": ["modules"]
|
||||||
},
|
},
|
||||||
"porechop/porechop": {
|
"porechop/porechop": {
|
||||||
|
@ -214,7 +214,7 @@
|
||||||
},
|
},
|
||||||
"untar": {
|
"untar": {
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
|
"git_sha": "b9829e1064382745d8dff7f1d74d2138d2864f71",
|
||||||
"installed_by": ["modules"]
|
"installed_by": ["modules"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
31
modules/nf-core/untar/main.nf
generated
31
modules/nf-core/untar/main.nf
generated
|
@ -2,17 +2,17 @@ process UNTAR {
|
||||||
tag "$archive"
|
tag "$archive"
|
||||||
label 'process_single'
|
label 'process_single'
|
||||||
|
|
||||||
conda "conda-forge::sed=4.7"
|
conda "conda-forge::sed=4.7 bioconda::grep=3.4 conda-forge::tar=1.34"
|
||||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
'https://depot.galaxyproject.org/singularity/ubuntu:20.04' :
|
'https://depot.galaxyproject.org/singularity/ubuntu:20.04' :
|
||||||
'ubuntu:20.04' }"
|
'docker.io/ubuntu:20.04' }"
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(archive)
|
tuple val(meta), path(archive)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("$untar"), emit: untar
|
tuple val(meta), path("$prefix"), emit: untar
|
||||||
path "versions.yml" , emit: versions
|
path "versions.yml" , emit: versions
|
||||||
|
|
||||||
when:
|
when:
|
||||||
task.ext.when == null || task.ext.when
|
task.ext.when == null || task.ext.when
|
||||||
|
@ -20,31 +20,29 @@ process UNTAR {
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def args2 = task.ext.args2 ?: ''
|
def args2 = task.ext.args2 ?: ''
|
||||||
untar = archive.toString() - '.tar.gz'
|
prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.baseName.toString().replaceFirst(/\.tar$/, ""))
|
||||||
|
|
||||||
"""
|
"""
|
||||||
mkdir output
|
mkdir $prefix
|
||||||
|
|
||||||
## Ensures --strip-components only applied when top level of tar contents is a directory
|
## Ensures --strip-components only applied when top level of tar contents is a directory
|
||||||
## If just files or multiple directories, place all in output
|
## If just files or multiple directories, place all in prefix
|
||||||
if [[ \$(tar -tzf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then
|
if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then
|
||||||
tar \\
|
tar \\
|
||||||
-C output --strip-components 1 \\
|
-C $prefix --strip-components 1 \\
|
||||||
-xzvf \\
|
-xavf \\
|
||||||
$args \\
|
$args \\
|
||||||
$archive \\
|
$archive \\
|
||||||
$args2
|
$args2
|
||||||
else
|
else
|
||||||
tar \\
|
tar \\
|
||||||
-C output \\
|
-C $prefix \\
|
||||||
-xzvf \\
|
-xavf \\
|
||||||
$args \\
|
$args \\
|
||||||
$archive \\
|
$archive \\
|
||||||
$args2
|
$args2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mv output ${untar}
|
|
||||||
|
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
|
untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
|
||||||
|
@ -52,9 +50,10 @@ process UNTAR {
|
||||||
"""
|
"""
|
||||||
|
|
||||||
stub:
|
stub:
|
||||||
untar = archive.toString() - '.tar.gz'
|
prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.toString().replaceFirst(/\.[^\.]+(.gz)?$/, ""))
|
||||||
"""
|
"""
|
||||||
touch $untar
|
mkdir $prefix
|
||||||
|
touch ${prefix}/file.txt
|
||||||
|
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
|
|
1
modules/nf-core/untar/meta.yml
generated
1
modules/nf-core/untar/meta.yml
generated
|
@ -3,6 +3,7 @@ description: Extract files.
|
||||||
keywords:
|
keywords:
|
||||||
- untar
|
- untar
|
||||||
- uncompress
|
- uncompress
|
||||||
|
- extract
|
||||||
tools:
|
tools:
|
||||||
- untar:
|
- untar:
|
||||||
description: |
|
description: |
|
||||||
|
|
Loading…
Reference in a new issue