From f04fe3da0b38e5a4570b262db1d43f18c0499c05 Mon Sep 17 00:00:00 2001 From: Danilo Di Leo Date: Wed, 24 Jan 2024 13:47:33 +0100 Subject: [PATCH] changes --- .github/workflows/ci.yml | 2 +- modules/local/eggnog/mapper.nf | 2 +- subworkflows/local/eukulele.nf | 2 ++ workflows/metatdenovo.nf | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cfb04e9..0e309f1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: profiles: name: Run workflow profile # Only run on push if this is the nf-core dev branch (merged PRs) - if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/metadenovo') }} + if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/metatdenovo') }} runs-on: ubuntu-latest strategy: matrix: diff --git a/modules/local/eggnog/mapper.nf b/modules/local/eggnog/mapper.nf index fabf767f..b6805099 100644 --- a/modules/local/eggnog/mapper.nf +++ b/modules/local/eggnog/mapper.nf @@ -27,7 +27,7 @@ process EGGNOG_MAPPER { script: def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" - input = fasta =~ /\.gz$/ ? fasta.name.take(fasta.name.lastIndexOf('.')) : fasta + input = fasta.name.endsWith(".gz") ? fasta.baseName : fasta gunzip = fasta =~ /\.gz$/ ? "gunzip -c ${fasta} > ${input}" : "" """ diff --git a/subworkflows/local/eukulele.nf b/subworkflows/local/eukulele.nf index 5e90a576..b39b7618 100644 --- a/subworkflows/local/eukulele.nf +++ b/subworkflows/local/eukulele.nf @@ -19,6 +19,7 @@ workflow SUB_EUKULELE { ch_versions = ch_versions.mix ( EUKULELE_SEARCH.out.versions ) FORMAT_TAX( EUKULELE_SEARCH.out.taxonomy_estimation.map { [ it[0], it[1] ] } ) + ch_versions = ch_versions.mix ( FORMAT_TAX.out.versions ) FORMAT_TAX.out.tax .join(eukulele) @@ -26,6 +27,7 @@ workflow SUB_EUKULELE { .set { ch_sum_taxonomy } SUM_TAXONOMY ( ch_sum_taxonomy, feature_counts ) + ch_versions = ch_versions.mix ( SUM_TAXONOMY.out.versions ) emit: taxonomy_summary = SUM_TAXONOMY.out.taxonomy_summary diff --git a/workflows/metatdenovo.nf b/workflows/metatdenovo.nf index 276b8eb3..b93c9808 100644 --- a/workflows/metatdenovo.nf +++ b/workflows/metatdenovo.nf @@ -29,9 +29,9 @@ if ( params.assembly ) { if ( params.gff && params.protein_fasta ) { orf_caller = 'user_orfs' } else if ( params.gff && ! params.protein_fasta ) { - exit 1, 'When supplying ORFs, both --gff and --protein_fasta must be specified, --protein_fasta file is missing!' + error 'When supplying ORFs, both --gff and --protein_fasta must be specified, --protein_fasta file is missing!' } else if ( params.protein_fasta && ! params.gff ) { - exit 1, 'When supplying ORFs, both --gff and --protein_fasta must be specified, --gff file is missing!' + error 'When supplying ORFs, both --gff and --protein_fasta must be specified, --gff file is missing!' } else { orf_caller = params.orf_caller } @@ -203,7 +203,7 @@ workflow METATDENOVO { .mix(ch_fastq.single) .set { ch_cat_fastq } - ch_versions = ch_versions.mix(CAT_FASTQ.out.versions.first().ifEmpty(null)) + ch_versions = ch_versions.mix(CAT_FASTQ.out.versions.first()) // // SUBWORKFLOW: Read QC and trim adapters @@ -245,7 +245,7 @@ workflow METATDENOVO { ch_collect_stats .combine(ch_bbduk_logs) .set {ch_collect_stats} - ch_multiqc_files = ch_multiqc_files.mix(BBMAP_BBDUK.out.log.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(BBMAP_BBDUK.out.log.collect{it[1]}) } else { ch_clean_reads = FASTQC_TRIMGALORE.out.reads ch_bbduk_logs = Channel.empty() @@ -332,7 +332,7 @@ workflow METATDENOVO { .map { [ [ id: 'megahit' ], it ] } .set { ch_assembly_contigs } ch_versions = ch_versions.mix(MEGAHIT_INTERLEAVED.out.versions) - } else { exit 1, 'Assembler not specified!' } + } else { error 'Assembler not specified!' } // If the user asked for length filtering, perform that with SEQTK_SEQ (the actual length parameter is used in modules.config) if ( params.min_contig_length > 0 ) { @@ -355,7 +355,7 @@ workflow METATDENOVO { ch_versions = ch_versions.mix(PROKKA_SUBSETS.out.versions) ch_gff = UNPIGZ_GFF.out.unzipped ch_protein = PROKKA_SUBSETS.out.faa - ch_multiqc_files = ch_multiqc_files.mix(PROKKA_SUBSETS.out.prokka_log.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(PROKKA_SUBSETS.out.prokka_log.collect{it[1]}) } // @@ -566,10 +566,10 @@ workflow METATDENOVO { ch_methods_description = Channel.value(methods_description) ch_multiqc_files = ch_multiqc_files.mix(CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect()) - ch_multiqc_files = ch_multiqc_files.mix(FASTQC_TRIMGALORE.out.trim_zip.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(TRANSRATE.out.assembly_qc.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(BAM_SORT_STATS_SAMTOOLS.out.idxstats.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(FEATURECOUNTS_CDS.out.summary.collect{it[1]}.ifEmpty([])) + ch_multiqc_files = ch_multiqc_files.mix(FASTQC_TRIMGALORE.out.trim_zip.collect{it[1]}) + ch_multiqc_files = ch_multiqc_files.mix(TRANSRATE.out.assembly_qc.collect{it[1]}) + ch_multiqc_files = ch_multiqc_files.mix(BAM_SORT_STATS_SAMTOOLS.out.idxstats.collect{it[1]}) + ch_multiqc_files = ch_multiqc_files.mix(FEATURECOUNTS_CDS.out.summary.collect{it[1]}) MULTIQC (