diff --git a/CHANGELOG.md b/CHANGELOG.md index b4aaf28..fa12496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.4.1] - 2024-09-16 + +### `Fixed` + +- Fixed null species ID in QCMessage when no organism qc data available. [PR 111](https://github.com/phac-nml/mikrokondo/pull/111) + +### `Changed` + +- Removed missing alleles from final report fixing issue [112](https://github.com/phac-nml/mikrokondo/issues/112). + +- Changed default option for `override_allele_scheme` from `null` to "" (evaluates to false). [PR 109](https://github.com/phac-nml/mikrokondo/pull/109) + + ## [0.4.0] - 2024-09-04 ### `Changed` diff --git a/modules/local/locidex_select.nf b/modules/local/locidex_select.nf index 04ee405..577df9d 100644 --- a/modules/local/locidex_select.nf +++ b/modules/local/locidex_select.nf @@ -53,7 +53,7 @@ process LOCIDEX_SELECT { def report_name = "${meta.id}_${params.locidex.db_config_output_name}" output_config = task.workDir.resolve(report_name) - if(params.override_allele_scheme == null && params.locidex.allele_database == null){ + if(!params.override_allele_scheme && params.locidex.allele_database == null){ error("Allele calling is enabled but there is no allele scheme or locidex allele database location present.") } @@ -67,7 +67,7 @@ process LOCIDEX_SELECT { def locidex_config_data = jsonSlurper.parseText(json_data) validate_locidex_db(locidex_config_data, params.override_allele_scheme) write_config_data(locidex_config_data, output_config) - scheme = params.override_allele_scheme // reset the schem path to the passed allele scheme + scheme = params.override_allele_scheme // reset the scheme path to the passed allele scheme paired_p = true }else{ diff --git a/modules/local/report.nf b/modules/local/report.nf index 68eeddd..0eccfe0 100644 --- a/modules/local/report.nf +++ b/modules/local/report.nf @@ -373,7 +373,12 @@ def create_action_call(sample_data, species_tag){ def tests_passed = "Passed Tests: ${checks - checks_failed - checks_ignored}/${checks}" qual_message.add(tests_passed) - def species_id = "Species ID: ${val.value[val.key][params.top_hit_species.report_tag]}" + + def species_selected = val.value[val.key][params.top_hit_species.report_tag] + if(species_selected == null){ + species_selected = organism_criteria + } + def species_id = "Species ID: ${species_selected}" qual_message.add(species_id) // Qual summary not final message diff --git a/nextflow.config b/nextflow.config index 99bd7e7..e55b252 100644 --- a/nextflow.config +++ b/nextflow.config @@ -112,7 +112,7 @@ params { sr_full_cgmlst = true // Use full set of cgMLST alleles which can include highly similar alleles // Allele Scheme Options - override_allele_scheme = null // Supply an allele scheme that will be used for allele calling of all samples + override_allele_scheme = "" // Supply an allele scheme that will be used for allele calling of all samples lx_allele_database = null // A path to the locidex manifest.json file needed for allele calling. // Locidex Options @@ -257,6 +257,7 @@ params { data_sample_key = "sample_name" missing_allele_value = '-' reportable_alleles = [] + report_exclude_fields = ["MissingAlleles"] } allele_scheme_selected { @@ -1194,7 +1195,7 @@ manifest { description = """Mikrokondo""" mainScript = 'main.nf' nextflowVersion = '!>=23.04.0' - version = '0.4.0' + version = '0.4.1' defaultBranch = 'main' doi = '' } diff --git a/nextflow_schema.json b/nextflow_schema.json index 6f1aa77..37aef1f 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -136,8 +136,10 @@ "type": "string", "description": "Specify the path to an allele calling schema to be used. This schema will be used for allele calling of all samples.", "exists": true, - "pattern": "^\\S+$", - "format": "directory-path" + "pattern": "^\\S*$", + "format": "directory-path", + "default": "", + "help_text": "" } } }, diff --git a/subworkflows/local/locidex.nf b/subworkflows/local/locidex.nf index 257bf4d..1ecbf15 100644 --- a/subworkflows/local/locidex.nf +++ b/subworkflows/local/locidex.nf @@ -16,14 +16,14 @@ workflow LOCIDEX { paired_species = top_hit.join(contigs) paired_dbs = Channel.empty() - if(params.override_allele_scheme == null && params.locidex.allele_database == null && !params.skip_allele_calling){ + if(!params.override_allele_scheme && params.locidex.allele_database == null && !params.skip_allele_calling){ error("Allele calling is enabled, but no locidex database directory has been configured.") } def manifest_file = [] // Default empty values for entries def config_file = [] - if(params.override_allele_scheme != null){ + if(params.override_allele_scheme){ // allele scheme over rides the the manifest file def config_file_in = [params.override_allele_scheme, params.locidex.config_data_file].join(File.separator) config_file = file(config_file_in, checkIfExists: true) diff --git a/tests/main.nf.test b/tests/main.nf.test index f250bd7..261ff7c 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -88,7 +88,7 @@ nextflow_pipeline { assert !iridanext_metadata.CSE.containsKey("Length Value") assert !iridanext_metadata.CSE.containsKey("nr contigs Status") assert !iridanext_metadata.CSE.containsKey("nr contigs Value") - assert iridanext_metadata.CSE."QC Summary" == "FAILED Species ID: null; Passed Tests: 0/6; Organism QC Criteria: No organism specific QC data available." + assert iridanext_metadata.CSE."QC Summary" == "FAILED Species ID: No organism specific QC data available.; Passed Tests: 0/6; Organism QC Criteria: No organism specific QC data available." assert iridanext_metadata.CSE."Downsampled" == false assert !iridanext_metadata.CSE.containsKey("predicted_identification_name")