mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-13 07:23:10 +00:00
Adds PoC of untarring system
This commit is contained in:
parent
c7f022008c
commit
631c115e10
5 changed files with 22 additions and 11 deletions
|
@ -82,7 +82,7 @@ process {
|
||||||
publishDir = [
|
publishDir = [
|
||||||
path: { "${params.outdir}/kraken2/${meta.db_name}" },
|
path: { "${params.outdir}/kraken2/${meta.db_name}" },
|
||||||
mode: 'copy',
|
mode: 'copy',
|
||||||
pattern: '.{fastq.gz,txt}'
|
pattern: '*.{fastq.gz,txt}'
|
||||||
]
|
]
|
||||||
ext.args = { "${meta.db_params}" }
|
ext.args = { "${meta.db_params}" }
|
||||||
ext.when = params.run_kraken2
|
ext.when = params.run_kraken2
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"git_sha": "20d8250d9f39ddb05dfb437603aaf99b5c0b2b41"
|
"git_sha": "20d8250d9f39ddb05dfb437603aaf99b5c0b2b41"
|
||||||
},
|
},
|
||||||
"untar": {
|
"untar": {
|
||||||
"git_sha": "7ec09d0ef4df89617baacc9b2dafcddb7cd4b05a"
|
"git_sha": "e080f4c8acf5760039ed12ec1f206170f3f9a918"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
modules/nf-core/modules/untar/main.nf
generated
10
modules/nf-core/modules/untar/main.nf
generated
|
@ -8,19 +8,19 @@ process UNTAR {
|
||||||
'biocontainers/biocontainers:v1.2.0_cv1' }"
|
'biocontainers/biocontainers:v1.2.0_cv1' }"
|
||||||
|
|
||||||
input:
|
input:
|
||||||
path archive
|
tuple val(meta), path(archive)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
path "$untar" , emit: untar
|
tuple val(meta), path("$untar"), 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
|
||||||
|
|
||||||
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'
|
untar = archive.toString() - '.tar.gz'
|
||||||
"""
|
"""
|
||||||
tar \\
|
tar \\
|
||||||
-xzvf \\
|
-xzvf \\
|
||||||
|
|
10
modules/nf-core/modules/untar/meta.yml
generated
10
modules/nf-core/modules/untar/meta.yml
generated
|
@ -10,11 +10,21 @@ tools:
|
||||||
documentation: https://www.gnu.org/software/tar/manual/
|
documentation: https://www.gnu.org/software/tar/manual/
|
||||||
licence: ["GPL-3.0-or-later"]
|
licence: ["GPL-3.0-or-later"]
|
||||||
input:
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
- archive:
|
- archive:
|
||||||
type: file
|
type: file
|
||||||
description: File to be untar
|
description: File to be untar
|
||||||
pattern: "*.{tar}.{gz}"
|
pattern: "*.{tar}.{gz}"
|
||||||
output:
|
output:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
- untar:
|
- untar:
|
||||||
type: file
|
type: file
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
include { DATABASE_CHECK } from '../../modules/local/database_check'
|
include { DATABASE_CHECK } from '../../modules/local/database_check'
|
||||||
|
include { UNTAR } from '../../modules/nf-core/modules/untar/main'
|
||||||
|
|
||||||
workflow DB_CHECK {
|
workflow DB_CHECK {
|
||||||
take:
|
take:
|
||||||
|
@ -17,19 +18,19 @@ workflow DB_CHECK {
|
||||||
.dump(tag: "db_split_csv_out")
|
.dump(tag: "db_split_csv_out")
|
||||||
.map { create_db_channels(it) }
|
.map { create_db_channels(it) }
|
||||||
.dump(tag: "db_channel_prepped")
|
.dump(tag: "db_channel_prepped")
|
||||||
.set{ dbs }
|
|
||||||
|
|
||||||
|
|
||||||
parsed_samplesheet
|
parsed_samplesheet
|
||||||
.branch {
|
.branch {
|
||||||
untar: it[0]['db_path'].toString().endsWith(".tar.gz")
|
untar: it[1].toString().endsWith(".tar.gz")
|
||||||
skip: true
|
skip: true
|
||||||
}
|
}
|
||||||
.set{ ch_dbs_for_untar }
|
.set{ ch_dbs_for_untar }
|
||||||
|
|
||||||
|
// TODO Filter to only run UNTAR on DBs of tools actually using?
|
||||||
|
// TODO make optional whether to save
|
||||||
UNTAR ( ch_dbs_for_untar.untar )
|
UNTAR ( ch_dbs_for_untar.untar )
|
||||||
|
|
||||||
ch_final_dbs = ch_dbs_for_untar.skip.mix( ch_dbs_untarred )
|
ch_final_dbs = ch_dbs_for_untar.skip.mix( UNTAR.out.untar )
|
||||||
|
|
||||||
emit:
|
emit:
|
||||||
dbs = ch_final_dbs // channel: [ val(meta), [ db ] ]
|
dbs = ch_final_dbs // channel: [ val(meta), [ db ] ]
|
||||||
|
|
Loading…
Reference in a new issue