From 710ba2524f7850938039d6dd4703b47065d49768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Vitor?= Date: Tue, 7 Nov 2023 10:48:18 -0300 Subject: [PATCH] feat: Add recombination entry (#175) * feat: Add recombination entry Signed-off-by: jvfe * docs: Add recombination usage Signed-off-by: jvfe --------- Signed-off-by: jvfe --- docs/usage.md | 12 +++++++++ main.nf | 6 ++++- workflows/arete.nf | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index 6f6cbf0c..7cdca107 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -208,6 +208,18 @@ ED178 0 1 ED180 0 0 ``` +### Recombination Entry + +To execute the recombination analysis on pre-existing assemblies (PopPUNK model can be either bgmm, dbscan, refine, threshold or lineage): + +```bash +nextflow run beiko-lab/ARETE \ + -entry recombination \ + --input_sample_table samplesheet.csv \ + --poppunk_model dbscan \ + -profile docker +``` + ## Updating the pipeline When you run the above command, Nextflow automatically pulls the pipeline code from GitHub and stores it as a cached version. When running the pipeline after this, it will always use the cached version if available - even if the pipeline has been updated since. To make sure that you're running the latest version of the pipeline, make sure that you regularly update the cached version of the pipeline: 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