mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-21 10:48:18 +00:00
Added an output channel for the gzi index (#2036)
* When the `-i` option of bgzip is given, an index is created and needs to be considered an output * It is not necessary to use a subfolder * Updated meta.yml too * Also check that an index name hasn't been requested Co-authored-by: FriederikeHanssen <Friederike.hanssen@qbic.uni-tuebingen.de>
This commit is contained in:
parent
de7b50fdd0
commit
07e2868920
5 changed files with 33 additions and 0 deletions
|
@ -12,6 +12,7 @@ process TABIX_BGZIP {
|
|||
|
||||
output:
|
||||
tuple val(meta), path("${prefix}*"), emit: output
|
||||
tuple val(meta), path("*gzi") , emit: gzi, optional: true
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
|
@ -23,6 +24,10 @@ process TABIX_BGZIP {
|
|||
in_bgzip = input.toString().endsWith(".gz")
|
||||
command1 = in_bgzip ? '-d' : '-c'
|
||||
command2 = in_bgzip ? '' : " > ${prefix}.${input.getExtension()}.gz"
|
||||
// Name the index according to $prefix, unless a name has been requested
|
||||
if ((args.matches("(^| )-i\\b") || args.matches("(^| )--index(\$| )")) && !args.matches("(^| )-I\\b") && !args.matches("(^| )--index-name\\b")) {
|
||||
args = args + " -I ${prefix}.${input.getExtension()}.gz.gzi"
|
||||
}
|
||||
"""
|
||||
bgzip $command1 $args -@${task.cpus} $input $command2
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@ output:
|
|||
type: file
|
||||
description: Output compressed/decompressed file
|
||||
pattern: "*."
|
||||
- gzi:
|
||||
type: file
|
||||
description: Optional gzip index file for compressed inputs
|
||||
pattern: "*.gzi"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
nextflow.enable.dsl = 2
|
||||
|
||||
include { TABIX_BGZIP } from '../../../../modules/tabix/bgzip/main.nf'
|
||||
include { TABIX_BGZIP as TABIX_BGZIP_WITH_GZI } from '../../../../modules/tabix/bgzip/main.nf'
|
||||
|
||||
workflow test_tabix_bgzip_compress {
|
||||
input = [ [ id:'test' ], // meta map
|
||||
|
@ -12,6 +13,14 @@ workflow test_tabix_bgzip_compress {
|
|||
TABIX_BGZIP ( input )
|
||||
}
|
||||
|
||||
workflow test_tabix_bgzip_compress_gzi {
|
||||
input = [ [ id:'test' ], // meta map
|
||||
[ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ]
|
||||
]
|
||||
|
||||
TABIX_BGZIP_WITH_GZI ( input )
|
||||
}
|
||||
|
||||
workflow test_tabix_bgzip_decompress {
|
||||
input = [ [ id:'test' ], // meta map
|
||||
[ file(params.test_data['sarscov2']['genome']['test_bed_gz'], checkIfExists: true) ]
|
||||
|
|
|
@ -2,4 +2,7 @@ process {
|
|||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
withName: TABIX_BGZIP_WITH_GZI {
|
||||
ext.args = ' -i'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,18 @@
|
|||
files:
|
||||
- path: ./output/tabix/test.vcf.gz
|
||||
md5sum: fc178eb342a91dc0d1d568601ad8f8e2
|
||||
- path: ./output/tabix/test.vcf.gz.gzi
|
||||
should_exist: false
|
||||
- name: tabix bgzip compress gzi
|
||||
command: nextflow run ./tests/modules/tabix/bgzip -entry test_tabix_bgzip_compress_gzi -c ./tests/config/nextflow.config -c ./tests/modules/tabix/bgzip/nextflow.config
|
||||
tags:
|
||||
- tabix
|
||||
- tabix/bgzip
|
||||
files:
|
||||
- path: ./output/tabix/test.vcf.gz
|
||||
md5sum: fc178eb342a91dc0d1d568601ad8f8e2
|
||||
- path: ./output/tabix/test.vcf.gz.gzi
|
||||
md5sum: 7dea362b3fac8e00956a4952a3d4f474
|
||||
- name: tabix bgzip decompress
|
||||
command: nextflow run ./tests/modules/tabix/bgzip -entry test_tabix_bgzip_decompress -c ./tests/config/nextflow.config -c ./tests/modules/tabix/bgzip/nextflow.config
|
||||
tags:
|
||||
|
|
Loading…
Reference in a new issue