diff --git a/CHANGELOG.md b/CHANGELOG.md index d37f9758..b0e6cf2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#150](https://github.com/nf-core/references/pull/150) - Replace `branch` with `filter` + `map` in datasheet_to_channel - [#151](https://github.com/nf-core/references/pull/151) - Enable static typing and replace `collectFile` with `WRITE_FILE` - [#153](https://github.com/nf-core/references/pull/153) - Update modules +- [#156](https://github.com/nf-core/references/pull/156) - Replace legacy `groupTuple` and `transpose` operators with `groupBy` and `flatMap` ### Removed diff --git a/main.nf b/main.nf index a35da70f..160fa852 100644 --- a/main.nf +++ b/main.nf @@ -60,11 +60,11 @@ workflow NFCORE_REFERENCES { ncbi_download_input = fasta_download_input.to_download .mix(gff_download_input.to_download, gtf_download_input.to_download) - .map { meta, _file -> - [meta.source_version, meta.reference, meta] - } - .groupTuple() - .map { acc, ref_types, metas -> + .map { meta, _file -> [meta.source_version, [meta.reference, meta]] } + .groupBy() + .map { acc, entries -> + def ref_types = entries.collect { entry -> entry[0] } + def metas = entries.collect { entry -> entry[1] } def includes = ref_types .collect { reference_ -> reference_ == 'fasta' diff --git a/subworkflows/local/datasheet_to_channel/main.nf b/subworkflows/local/datasheet_to_channel/main.nf index e58910e5..7de33db7 100644 --- a/subworkflows/local/datasheet_to_channel/main.nf +++ b/subworkflows/local/datasheet_to_channel/main.nf @@ -151,7 +151,7 @@ workflow DATASHEET_TO_CHANNEL { known_snps, pon, ) - .transpose() + .flatMap { meta, vcfs -> vcfs instanceof Path ? [[meta, vcfs]] : vcfs.toList().collect { vcf_ -> [meta, vcf_] } } emit: ascat_alleles = ascat_alleles // channel: [meta, *.ascat_alleles.txt] diff --git a/subworkflows/local/prepare_genome_rnaseq/main.nf b/subworkflows/local/prepare_genome_rnaseq/main.nf index 9489c595..fea63d5d 100644 --- a/subworkflows/local/prepare_genome_rnaseq/main.nf +++ b/subworkflows/local/prepare_genome_rnaseq/main.nf @@ -39,7 +39,7 @@ workflow PREPARE_GENOME_RNASEQ { gtf = gtf .mix(GFFREAD.out.gtf) - .groupTuple() + .groupBy() .map { meta, gtf_ -> gtf_[1] ? [meta, gtf_[1]] : [meta, gtf_[0]] } HISAT2_EXTRACTSPLICESITES(gtf.filter { meta, _gtf -> ('hisat2' in tools || 'hisat2_extractsplicesites' in tools) && meta.run_hisat2 && !hisat2_skip_splice_sites })