mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-12-22 15:08:17 +00:00
Start getting database prep ready
This commit is contained in:
parent
9fac82d342
commit
c7f022008c
5 changed files with 81 additions and 2 deletions
|
@ -23,6 +23,9 @@
|
|||
},
|
||||
"multiqc": {
|
||||
"git_sha": "20d8250d9f39ddb05dfb437603aaf99b5c0b2b41"
|
||||
},
|
||||
"untar": {
|
||||
"git_sha": "7ec09d0ef4df89617baacc9b2dafcddb7cd4b05a"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
36
modules/nf-core/modules/untar/main.nf
generated
Normal file
36
modules/nf-core/modules/untar/main.nf
generated
Normal file
|
@ -0,0 +1,36 @@
|
|||
process UNTAR {
|
||||
tag "$archive"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "conda-forge::tar=1.32" : null)
|
||||
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' }"
|
||||
|
||||
input:
|
||||
path archive
|
||||
|
||||
output:
|
||||
path "$untar" , emit: untar
|
||||
path "versions.yml", emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def args2 = task.ext.args2 ?: ''
|
||||
untar = archive.toString() - '.tar.gz'
|
||||
"""
|
||||
tar \\
|
||||
-xzvf \\
|
||||
$args \\
|
||||
$archive \\
|
||||
$args2 \\
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
28
modules/nf-core/modules/untar/meta.yml
generated
Normal file
28
modules/nf-core/modules/untar/meta.yml
generated
Normal file
|
@ -0,0 +1,28 @@
|
|||
name: untar
|
||||
description: Extract files.
|
||||
keywords:
|
||||
- untar
|
||||
- uncompress
|
||||
tools:
|
||||
- untar:
|
||||
description: |
|
||||
Extract tar.gz files.
|
||||
documentation: https://www.gnu.org/software/tar/manual/
|
||||
licence: ["GPL-3.0-or-later"]
|
||||
input:
|
||||
- archive:
|
||||
type: file
|
||||
description: File to be untar
|
||||
pattern: "*.{tar}.{gz}"
|
||||
output:
|
||||
- untar:
|
||||
type: file
|
||||
description:
|
||||
pattern: "*.*"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
authors:
|
||||
- "@joseespinosa"
|
||||
- "@drpatelh"
|
|
@ -19,8 +19,20 @@ workflow DB_CHECK {
|
|||
.dump(tag: "db_channel_prepped")
|
||||
.set{ dbs }
|
||||
|
||||
|
||||
parsed_samplesheet
|
||||
.branch {
|
||||
untar: it[0]['db_path'].toString().endsWith(".tar.gz")
|
||||
skip: true
|
||||
}
|
||||
.set{ ch_dbs_for_untar }
|
||||
|
||||
UNTAR ( ch_dbs_for_untar.untar )
|
||||
|
||||
ch_final_dbs = ch_dbs_for_untar.skip.mix( ch_dbs_untarred )
|
||||
|
||||
emit:
|
||||
dbs // channel: [ val(meta), [ db ] ]
|
||||
dbs = ch_final_dbs // channel: [ val(meta), [ db ] ]
|
||||
versions = DATABASE_CHECK.out.versions // channel: [ versions.yml ]
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ workflow INPUT_CHECK {
|
|||
}
|
||||
|
||||
// Function to get list of [ meta, [ fastq_1, fastq_2 ] ]
|
||||
def create_fastq_channel(LinkedHashMap row) {
|
||||
def create_fastq_channels(LinkedHashMap row) {
|
||||
// create meta map
|
||||
def meta = [:]
|
||||
meta.id = row.sample
|
||||
|
|
Loading…
Reference in a new issue