Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Restore formatting and validation behavior after header reordering + add Excel warnings for MEPRAM [#856] (https://github.com/BU-ISCIII/relecov-tools/pull/856)
- Adapted github actions workflows to load extra_config first [#863](https://github.com/BU-ISCIII/relecov-tools/pull/863)
- Fix missing env vars in test_upload_validate step for test_sftp_modules [#866](https://github.com/BU-ISCIII/relecov-tools/pull/866)
- read-lab-metadata: keep submitting_institution_id from metadata in EQA initial-config [#868](https://github.com/BU-ISCIII/relecov-tools/pull/868)

#### Changed

Expand Down
1 change: 1 addition & 0 deletions relecov_tools/conf/initial_config-EQA2026.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ read_lab_metadata:
lab_metadata_req_json: {}
json_enrich:
on_missing_schema_field: warn
force_submitting_institution_id_from_lab_code: false
required_copy_from_other_field: {}
samples_json_fields:
- sequence_file_R1_md5
Expand Down
10 changes: 9 additions & 1 deletion relecov_tools/read_lab_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ def __init__(
self.required_post_processing = (
self.project_config.get("required_post_processing", {}) or {}
)
self.force_submitting_institution_id_from_lab_code = bool(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool() is redundant here, isn't it?

self.project_config.get(
"force_submitting_institution_id_from_lab_code", True
)
)
self.json_req_files = self.project_config.get("lab_metadata_req_json", {}) or {}
self.schema_name = self.relecov_sch_json["title"]
self.schema_version = self.relecov_sch_json["version"]
Expand Down Expand Up @@ -499,7 +504,10 @@ def adding_fixed_fields(self, m_data):
m_data[idx]["schema_name"] = self.schema_name
if "schema_version" in self.schema_property_names:
m_data[idx]["schema_version"] = self.schema_version
if "submitting_institution_id" in self.schema_property_names:
if (
"submitting_institution_id" in self.schema_property_names
and self.force_submitting_institution_id_from_lab_code
):
m_data[idx]["submitting_institution_id"] = self.lab_code
return m_data

Expand Down
2 changes: 2 additions & 0 deletions relecov_tools/schema/relecov_schema_EQA.json
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@
"enum": [
"IRMA typing",
"INSaFLU",
"ABRicate",
"Custom typing script"
],
"examples": [
Expand Down Expand Up @@ -1601,6 +1602,7 @@
"enum": [
"IRMA subtyping",
"INSaFLU",
"ABRicate",
"Custom subtyping script"
],
"examples": [
Expand Down
Loading