diff --git a/CHANGELOG.md b/CHANGELOG.md index a30a9119..e7103a14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#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` +- [#157](https://github.com/nf-core/references/pull/157) - Replace `.out` channel access with typed workflow return assignment ### Removed diff --git a/main.nf b/main.nf index 8d707abb..8df4abc1 100644 --- a/main.nf +++ b/main.nf @@ -44,19 +44,19 @@ workflow NFCORE_REFERENCES { main: - DATASHEET_TO_CHANNEL(references, tools) + ch_datasheet = DATASHEET_TO_CHANNEL(references, tools) // References that need to be extracted // (VCFs are not extracted) - ascat_alleles_input = need_extract(DATASHEET_TO_CHANNEL.out.ascat_alleles, 'ascat_alleles') - ascat_loci_input = need_extract(DATASHEET_TO_CHANNEL.out.ascat_loci, 'ascat_loci') - ascat_loci_gc_input = need_extract(DATASHEET_TO_CHANNEL.out.ascat_loci_gc, 'ascat_loci_gc') - ascat_loci_rt_input = need_extract(DATASHEET_TO_CHANNEL.out.ascat_loci_rt, 'ascat_loci_rt') - chr_dir_input = need_extract(DATASHEET_TO_CHANNEL.out.chr_dir, 'chr_dir') + ascat_alleles_input = need_extract(ch_datasheet.ascat_alleles, 'ascat_alleles') + ascat_loci_input = need_extract(ch_datasheet.ascat_loci, 'ascat_loci') + ascat_loci_gc_input = need_extract(ch_datasheet.ascat_loci_gc, 'ascat_loci_gc') + ascat_loci_rt_input = need_extract(ch_datasheet.ascat_loci_rt, 'ascat_loci_rt') + chr_dir_input = need_extract(ch_datasheet.chr_dir, 'chr_dir') - fasta_download_input = need_ncbi_download(DATASHEET_TO_CHANNEL.out.fasta, 'fasta') - gff_download_input = need_ncbi_download(DATASHEET_TO_CHANNEL.out.gff, 'gff') - gtf_download_input = need_ncbi_download(DATASHEET_TO_CHANNEL.out.gtf, 'gtf') + fasta_download_input = need_ncbi_download(ch_datasheet.fasta, 'fasta') + gff_download_input = need_ncbi_download(ch_datasheet.gff, 'gff') + gtf_download_input = need_ncbi_download(ch_datasheet.gtf, 'gtf') ncbi_download_input = fasta_download_input.to_download .mix(gff_download_input.to_download, gtf_download_input.to_download) @@ -80,7 +80,7 @@ workflow NFCORE_REFERENCES { [merged_meta, includes] } - NCBIDATASETSCLI_DATASETS(ncbi_download_input) + ch_ncbidatasetscli_datasets = NCBIDATASETSCLI_DATASETS(ncbi_download_input) fasta_input = need_extract(fasta_download_input.not_downloaded, 'fasta') gff_input = need_extract(gff_download_input.not_downloaded, 'gff') @@ -100,16 +100,16 @@ workflow NFCORE_REFERENCES { ) // Extract references from any archive format - ARCHIVE_EXTRACT(archive_to_extract) + ch_archive_extract = ARCHIVE_EXTRACT(archive_to_extract) // return to the appropriate channels - extracted_fasta = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'fasta' } - extracted_gff = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'gff' } - extracted_gtf = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'gtf' } + extracted_fasta = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'fasta' } + extracted_gff = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'gff' } + extracted_gtf = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'gtf' } // This is a confidence check def assigned_references = ['ascat_alleles', 'ascat_loci', 'ascat_loci_gc', 'ascat_loci_rt', 'chr_dir', 'fasta', 'gff', 'gtf'] as Set - ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> !(meta.reference in assigned_references) }.view { reference -> log.warn("Non assigned extracted reference: " + reference) } + ch_archive_extract.extracted.filter { meta, _ref -> !(meta.reference in assigned_references) }.view { reference -> log.warn("Non assigned extracted reference: " + reference) } // WORKFLOW: Run pipeline // Mix the references that were extracted with the references that did not need to be extracted @@ -117,52 +117,52 @@ workflow NFCORE_REFERENCES { // TODO: check if more references need to be extracted altliftoverfile = false - fasta = fasta_input.not_extracted.mix(extracted_fasta, NCBIDATASETSCLI_DATASETS.out.fna.map { meta, file -> [meta + record(reference: 'fasta', file: 'fasta'), file] }) - gff = gff_input.not_extracted.mix(extracted_gff, NCBIDATASETSCLI_DATASETS.out.gff.map { meta, file -> [meta + record(reference: 'gff', file: 'gff'), file] }) - gtf = gtf_input.not_extracted.mix(extracted_gtf, NCBIDATASETSCLI_DATASETS.out.gtf.map { meta, file -> [meta + record(reference: 'gtf', file: 'gtf'), file] }) + fasta = fasta_input.not_extracted.mix(extracted_fasta, ch_ncbidatasetscli_datasets.fna.map { meta, file -> [meta + record(reference: 'fasta', file: 'fasta'), file] }) + gff = gff_input.not_extracted.mix(extracted_gff, ch_ncbidatasetscli_datasets.gff.map { meta, file -> [meta + record(reference: 'gff', file: 'gff'), file] }) + gtf = gtf_input.not_extracted.mix(extracted_gtf, ch_ncbidatasetscli_datasets.gtf.map { meta, file -> [meta + record(reference: 'gtf', file: 'gtf'), file] }) - REFERENCES( + ch_references = REFERENCES( altliftoverfile, fasta, - DATASHEET_TO_CHANNEL.out.fasta_fai, + ch_datasheet.fasta_fai, gff, gtf, - DATASHEET_TO_CHANNEL.out.splice_sites, - DATASHEET_TO_CHANNEL.out.transcript_fasta, - DATASHEET_TO_CHANNEL.out.vcf, + ch_datasheet.splice_sites, + ch_datasheet.transcript_fasta, + ch_datasheet.vcf, tools, params.hisat2_build_memory, params.hisat2_skip_splice_sites, ) emit: - ascat_alleles = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'ascat_alleles' } - ascat_loci = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'ascat_loci' } - ascat_loci_gc = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'ascat_loci_gc' } - ascat_loci_rt = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'ascat_loci_rt' } - bowtie1_index = REFERENCES.out.bowtie1_index - bowtie2_index = REFERENCES.out.bowtie2_index - bwamem1_index = REFERENCES.out.bwamem1_index - bwamem2_index = REFERENCES.out.bwamem2_index - chr_dir = ARCHIVE_EXTRACT.out.extracted.filter { meta, _ref -> meta.reference == 'chr_dir' } - dragmap_hashmap = REFERENCES.out.dragmap_hashmap - fasta = extracted_fasta.mix(NCBIDATASETSCLI_DATASETS.out.fna.map { meta, file -> [meta + record(reference: 'fasta', file: 'fasta'), file] }) - fasta_dict = REFERENCES.out.fasta_dict - fasta_fai = REFERENCES.out.fasta_fai - fasta_sizes = REFERENCES.out.fasta_sizes - gff = extracted_gff.mix(NCBIDATASETSCLI_DATASETS.out.gff.map { meta, file -> [meta + record(reference: 'gff', file: 'gff'), file] }) - gtf = REFERENCES.out.gtf - hisat2_index = REFERENCES.out.hisat2_index - intervals_bed = REFERENCES.out.intervals_bed - kallisto_index = REFERENCES.out.kallisto_index - msisensorpro_list = REFERENCES.out.msisensorpro_list - rsem_index = REFERENCES.out.rsem_index - salmon_index = REFERENCES.out.salmon_index - snapaligner_index = REFERENCES.out.snapaligner_index - splice_sites = REFERENCES.out.splice_sites - star_index = REFERENCES.out.star_index - transcript_fasta = REFERENCES.out.transcript_fasta - vcf_tbi = REFERENCES.out.vcf_tbi + ascat_alleles = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'ascat_alleles' } + ascat_loci = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'ascat_loci' } + ascat_loci_gc = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'ascat_loci_gc' } + ascat_loci_rt = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'ascat_loci_rt' } + bowtie1_index = ch_references.bowtie1_index + bowtie2_index = ch_references.bowtie2_index + bwamem1_index = ch_references.bwamem1_index + bwamem2_index = ch_references.bwamem2_index + chr_dir = ch_archive_extract.extracted.filter { meta, _ref -> meta.reference == 'chr_dir' } + dragmap_hashmap = ch_references.dragmap_hashmap + fasta = extracted_fasta.mix(ch_ncbidatasetscli_datasets.fna.map { meta, file -> [meta + record(reference: 'fasta', file: 'fasta'), file] }) + fasta_dict = ch_references.fasta_dict + fasta_fai = ch_references.fasta_fai + fasta_sizes = ch_references.fasta_sizes + gff = extracted_gff.mix(ch_ncbidatasetscli_datasets.gff.map { meta, file -> [meta + record(reference: 'gff', file: 'gff'), file] }) + gtf = ch_references.gtf + hisat2_index = ch_references.hisat2_index + intervals_bed = ch_references.intervals_bed + kallisto_index = ch_references.kallisto_index + msisensorpro_list = ch_references.msisensorpro_list + rsem_index = ch_references.rsem_index + salmon_index = ch_references.salmon_index + snapaligner_index = ch_references.snapaligner_index + splice_sites = ch_references.splice_sites + star_index = ch_references.star_index + transcript_fasta = ch_references.transcript_fasta + vcf_tbi = ch_references.vcf_tbi } /* @@ -285,7 +285,7 @@ workflow { def tools = defineToolsList(params.tools_bundle, params.tools, params.skip_tools) // SUBWORKFLOW: Run initialisation tasks - PIPELINE_INITIALISATION( + ch_pipeline_initialisation = PIPELINE_INITIALISATION( params.version, params.validate_params, params.monochrome_logs, @@ -301,7 +301,7 @@ workflow { ) // WORKFLOW: Run main workflow - NFCORE_REFERENCES(PIPELINE_INITIALISATION.out.references, tools) + ch_nfcore_references = NFCORE_REFERENCES(ch_pipeline_initialisation.references, tools) // VERSIONS collated_versions = softwareVersionsToYAML(channel.topic('versions')) @@ -330,7 +330,7 @@ workflow { multiqc_files = multiqc_files.mix(ch_collected_files) - MULTIQC( + ch_multiqc = MULTIQC( multiqc_files.flatten().collect().map { files -> [ [id: 'references'], @@ -344,7 +344,7 @@ workflow { ] } ) - multiqc_report = MULTIQC.out.report.map { _meta, report -> [report] }.toList() + multiqc_report = ch_multiqc.report.map { _meta, report -> [report] }.toList() // SUBWORKFLOW: Run completion tasks PIPELINE_COMPLETION( @@ -353,39 +353,39 @@ workflow { params.plaintext_email, params.outdir, params.monochrome_logs, - MULTIQC.out.report.toList(), + ch_multiqc.report.toList(), ) publish: - multiqc = MULTIQC.out.data.mix(MULTIQC.out.plots, MULTIQC.out.report) + multiqc = ch_multiqc.data.mix(ch_multiqc.plots, ch_multiqc.report) versions = ch_collected_files.filter { file -> file.name.contains('versions') } - ascat_alleles = NFCORE_REFERENCES.out.ascat_alleles - ascat_loci = NFCORE_REFERENCES.out.ascat_loci - ascat_loci_gc = NFCORE_REFERENCES.out.ascat_loci_gc - ascat_loci_rt = NFCORE_REFERENCES.out.ascat_loci_rt - bowtie1_index = NFCORE_REFERENCES.out.bowtie1_index - bowtie2_index = NFCORE_REFERENCES.out.bowtie2_index - bwamem1_index = NFCORE_REFERENCES.out.bwamem1_index - bwamem2_index = NFCORE_REFERENCES.out.bwamem2_index - chr_dir = NFCORE_REFERENCES.out.chr_dir - dragmap_hashmap = NFCORE_REFERENCES.out.dragmap_hashmap - fasta = NFCORE_REFERENCES.out.fasta - fasta_dict = NFCORE_REFERENCES.out.fasta_dict - fasta_fai = NFCORE_REFERENCES.out.fasta_fai - fasta_sizes = NFCORE_REFERENCES.out.fasta_sizes - gff = NFCORE_REFERENCES.out.gff - gtf = NFCORE_REFERENCES.out.gtf - hisat2_index = NFCORE_REFERENCES.out.hisat2_index - intervals_bed = NFCORE_REFERENCES.out.intervals_bed - kallisto_index = NFCORE_REFERENCES.out.kallisto_index - msisensorpro_list = NFCORE_REFERENCES.out.msisensorpro_list - rsem_index = NFCORE_REFERENCES.out.rsem_index - salmon_index = NFCORE_REFERENCES.out.salmon_index - snapaligner_index = NFCORE_REFERENCES.out.snapaligner_index - splice_sites = NFCORE_REFERENCES.out.splice_sites - star_index = NFCORE_REFERENCES.out.star_index - transcript_fasta = NFCORE_REFERENCES.out.transcript_fasta - vcf_tbi = NFCORE_REFERENCES.out.vcf_tbi + ascat_alleles = ch_nfcore_references.ascat_alleles + ascat_loci = ch_nfcore_references.ascat_loci + ascat_loci_gc = ch_nfcore_references.ascat_loci_gc + ascat_loci_rt = ch_nfcore_references.ascat_loci_rt + bowtie1_index = ch_nfcore_references.bowtie1_index + bowtie2_index = ch_nfcore_references.bowtie2_index + bwamem1_index = ch_nfcore_references.bwamem1_index + bwamem2_index = ch_nfcore_references.bwamem2_index + chr_dir = ch_nfcore_references.chr_dir + dragmap_hashmap = ch_nfcore_references.dragmap_hashmap + fasta = ch_nfcore_references.fasta + fasta_dict = ch_nfcore_references.fasta_dict + fasta_fai = ch_nfcore_references.fasta_fai + fasta_sizes = ch_nfcore_references.fasta_sizes + gff = ch_nfcore_references.gff + gtf = ch_nfcore_references.gtf + hisat2_index = ch_nfcore_references.hisat2_index + intervals_bed = ch_nfcore_references.intervals_bed + kallisto_index = ch_nfcore_references.kallisto_index + msisensorpro_list = ch_nfcore_references.msisensorpro_list + rsem_index = ch_nfcore_references.rsem_index + salmon_index = ch_nfcore_references.salmon_index + snapaligner_index = ch_nfcore_references.snapaligner_index + splice_sites = ch_nfcore_references.splice_sites + star_index = ch_nfcore_references.star_index + transcript_fasta = ch_nfcore_references.transcript_fasta + vcf_tbi = ch_nfcore_references.vcf_tbi } output { diff --git a/subworkflows/local/prepare_genome_dnaseq/main.nf b/subworkflows/local/prepare_genome_dnaseq/main.nf index 3976c387..8f8e93a0 100644 --- a/subworkflows/local/prepare_genome_dnaseq/main.nf +++ b/subworkflows/local/prepare_genome_dnaseq/main.nf @@ -20,26 +20,26 @@ workflow PREPARE_GENOME_DNASEQ { run_faidx = ('faidx' in tools) && !('intervals' in tools || 'sizes' in tools) - BWAMEM1_INDEX(fasta.filter { meta, _fasta -> 'bwamem1' in tools && meta.run_bwamem1 }) + ch_bwamem1_index = BWAMEM1_INDEX(fasta.filter { meta, _fasta -> 'bwamem1' in tools && meta.run_bwamem1 }) - BWAMEM2_INDEX(fasta.filter { meta, _fasta -> 'bwamem2' in tools && meta.run_bwamem2 }) + ch_bwamem2_index = BWAMEM2_INDEX(fasta.filter { meta, _fasta -> 'bwamem2' in tools && meta.run_bwamem2 }) - DRAGMAP_HASHTABLE(fasta.filter { meta, _fasta -> 'dragmap' in tools && meta.run_dragmap }) + ch_dragmap_hashtable = DRAGMAP_HASHTABLE(fasta.filter { meta, _fasta -> 'dragmap' in tools && meta.run_dragmap }) - GATK4_CREATESEQUENCEDICTIONARY(fasta.filter { meta, _fasta -> 'createsequencedictionary' in tools && meta.run_createsequencedictionary }) + ch_gatk4_dict = GATK4_CREATESEQUENCEDICTIONARY(fasta.filter { meta, _fasta -> 'createsequencedictionary' in tools && meta.run_createsequencedictionary }) // Do not generate sizes for DNAseq generate_sizes = false - SAMTOOLS_FAIDX(fasta.filter { meta, _fasta -> run_faidx && meta.run_faidx }.map { meta, fasta_ -> [meta, fasta_, []] }, generate_sizes) + ch_samtools_faidx = SAMTOOLS_FAIDX(fasta.filter { meta, _fasta -> run_faidx && meta.run_faidx }.map { meta, fasta_ -> [meta, fasta_, []] }, generate_sizes) - fasta_fai = fasta_fai.mix(SAMTOOLS_FAIDX.out.fai) + fasta_fai = fasta_fai.mix(ch_samtools_faidx.fai) - BUILD_INTERVALS(fasta_fai.filter { meta, _fasta_fai -> 'intervals' in tools && meta.run_intervals }, [], false) + ch_build_intervals = BUILD_INTERVALS(fasta_fai.filter { meta, _fasta_fai -> 'intervals' in tools && meta.run_intervals }, [], false) - MSISENSORPRO_SCAN(fasta.filter { meta, _fasta -> 'msisensorpro' in tools && meta.run_msisensorpro }) + ch_msisensorpro_scan = MSISENSORPRO_SCAN(fasta.filter { meta, _fasta -> 'msisensorpro' in tools && meta.run_msisensorpro }) - HTSLIB_BGZIPTABIX( + ch_bgziptabix = HTSLIB_BGZIPTABIX( vcf.filter { meta, _vcf -> 'tabix' in tools && meta.run_tabix }.map { meta, vcf_ -> [meta, vcf_, null, null] }, "compress", true, @@ -50,17 +50,17 @@ workflow PREPARE_GENOME_DNASEQ { ? fasta.combine(altliftoverfile).map { meta, fasta_, altliftoverfile_ -> [meta, fasta_, [], [], altliftoverfile_] } : fasta.map { meta, fasta_ -> [meta, fasta_, [], [], []] } - SNAPALIGNER_INDEX(fasta_for_snapaligner.filter { meta, _fasta, _altcontigfile, _nonaltcontigfile, _altliftoverfile -> 'snapaligner' in tools && meta.run_snapaligner }) + ch_snapaligner_index = SNAPALIGNER_INDEX(fasta_for_snapaligner.filter { meta, _fasta, _altcontigfile, _nonaltcontigfile, _altliftoverfile -> 'snapaligner' in tools && meta.run_snapaligner }) emit: - bwamem1_index = BWAMEM1_INDEX.out.index // channel: [meta, BWAmemIndex/] - bwamem2_index = BWAMEM2_INDEX.out.index // channel: [meta, BWAmem2memIndex/] - dragmap_hashmap = DRAGMAP_HASHTABLE.out.hashmap // channel: [meta, DragmapHashtable/] - fasta_dict = GATK4_CREATESEQUENCEDICTIONARY.out.dict // channel: [meta, *.fa(sta).dict] + bwamem1_index = ch_bwamem1_index.index // channel: [meta, BWAmemIndex/] + bwamem2_index = ch_bwamem2_index.index // channel: [meta, BWAmem2memIndex/] + dragmap_hashmap = ch_dragmap_hashtable.hashmap // channel: [meta, DragmapHashtable/] + fasta_dict = ch_gatk4_dict.dict // channel: [meta, *.fa(sta).dict] fasta_fai // channel: [meta, *.fa(sta).fai] - intervals_bed = BUILD_INTERVALS.out.output // channel: [meta, *.bed] - msisensorpro_list = MSISENSORPRO_SCAN.out.list // channel: [meta, *.list] - snapaligner_index = SNAPALIGNER_INDEX.out.index // channel: [meta, snap/] - vcf_gz = HTSLIB_BGZIPTABIX.out.output.map { meta, out -> [meta, out] } // channel: [meta, *.vcf.gz] - vcf_tbi = HTSLIB_BGZIPTABIX.out.index.map { meta, idx -> [meta, idx] } // channel: [meta, *.vcf.gz.tbi] + intervals_bed = ch_build_intervals.output // channel: [meta, *.bed] + msisensorpro_list = ch_msisensorpro_scan.list // channel: [meta, *.list] + snapaligner_index = ch_snapaligner_index.index // channel: [meta, snap/] + vcf_gz = ch_bgziptabix.output.map { meta, out -> [meta, out] } // channel: [meta, *.vcf.gz] + vcf_tbi = ch_bgziptabix.index.map { meta, idx -> [meta, idx] } // channel: [meta, *.vcf.gz.tbi] } diff --git a/subworkflows/local/prepare_genome_rnaseq/main.nf b/subworkflows/local/prepare_genome_rnaseq/main.nf index fea63d5d..cedeaa65 100644 --- a/subworkflows/local/prepare_genome_rnaseq/main.nf +++ b/subworkflows/local/prepare_genome_rnaseq/main.nf @@ -27,51 +27,51 @@ workflow PREPARE_GENOME_RNASEQ { run_faidx = 'faidx' in tools run_sizes = 'sizes' in tools - BOWTIE1_BUILD(fasta.filter { meta, _fasta -> 'bowtie1' in tools && meta.run_bowtie1 }) + ch_bowtie1_build = BOWTIE1_BUILD(fasta.filter { meta, _fasta -> 'bowtie1' in tools && meta.run_bowtie1 }) - BOWTIE2_BUILD(fasta.filter { meta, _fasta -> 'bowtie2' in tools && meta.run_bowtie2 }) + ch_bowtie2_build = BOWTIE2_BUILD(fasta.filter { meta, _fasta -> 'bowtie2' in tools && meta.run_bowtie2 }) - SAMTOOLS_FAIDX(fasta.filter { meta, _fasta -> (run_faidx || run_sizes) && meta.run_faidx }.map { meta, fasta_ -> [meta, fasta_, []] }, run_sizes) + ch_samtools_faidx = SAMTOOLS_FAIDX(fasta.filter { meta, _fasta -> (run_faidx || run_sizes) && meta.run_faidx }.map { meta, fasta_ -> [meta, fasta_, []] }, run_sizes) - fasta_fai = fasta_fai.mix(SAMTOOLS_FAIDX.out.fai) + fasta_fai = fasta_fai.mix(ch_samtools_faidx.fai) - GFFREAD(join_by_meta_id(fasta, gff.filter { meta, _gff -> ('hisat2' in tools || 'kallisto' in tools || 'rsem' in tools || 'rsem_make_transcript_fasta' in tools || 'salmon' in tools || 'star' in tools) && meta.run_gffread })) + ch_gffread = GFFREAD(join_by_meta_id(fasta, gff.filter { meta, _gff -> ('hisat2' in tools || 'kallisto' in tools || 'rsem' in tools || 'rsem_make_transcript_fasta' in tools || 'salmon' in tools || 'star' in tools) && meta.run_gffread })) gtf = gtf - .mix(GFFREAD.out.gtf) + .mix(ch_gffread.gtf) .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 }) + ch_hisat2_extractsplicesites = HISAT2_EXTRACTSPLICESITES(gtf.filter { meta, _gtf -> ('hisat2' in tools || 'hisat2_extractsplicesites' in tools) && meta.run_hisat2 && !hisat2_skip_splice_sites }) - splice_sites = splice_sites.mix(HISAT2_EXTRACTSPLICESITES.out.txt) + splice_sites = splice_sites.mix(ch_hisat2_extractsplicesites.txt) - HISAT2_BUILD(join_by_meta_id(fasta.filter { meta, _fasta -> 'hisat2' in tools && meta.run_hisat2 }, gtf, splice_sites), hisat2_build_memory) + ch_hisat2_build = HISAT2_BUILD(join_by_meta_id(fasta.filter { meta, _fasta -> 'hisat2' in tools && meta.run_hisat2 }, gtf, splice_sites), hisat2_build_memory) - MAKE_TRANSCRIPTS_FASTA(join_by_meta_id(fasta.filter { meta, _fasta -> 'rsem_make_transcript_fasta' in tools && meta.run_rsem_make_transcript_fasta }, gtf)) + ch_make_transcripts_fasta = MAKE_TRANSCRIPTS_FASTA(join_by_meta_id(fasta.filter { meta, _fasta -> 'rsem_make_transcript_fasta' in tools && meta.run_rsem_make_transcript_fasta }, gtf)) - transcript_fasta = transcript_fasta.mix(MAKE_TRANSCRIPTS_FASTA.out.transcript_fasta) + transcript_fasta = transcript_fasta.mix(ch_make_transcripts_fasta.transcript_fasta) - KALLISTO_INDEX(transcript_fasta.filter { meta, _transcript_fasta -> 'kallisto' in tools && meta.run_kallisto }) + ch_kallisto_index = KALLISTO_INDEX(transcript_fasta.filter { meta, _transcript_fasta -> 'kallisto' in tools && meta.run_kallisto }) - SALMON_INDEX(join_by_meta_id(transcript_fasta, fasta.filter { meta, _fasta -> 'salmon' in tools && meta.run_salmon })) + ch_salmon_index = SALMON_INDEX(join_by_meta_id(transcript_fasta, fasta.filter { meta, _fasta -> 'salmon' in tools && meta.run_salmon })) - RSEM_PREPAREREFERENCE_GENOME(join_by_meta_id(fasta.filter { meta, _fasta -> 'rsem' in tools && meta.run_rsem }, gtf)) + ch_rsem_preparereference_genome = RSEM_PREPAREREFERENCE_GENOME(join_by_meta_id(fasta.filter { meta, _fasta -> 'rsem' in tools && meta.run_rsem }, gtf)) - STAR_GENOMEGENERATE(join_by_meta_id(fasta.filter { meta, _fasta -> 'star' in tools && meta.run_star }, gtf)) + ch_star_genomegenerate = STAR_GENOMEGENERATE(join_by_meta_id(fasta.filter { meta, _fasta -> 'star' in tools && meta.run_star }, gtf)) emit: - bowtie1_index = BOWTIE1_BUILD.out.index // channel: [meta, BowtieIndex/] - bowtie2_index = BOWTIE2_BUILD.out.index // channel: [meta, Bowtie2Index/] + bowtie1_index = ch_bowtie1_build.index // channel: [meta, BowtieIndex/] + bowtie2_index = ch_bowtie2_build.index // channel: [meta, Bowtie2Index/] fasta_fai // channel: [meta, *.fa(sta).fai] - fasta_sizes = SAMTOOLS_FAIDX.out.sizes // channel: [meta, *.fa(sta).sizes] + fasta_sizes = ch_samtools_faidx.sizes // channel: [meta, *.fa(sta).sizes] gtf // channel: [meta, gtf] - hisat2_index = HISAT2_BUILD.out.index // channel: [meta, Hisat2Index/] - kallisto_index = KALLISTO_INDEX.out.index // channel: [meta, KallistoIndex] - rsem_index = RSEM_PREPAREREFERENCE_GENOME.out.index // channel: [meta, RSEMIndex/] - salmon_index = SALMON_INDEX.out.index // channel: [meta, SalmonIndex/] + hisat2_index = ch_hisat2_build.index // channel: [meta, Hisat2Index/] + kallisto_index = ch_kallisto_index.index // channel: [meta, KallistoIndex] + rsem_index = ch_rsem_preparereference_genome.index // channel: [meta, RSEMIndex/] + salmon_index = ch_salmon_index.index // channel: [meta, SalmonIndex/] splice_sites // channel: [meta, *.splice_sites.txt] - star_index = STAR_GENOMEGENERATE.out.index // channel: [meta, STARIndex/] + star_index = ch_star_genomegenerate.index // channel: [meta, STARIndex/] transcript_fasta // channel: [meta, *.transcripts.fasta] } diff --git a/workflows/references.nf b/workflows/references.nf index 2c3a796d..57152459 100644 --- a/workflows/references.nf +++ b/workflows/references.nf @@ -17,7 +17,7 @@ workflow REFERENCES { main: // Create references for rnaseq based pipelines such as nf-core/riboseq, nf-core/rnaseq, nf-core/rnavar - PREPARE_GENOME_RNASEQ( + ch_prepare_genome_rnaseq = PREPARE_GENOME_RNASEQ( fasta, fasta_fai, gff, @@ -30,35 +30,35 @@ workflow REFERENCES { ) // Create references for dnaseq based pipelines such as nf-core/sarek - PREPARE_GENOME_DNASEQ( + ch_prepare_genome_dnaseq = PREPARE_GENOME_DNASEQ( fasta, - fasta_fai.mix(PREPARE_GENOME_RNASEQ.out.fasta_fai).unique(), + fasta_fai.mix(ch_prepare_genome_rnaseq.fasta_fai).unique(), vcf, altliftoverfile, tools, ) emit: - bowtie1_index = PREPARE_GENOME_RNASEQ.out.bowtie1_index - bowtie2_index = PREPARE_GENOME_RNASEQ.out.bowtie2_index - bwamem1_index = PREPARE_GENOME_DNASEQ.out.bwamem1_index - bwamem2_index = PREPARE_GENOME_DNASEQ.out.bwamem2_index - dragmap_hashmap = PREPARE_GENOME_DNASEQ.out.dragmap_hashmap + bowtie1_index = ch_prepare_genome_rnaseq.bowtie1_index + bowtie2_index = ch_prepare_genome_rnaseq.bowtie2_index + bwamem1_index = ch_prepare_genome_dnaseq.bwamem1_index + bwamem2_index = ch_prepare_genome_dnaseq.bwamem2_index + dragmap_hashmap = ch_prepare_genome_dnaseq.dragmap_hashmap fasta - fasta_dict = PREPARE_GENOME_DNASEQ.out.fasta_dict - fasta_fai = PREPARE_GENOME_DNASEQ.out.fasta_fai - fasta_sizes = PREPARE_GENOME_RNASEQ.out.fasta_sizes + fasta_dict = ch_prepare_genome_dnaseq.fasta_dict + fasta_fai = ch_prepare_genome_dnaseq.fasta_fai + fasta_sizes = ch_prepare_genome_rnaseq.fasta_sizes gff - gtf = PREPARE_GENOME_RNASEQ.out.gtf - hisat2_index = PREPARE_GENOME_RNASEQ.out.hisat2_index - intervals_bed = PREPARE_GENOME_DNASEQ.out.intervals_bed - kallisto_index = PREPARE_GENOME_RNASEQ.out.kallisto_index - msisensorpro_list = PREPARE_GENOME_DNASEQ.out.msisensorpro_list - rsem_index = PREPARE_GENOME_RNASEQ.out.rsem_index - salmon_index = PREPARE_GENOME_RNASEQ.out.salmon_index - snapaligner_index = PREPARE_GENOME_DNASEQ.out.snapaligner_index - splice_sites = PREPARE_GENOME_RNASEQ.out.splice_sites - star_index = PREPARE_GENOME_RNASEQ.out.star_index - transcript_fasta = PREPARE_GENOME_RNASEQ.out.transcript_fasta - vcf_tbi = PREPARE_GENOME_DNASEQ.out.vcf_tbi + gtf = ch_prepare_genome_rnaseq.gtf + hisat2_index = ch_prepare_genome_rnaseq.hisat2_index + intervals_bed = ch_prepare_genome_dnaseq.intervals_bed + kallisto_index = ch_prepare_genome_rnaseq.kallisto_index + msisensorpro_list = ch_prepare_genome_dnaseq.msisensorpro_list + rsem_index = ch_prepare_genome_rnaseq.rsem_index + salmon_index = ch_prepare_genome_rnaseq.salmon_index + snapaligner_index = ch_prepare_genome_dnaseq.snapaligner_index + splice_sites = ch_prepare_genome_rnaseq.splice_sites + star_index = ch_prepare_genome_rnaseq.star_index + transcript_fasta = ch_prepare_genome_rnaseq.transcript_fasta + vcf_tbi = ch_prepare_genome_dnaseq.vcf_tbi }