From a74417507983f154537410d9fae490664139d5c9 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Thu, 10 Oct 2024 15:44:03 +0200 Subject: [PATCH] Add funcscan code --- docs/output.md | 2 + .../generate_downstream_samplesheets/main.nf | 13 +++++ workflows/mag.nf | 49 ++++++++++++------- 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/docs/output.md b/docs/output.md index 1fdd982d..fca4f82e 100644 --- a/docs/output.md +++ b/docs/output.md @@ -760,12 +760,14 @@ Summary tool-specific plots and tables of following tools are currently displaye The pipeline can also generate input files for the following downstream pipelines: +- [nf-core/funcscan](https://nf-co.re/funcscan) - [nf-core/taxprofiler](https://nf-co.re/taxprofiler)
Output files - `downstream_samplesheets/` + - `funcscan.csv`: Filled out nf-core/funcscan `--input` csv with absolute paths to the assembly FASTA files produced by MAG (MEGAHIT, SPAdes, SPAdesHybrid) - `taxprofiler.csv`: Partially filled out nf-core/taxprofiler preprocessed short reads csv with paths to database directories or `.fast1.gz` relative to the results directory
diff --git a/subworkflows/local/generate_downstream_samplesheets/main.nf b/subworkflows/local/generate_downstream_samplesheets/main.nf index bc2600a2..23a2f505 100644 --- a/subworkflows/local/generate_downstream_samplesheets/main.nf +++ b/subworkflows/local/generate_downstream_samplesheets/main.nf @@ -37,6 +37,19 @@ workflow GENERATE_DOWNSTREAM_SAMPLESHEETS { .tap{ ch_header } } + if ( params.generate_pipeline_samplesheets == 'funcscan' ) { + format = 'csv' + format_sep = ',' + ch_list_for_samplesheet = ch_assemblies + .map { + meta, filename -> + def sample = meta.id + def fasta = file(params.outdir).toString() + '/Assembly/' + meta.assembler + '/' + filename.getName() + [ sample: sample, fasta: fasta ] + } + .tap{ ch_header } + } + // Constructs the header string and then the strings of each row, and // finally concatenates for saving. ch_header diff --git a/workflows/mag.nf b/workflows/mag.nf index ff2e0dc6..7ba33c37 100644 --- a/workflows/mag.nf +++ b/workflows/mag.nf @@ -13,18 +13,19 @@ include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_mag_ // // SUBWORKFLOW: Consisting of a mix of local and nf-core/modules // -include { BINNING_PREPARATION } from '../subworkflows/local/binning_preparation' -include { BINNING } from '../subworkflows/local/binning' -include { BINNING_REFINEMENT } from '../subworkflows/local/binning_refinement' -include { BUSCO_QC } from '../subworkflows/local/busco_qc' -include { VIRUS_IDENTIFICATION } from '../subworkflows/local/virus_identification' -include { CHECKM_QC } from '../subworkflows/local/checkm_qc' -include { GUNC_QC } from '../subworkflows/local/gunc_qc' -include { GTDBTK } from '../subworkflows/local/gtdbtk' -include { ANCIENT_DNA_ASSEMBLY_VALIDATION } from '../subworkflows/local/ancient_dna' -include { DOMAIN_CLASSIFICATION } from '../subworkflows/local/domain_classification' -include { DEPTHS } from '../subworkflows/local/depths' -include { GENERATE_DOWNSTREAM_SAMPLESHEETS } from '../subworkflows/local/generate_downstream_samplesheets/main.nf' +include { BINNING_PREPARATION } from '../subworkflows/local/binning_preparation' +include { BINNING } from '../subworkflows/local/binning' +include { BINNING_REFINEMENT } from '../subworkflows/local/binning_refinement' +include { BUSCO_QC } from '../subworkflows/local/busco_qc' +include { VIRUS_IDENTIFICATION } from '../subworkflows/local/virus_identification' +include { CHECKM_QC } from '../subworkflows/local/checkm_qc' +include { GUNC_QC } from '../subworkflows/local/gunc_qc' +include { GTDBTK } from '../subworkflows/local/gtdbtk' +include { ANCIENT_DNA_ASSEMBLY_VALIDATION } from '../subworkflows/local/ancient_dna' +include { DOMAIN_CLASSIFICATION } from '../subworkflows/local/domain_classification' +include { DEPTHS } from '../subworkflows/local/depths' +include { GENERATE_DOWNSTREAM_SAMPLESHEETS as GENERATE_DOWNSTREAM_SAMPLESHEETS_FUNCSCAN } from '../subworkflows/local/generate_downstream_samplesheets/main.nf' +include { GENERATE_DOWNSTREAM_SAMPLESHEETS as GENERATE_DOWNSTREAM_SAMPLESHEETS_TAXPROFILER } from '../subworkflows/local/generate_downstream_samplesheets/main.nf' // // MODULE: Installed directly from nf-core/modules @@ -1006,13 +1007,25 @@ workflow MAG { // // Samplesheet generation // - ch_input_for_samplesheet = Channel - .empty() - .mix( ch_short_reads_assembly ) + // if ( params.generate_pipeline_samplesheets.contains("taxprofiler") ) { + ch_input_for_samplesheet = Channel + .empty() + .mix( ch_short_reads_assembly ) - if ( params.generate_downstream_samplesheets ) { - GENERATE_DOWNSTREAM_SAMPLESHEETS ( ch_input_for_samplesheet ) - } + if ( params.generate_downstream_samplesheets ) { + GENERATE_DOWNSTREAM_SAMPLESHEETS_TAXPROFILER ( ch_input_for_samplesheet ) + } + // } + + // if ( params.generate_pipeline_samplesheets.contains("funcscan") ) { + ch_input_for_samplesheet = Channel + .empty() + .mix( ch_assemblies ) + + if ( params.generate_downstream_samplesheets ) { + GENERATE_DOWNSTREAM_SAMPLESHEETS_FUNCSCAN ( ch_input_for_samplesheet ) + } + // } // // Collate and save software versions