update: gunzip to include meta input tuple (#1082)

* Specify more guidelines on input channels

* Linting

* Updates based on code review

* Update README.md

* Fix broken sentence

* feat: add megahit module, currently decompressed output

* Update main.nf

* Update tests/modules/megahit/test.yml

Co-authored-by: Maxime Borry <maxibor@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* feat: compress all outputs, remove md5sums due to gz stochasicity

* fix: wrong conda channel for pigz

* fix: broken singleend tests and update meta.yml

* Missed one

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* fix: pigz formatting

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Apply suggestions from code review

* Add bamUtil trimBam

* Update modules/bamutil/trimbam/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Update modules/bamutil/trimbam/main.nf

* Changes after code-review

* YAML lint

* update: add (optional) meta to input tuple

* YAML linting

* Update main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
Co-authored-by: Maxime Borry <maxibor@users.noreply.github.com>
Co-authored-by: Sébastien Guizard <sguizard@ed.ac.uk>
Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>
This commit is contained in:
James A. Fellows Yates 2021-11-21 13:41:03 +01:00 committed by GitHub
parent 29c669766d
commit d30bf235b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View file

@ -9,7 +9,7 @@ process GUNZIP {
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) }
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
conda (params.enable_conda ? "conda-forge::sed=4.7" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
@ -19,14 +19,14 @@ process GUNZIP {
}
input:
path archive
tuple val(meta), path(archive)
output:
path "$gunzip", emit: gunzip
path "versions.yml" , emit: versions
tuple val(meta), path("$gunzip"), emit: gunzip
path "versions.yml" , emit: versions
script:
gunzip = archive.toString() - '.gz'
gunzip = archive.toString() - '.gz'
"""
gunzip \\
-f \\

View file

@ -10,6 +10,11 @@ tools:
documentation: https://www.gnu.org/software/gzip/manual/gzip.html
licence: ['GPL-3.0-or-later']
input:
- meta:
type: map
description: |
Optional groovy Map containing meta information
e.g. [ id:'test', single_end:false ]
- archive:
type: file
description: File to be compressed/uncompressed
@ -26,3 +31,4 @@ output:
authors:
- "@joseespinosa"
- "@drpatelh"
- "@jfy133"

View file

@ -5,7 +5,9 @@ nextflow.enable.dsl = 2
include { GUNZIP } from '../../../modules/gunzip/main.nf' addParams( options: [:] )
workflow test_gunzip {
input = file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
input = [ [],
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
GUNZIP ( input )
}