diff --git a/main.nf b/main.nf index ee77d46b..7c479b8e 100755 --- a/main.nf +++ b/main.nf @@ -39,7 +39,7 @@ include { QUALITYCHECK } from './workflows/arete' include { POPPUNK } from './workflows/arete' include { RUN_RSPR } from './workflows/arete' include { RUN_EVOLCCM } from './workflows/arete' - +include { RUN_RECOMBINATION } from './workflows/arete' // // WORKFLOW: Run main nf-core/arete analysis pipeline @@ -77,6 +77,10 @@ workflow rspr { workflow evolccm { RUN_EVOLCCM() } + +workflow recombination { + RUN_RECOMBINATION() +} /* ======================================================================================== RUN ALL WORKFLOWS diff --git a/workflows/arete.nf b/workflows/arete.nf index c6ffb9b1..577b44d9 100755 --- a/workflows/arete.nf +++ b/workflows/arete.nf @@ -615,6 +615,70 @@ workflow RUN_EVOLCCM { ) } +workflow RUN_RECOMBINATION { + if (params.input_sample_table){ ch_input = file(params.input_sample_table) } else { exit 1, 'Input samplesheet not specified!' } + if (params.reference_genome) { + ch_reference_genome = file(params.reference_genome) + use_reference_genome = true + } + else { + ch_reference_genome = [] + use_reference_genome = false + } + if (params.poppunk_model == null) { exit 1, 'A model must be specified with --poppunk_model in order to run PopPunk' } + ch_software_versions = Channel.empty() + + ANNOTATION_INPUT_CHECK(ch_input) + ANNOTATION_INPUT_CHECK.out.genomes.set { assemblies } + + CHECK_ASSEMBLIES( + assemblies, + ch_reference_genome, + use_reference_genome + ) + ch_software_versions = ch_software_versions.mix(CHECK_ASSEMBLIES.out.assemblyqc_software) + + if (params.apply_filtering) { + CHECK_ASSEMBLIES.out.assemblies + .set { assemblies } + } + + RUN_POPPUNK(assemblies) + ch_software_versions = ch_software_versions.mix(RUN_POPPUNK.out.poppunk_version) + + + RECOMBINATION ( + assemblies, + RUN_POPPUNK.out.clusters, + CHECK_ASSEMBLIES.out.quast_report + ) + + CUSTOM_DUMPSOFTWAREVERSIONS ( + ch_software_versions.unique().collectFile(name: 'collated_versions.yml') + ) + + /* + * MODULE: MultiQC + */ + workflow_summary = WorkflowArete.paramsSummaryMultiqc(workflow, summary_params) + ch_workflow_summary = Channel.value(workflow_summary) + + //Mix QUAST results into one report file + ch_multiqc_files = Channel.empty() + ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) + ch_multiqc_files = ch_multiqc_files.mix(CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect()) + ch_multiqc_files = ch_multiqc_files.mix(CHECK_ASSEMBLIES.out.multiqc) + + MULTIQC( + ch_multiqc_files.collect(), + ch_multiqc_config.collect().ifEmpty([]), + ch_multiqc_custom_config.collect().ifEmpty([]), + ch_multiqc_logo.collect().ifEmpty([]) + ) + multiqc_report = MULTIQC.out.report.toList() + ch_software_versions = ch_software_versions.mix(MULTIQC.out.versions.ifEmpty(null)) + +} /* ======================================================================================== COMPLETION EMAIL AND SUMMARY