diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d6af54d..ca448d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#748](https://github.com/nf-core/mag/pull/748) - Fix broken phix reference channel when skipping phix removal (reported by @amizeranschi, fix by @muabnezor) - [#752](https://github.com/nf-core/mag/pull/752) - Fix QUAST results not being displayed when skipping certain steps (reported by @amizeranschi, fix by @jfy133) +- [#753](https://github.com/nf-core/mag/pull/753) - Fix iGenomes reference support for host removal reference genome (reported by @Thomieh73, fix by @jfy133) ### `Deprecated` diff --git a/nextflow.config b/nextflow.config index 2e915115..fdbe1282 100644 --- a/nextflow.config +++ b/nextflow.config @@ -116,16 +116,16 @@ params { save_filtered_longreads = false // binning options - skip_metabat2 = false - skip_maxbin2 = false - skip_concoct = false - bin_domain_classification = false - bin_domain_classification_tool = 'tiara' - tiara_min_length = 3000 - refine_bins_dastool = false - refine_bins_dastool_threshold = 0.5 - postbinning_input = 'raw_bins_only' - exclude_unbins_from_postbinning = false + skip_metabat2 = false + skip_maxbin2 = false + skip_concoct = false + bin_domain_classification = false + bin_domain_classification_tool = 'tiara' + tiara_min_length = 3000 + refine_bins_dastool = false + refine_bins_dastool_threshold = 0.5 + postbinning_input = 'raw_bins_only' + exclude_unbins_from_postbinning = false // Bin QC skip_binqc = false @@ -138,7 +138,8 @@ params { checkm_db = null save_checkm_data = false checkm2_db = null - checkm2_db_version = 5571251 // corresponds to Zenodo record ID + checkm2_db_version = 5571251 + // corresponds to Zenodo record ID save_checkm2_data = false run_gunc = false gunc_database_type = 'progenomes' @@ -159,40 +160,41 @@ params { // References //genome = null // we use --host_genome instead - igenomes_base = 's3://ngi-igenomes/igenomes/' - igenomes_ignore = false + igenomes_base = 's3://ngi-igenomes/igenomes/' + igenomes_ignore = false // MultiQC options - multiqc_config = null - multiqc_title = null - multiqc_logo = null - max_multiqc_email_size = '25.MB' - multiqc_methods_description = null + multiqc_config = null + multiqc_title = null + multiqc_logo = null + max_multiqc_email_size = '25.MB' + multiqc_methods_description = null // Boilerplate options - outdir = null - publish_dir_mode = 'copy' - email = null - email_on_fail = null - plaintext_email = false - monochrome_logs = false - hook_url = null - help = false - help_full = false - show_hidden = false - version = false - pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/' - trace_report_suffix = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')// Config options - config_profile_name = null - config_profile_description = null - - custom_config_version = 'master' - custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" - config_profile_contact = null - config_profile_url = null + outdir = null + publish_dir_mode = 'copy' + email = null + email_on_fail = null + plaintext_email = false + monochrome_logs = false + hook_url = null + help = false + help_full = false + show_hidden = false + version = false + pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/' + trace_report_suffix = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss') + // Config options + config_profile_name = null + config_profile_description = null + + custom_config_version = 'master' + custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" + config_profile_contact = null + config_profile_url = null // Schema validation default options - validate_params = true + validate_params = true } // Load base.config by default for all pipelines @@ -200,90 +202,90 @@ includeConfig 'conf/base.config' profiles { debug { - dumpHashes = true - process.beforeScript = 'echo $HOSTNAME' - cleanup = false + dumpHashes = true + process.beforeScript = 'echo $HOSTNAME' + cleanup = false nextflow.enable.configProcessNamesValidation = true } conda { - conda.enabled = true - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false - conda.channels = ['conda-forge', 'bioconda'] - apptainer.enabled = false + conda.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + conda.channels = ['conda-forge', 'bioconda'] + apptainer.enabled = false } mamba { - conda.enabled = true - conda.useMamba = true - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + conda.enabled = true + conda.useMamba = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } docker { - docker.enabled = true - conda.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false - docker.runOptions = '-u $(id -u):$(id -g)' + docker.enabled = true + conda.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false + docker.runOptions = '-u $(id -u):$(id -g)' } arm { - docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' + docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' } singularity { - singularity.enabled = true - singularity.autoMounts = true - conda.enabled = false - docker.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + singularity.enabled = true + singularity.autoMounts = true + conda.enabled = false + docker.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } podman { - podman.enabled = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + podman.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } shifter { - shifter.enabled = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - podman.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + shifter.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } charliecloud { - charliecloud.enabled = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - apptainer.enabled = false + charliecloud.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + apptainer.enabled = false } apptainer { - apptainer.enabled = true - apptainer.autoMounts = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false + apptainer.enabled = true + apptainer.autoMounts = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false } wave { apptainer.ociAutoPull = true @@ -293,33 +295,65 @@ profiles { wave.strategy = 'conda,container' } gitpod { - executor.name = 'local' - executor.cpus = 4 - executor.memory = 8.GB + executor.name = 'local' + executor.cpus = 4 + executor.memory = 8.GB process { resourceLimits = [ memory: 8.GB, - cpus : 4, - time : 1.h + cpus: 4, + time: 1.h, ] } } - test { includeConfig 'conf/test.config' } - test_full { includeConfig 'conf/test_full.config' } - test_host_rm { includeConfig 'conf/test_host_rm.config' } - test_hybrid { includeConfig 'conf/test_hybrid.config' } - test_hybrid_host_rm { includeConfig 'conf/test_hybrid_host_rm.config' } - test_busco_auto { includeConfig 'conf/test_busco_auto.config' } - test_ancient_dna { includeConfig 'conf/test_ancient_dna.config' } - test_adapterremoval { includeConfig 'conf/test_adapterremoval.config' } - test_binning_entry { includeConfig 'conf/test_binning_entry.config' } - test_binrefinement { includeConfig 'conf/test_binrefinement.config' } - test_no_clipping { includeConfig 'conf/test_no_clipping.config' } - test_bbnorm { includeConfig 'conf/test_bbnorm.config' } - test_nothing { includeConfig 'conf/test_nothing.config' } - test_virus_identification { includeConfig 'conf/test_virus_identification.config' } - test_single_end { includeConfig 'conf/test_single_end.config' } - test_concoct { includeConfig 'conf/test_concoct.config' } + test { + includeConfig 'conf/test.config' + } + test_full { + includeConfig 'conf/test_full.config' + } + test_host_rm { + includeConfig 'conf/test_host_rm.config' + } + test_hybrid { + includeConfig 'conf/test_hybrid.config' + } + test_hybrid_host_rm { + includeConfig 'conf/test_hybrid_host_rm.config' + } + test_busco_auto { + includeConfig 'conf/test_busco_auto.config' + } + test_ancient_dna { + includeConfig 'conf/test_ancient_dna.config' + } + test_adapterremoval { + includeConfig 'conf/test_adapterremoval.config' + } + test_binning_entry { + includeConfig 'conf/test_binning_entry.config' + } + test_binrefinement { + includeConfig 'conf/test_binrefinement.config' + } + test_no_clipping { + includeConfig 'conf/test_no_clipping.config' + } + test_bbnorm { + includeConfig 'conf/test_bbnorm.config' + } + test_nothing { + includeConfig 'conf/test_nothing.config' + } + test_virus_identification { + includeConfig 'conf/test_virus_identification.config' + } + test_single_end { + includeConfig 'conf/test_single_end.config' + } + test_concoct { + includeConfig 'conf/test_concoct.config' + } } // Load nf-core custom profiles from different Institutions @@ -331,10 +365,10 @@ includeConfig !System.getenv('NXF_OFFLINE') && params.custom_config_base ? "${pa // Set default registry for Apptainer, Docker, Podman, Charliecloud and Singularity independent of -profile // Will not be used unless Apptainer / Docker / Podman / Charliecloud / Singularity are enabled // Set to your registry if you have a mirror of containers -apptainer.registry = 'quay.io' -docker.registry = 'quay.io' -podman.registry = 'quay.io' -singularity.registry = 'quay.io' +apptainer.registry = 'quay.io' +docker.registry = 'quay.io' +podman.registry = 'quay.io' +singularity.registry = 'quay.io' charliecloud.registry = 'quay.io' // Load igenomes.config if required @@ -383,71 +417,72 @@ dag { manifest { name = 'nf-core/mag' - author = """Hadrien Gourlé, Daniel Straub, Sabrina Krakau, James A. Fellows Yates, Maxime Borry""" // The author field is deprecated from Nextflow version 24.10.0, use contributors instead + author = """Hadrien Gourlé, Daniel Straub, Sabrina Krakau, James A. Fellows Yates, Maxime Borry""" + // The author field is deprecated from Nextflow version 24.10.0, use contributors instead contributors = [ [ name: 'Hadrien Gourlé', affiliation: 'Department of Animal Breeding and Genetics, Swedish University of Agricultural Sciences, Uppsala, Swden', email: '', github: 'HadrienG', - contribution: ['author'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '0000-0001-9807-1082 ' + contribution: ['author'], + orcid: '0000-0001-9807-1082 ', ], [ name: 'Daniel Straub', affiliation: 'Quantitative Biology Center (QBiC), University of Tübingen, Tübingen, Germany', email: '', github: 'd4straub', - contribution: ['author', 'maintainer'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '0000-0002-2553-0660 ' + contribution: ['author', 'maintainer'], + orcid: '0000-0002-2553-0660 ', ], [ name: 'Sabrina Krakau', affiliation: 'Quantitative Biology Center (QBiC), University of Tübingen, Tübingen, Germany', email: '', github: 'skrakau', - contribution: ['contributor'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '0000-0003-0603-7907 ' + contribution: ['contributor'], + orcid: '0000-0003-0603-7907 ', ], [ name: 'Antonia Schuster', affiliation: 'Quantitative Biology Center (QBiC), University of Tübingen, Tübingen, Germany', email: '', github: 'AntoniaSchuster', - contribution: ['author'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '' + contribution: ['author'], + orcid: '', ], [ name: 'James A. Fellows Yates', affiliation: 'Department of Archaeogenetics, Max Planck Institute for Evolutionary Anthropology, Leipzig, Germany', email: 'jfy133@gmail.com', github: 'jfy133', - contribution: ['maintainer'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '0000-0001-5585-6277' + contribution: ['maintainer'], + orcid: '0000-0001-5585-6277', ], [ name: 'Maxime Borry', affiliation: 'Department of Archaeogenetics, Max Planck Institute for Evolutionary Anthropology, Leipzig, Germany', email: '', github: 'maxibor', - contribution: ['contributor'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '0000-0001-9140-7559' + contribution: ['contributor'], + orcid: '0000-0001-9140-7559', ], [ name: 'Jim Downie', affiliation: 'Wellcome Sanger Institute, Hinxton, UK', email: '', github: 'prototaxites', - contribution: ['contributor'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '0000-0002-7175-0533' + contribution: ['contributor'], + orcid: '0000-0002-7175-0533', ], [ name: 'Carson Miller', affiliation: 'University of Washington, Seattle, USA', email: '0000-0002-7175-0533', github: 'CarsonJM', - contribution: ['contributor'], // List of contribution types ('author', 'maintainer' or 'contributor') - orcid: '0000-0001-9861-4884' + contribution: ['contributor'], + orcid: '0000-0001-9861-4884', ], ] homePage = 'https://github.com/nf-core/mag' @@ -461,18 +496,18 @@ manifest { // Nextflow plugins plugins { - id 'nf-schema@2.3.0' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-schema@2.3.0' } validation { defaultIgnoreParams = ["genomes"] - monochromeLogs = params.monochrome_logs + monochromeLogs = params.monochrome_logs help { - enabled = true - command = "nextflow run nf-core/mag -profile --input samplesheet.csv --outdir " - fullParameter = "help_full" + enabled = true + command = "nextflow run nf-core/mag -profile --input samplesheet.csv --outdir " + fullParameter = "help_full" showHiddenParameter = "show_hidden" - beforeText = """ + beforeText = """ -\033[2m----------------------------------------------------\033[0m- \033[0;32m,--.\033[0;30m/\033[0;32m,-.\033[0m \033[0;34m ___ __ __ __ ___ \033[0;32m/,-._.--~\'\033[0m @@ -482,7 +517,7 @@ validation { \033[0;35m nf-core/mag ${manifest.version}\033[0m -\033[2m----------------------------------------------------\033[0m- """ - afterText = """${manifest.doi ? "\n* The pipeline\n" : ""}${manifest.doi.tokenize(",").collect { " https://doi.org/${it.trim().replace('https://doi.org/','')}"}.join("\n")}${manifest.doi ? "\n" : ""} + afterText = """${manifest.doi ? "\n* The pipeline\n" : ""}${manifest.doi.tokenize(",").collect { " https://doi.org/${it.trim().replace('https://doi.org/', '')}" }.join("\n")}${manifest.doi ? "\n" : ""} * The nf-core framework https://doi.org/10.1038/s41587-020-0439-x @@ -492,7 +527,7 @@ validation { } summary { beforeText = validation.help.beforeText - afterText = validation.help.afterText + afterText = validation.help.afterText } } diff --git a/nextflow_schema.json b/nextflow_schema.json index 18307b05..9159bb86 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -509,7 +509,7 @@ }, "gtdbtk_min_completeness": { "type": "number", - "default": 50, + "default": 50.0, "description": "Min. bin completeness (in %) required to apply GTDB-tk classification.", "help_text": "Completeness assessed with BUSCO analysis (100% - %Missing). Must be greater than 0 (min. 0.01) to avoid GTDB-tk errors. If too low, GTDB-tk classification results can be impaired due to not enough marker genes!", "minimum": 0.01, @@ -517,7 +517,7 @@ }, "gtdbtk_max_contamination": { "type": "number", - "default": 10, + "default": 10.0, "description": "Max. bin contamination (in %) allowed to apply GTDB-tk classification.", "help_text": "Contamination approximated based on BUSCO analysis (%Complete and duplicated). If too high, GTDB-tk classification results can be impaired due to contamination!", "minimum": 0, @@ -525,7 +525,7 @@ }, "gtdbtk_min_perc_aa": { "type": "number", - "default": 10, + "default": 10.0, "description": "Min. fraction of AA (in %) in the MSA for bins to be kept.", "minimum": 0, "maximum": 100 diff --git a/subworkflows/local/shortread_preprocessing.nf b/subworkflows/local/shortread_preprocessing.nf index ad33b56f..abcee2c3 100644 --- a/subworkflows/local/shortread_preprocessing.nf +++ b/subworkflows/local/shortread_preprocessing.nf @@ -17,10 +17,11 @@ include { BBMAP_BBNORM } from '../../modu workflow SHORTREAD_PREPROCESSING { take: - ch_raw_short_reads // [ [meta] , fastq1, fastq2] (mandatory) - ch_host_fasta // [fasta] (optional) - ch_phix_db_file // [fasta] (optional) - ch_metaeuk_db // [fasta] (optional) + ch_raw_short_reads // [ [meta] , fastq1, fastq2] (mandatory) + ch_host_fasta // [fasta] (optional) + ch_host_genome_index // fasta (optional) + ch_phix_db_file // [fasta] (optional) + ch_metaeuk_db // [fasta] (optional) main: ch_versions = Channel.empty() @@ -38,12 +39,11 @@ workflow SHORTREAD_PREPROCESSING { ch_raw_short_reads, [], params.fastp_save_trimmed_fail, - [] + [], ) ch_short_reads_prepped = FASTP.out.reads ch_versions = ch_versions.mix(FASTP.out.versions.first()) ch_multiqc_files = ch_multiqc_files.mix(FASTP.out.json) - } else if (params.clip_tool == 'adapterremoval') { @@ -80,11 +80,14 @@ workflow SHORTREAD_PREPROCESSING { ch_host_bowtie2index = BOWTIE2_HOST_REMOVAL_BUILD.out.index } } + else if (params.host_genome) { + ch_host_bowtie2index = ch_host_genome_index + } if (params.host_fasta || params.host_genome) { BOWTIE2_HOST_REMOVAL_ALIGN( ch_short_reads_prepped, - ch_host_bowtie2index + ch_host_bowtie2index, ) ch_short_reads_hostremoved = BOWTIE2_HOST_REMOVAL_ALIGN.out.reads ch_versions = ch_versions.mix(BOWTIE2_HOST_REMOVAL_ALIGN.out.versions.first()) @@ -100,7 +103,7 @@ workflow SHORTREAD_PREPROCESSING { ) BOWTIE2_PHIX_REMOVAL_ALIGN( ch_short_reads_hostremoved, - BOWTIE2_PHIX_REMOVAL_BUILD.out.index + BOWTIE2_PHIX_REMOVAL_BUILD.out.index, ) ch_short_reads_phixremoved = BOWTIE2_PHIX_REMOVAL_ALIGN.out.reads ch_versions = ch_versions.mix(BOWTIE2_PHIX_REMOVAL_ALIGN.out.versions.first()) @@ -171,8 +174,8 @@ workflow SHORTREAD_PREPROCESSING { } emit: - short_reads = ch_short_reads + short_reads = ch_short_reads short_reads_assembly = ch_short_reads_assembly - versions = ch_versions - multiqc_files = ch_multiqc_files + versions = ch_versions + multiqc_files = ch_multiqc_files } diff --git a/subworkflows/local/utils_nfcore_mag_pipeline/main.nf b/subworkflows/local/utils_nfcore_mag_pipeline/main.nf index 254658ec..a8c6dfd2 100644 --- a/subworkflows/local/utils_nfcore_mag_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_mag_pipeline/main.nf @@ -42,7 +42,7 @@ workflow PIPELINE_INITIALISATION { version, true, outdir, - workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1 + workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1, ) // @@ -51,7 +51,7 @@ workflow PIPELINE_INITIALISATION { UTILS_NFSCHEMA_PLUGIN( workflow, validate_params, - null + null, ) // @@ -342,6 +342,7 @@ def validateInputSamplesheet(meta, sr1, sr2, lr) { // // Get attribute from genome config file e.g. fasta // +// Note: user uses --host_genome in mag def getGenomeAttribute(attribute) { if (params.genomes && params.host_genome && params.genomes.containsKey(params.host_genome)) { if (params.genomes[params.host_genome].containsKey(attribute)) { @@ -350,13 +351,14 @@ def getGenomeAttribute(attribute) { } return null } - // // Exit pipeline if incorrect --genome key provided // +// Note: user uses --host_genome in mag + def genomeExistsError() { - if (params.genomes && params.host_genome && !params.genomes.containsKey(params.genome)) { - def error_string = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + " Genome '${params.host_genome}' not found in any config files provided to the pipeline.\n" + " Currently, the available genome keys are:\n" + " ${params.host_genomes.keySet().join(", ")}\n" + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + if (params.genomes && params.host_genome && !params.genomes.containsKey(params.host_genome)) { + def error_string = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + " Genome '${params.host_genome}' not found in any config files provided to the pipeline.\n" + " Currently, the available genome keys are:\n" + " ${params.genomes.keySet().join(", ")}\n" + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" error(error_string) } } @@ -371,7 +373,7 @@ def toolCitationText() { "Tools used in the workflow included:", "FastQC (Andrews 2010),", "MultiQC (Ewels et al. 2016)", - "." + ".", ].join(' ').trim() return citation_text @@ -383,7 +385,7 @@ def toolBibliographyText() { // Uncomment function in methodsDescriptionText to render in MultiQC report def reference_text = [ "
  • Andrews S, (2010) FastQC, URL: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/).
  • ", - "
  • Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354
  • " + "
  • Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354
  • ", ].join(' ').trim() return reference_text diff --git a/workflows/mag.nf b/workflows/mag.nf index 3ad2800b..5b424d62 100644 --- a/workflows/mag.nf +++ b/workflows/mag.nf @@ -80,13 +80,21 @@ workflow MAG { host_fasta = params.genomes[params.host_genome].fasta ?: false ch_host_fasta = Channel.value(file("${host_fasta}")) host_bowtie2index = params.genomes[params.host_genome].bowtie2 ?: false - ch_host_bowtie2index = Channel.value(file("${host_bowtie2index}/*")) + ch_host_bowtie2index = Channel.fromPath("${host_bowtie2index}", checkIfExists: true).first() } else if (params.host_fasta) { - ch_host_fasta = Channel.value(file("${params.host_fasta}")) + ch_host_fasta = Channel.fromPath("${params.host_fasta}", checkIfExists: true).first() ?: false + + if (params.host_fasta_bowtie2index) { + ch_host_bowtie2index = Channel.fromPath("${params.host_fasta_bowtie2index}", checkIfExists: true).first() + } + else { + ch_host_bowtie2index = Channel.empty() + } } else { ch_host_fasta = Channel.empty() + ch_host_bowtie2index = Channel.empty() } if (params.kraken2_db) { @@ -165,6 +173,7 @@ workflow MAG { SHORTREAD_PREPROCESSING( ch_raw_short_reads, ch_host_fasta, + ch_host_bowtie2index, ch_phix_db_file, ch_metaeuk_db, )