Skip to content

Commit

Permalink
Merge pull request #114 from phac-nml/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mattheww95 authored Sep 16, 2024
2 parents c32ce85 + 213e052 commit 77b85be
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 10 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions modules/local/locidex_select.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}

Expand All @@ -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{
Expand Down
7 changes: 6 additions & 1 deletion modules/local/report.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -257,6 +257,7 @@ params {
data_sample_key = "sample_name"
missing_allele_value = '-'
reportable_alleles = []
report_exclude_fields = ["MissingAlleles"]
}

allele_scheme_selected {
Expand Down Expand Up @@ -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 = ''
}
Expand Down
6 changes: 4 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/locidex.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 77b85be

Please sign in to comment.