Description of the Issue
When processing laboratory metadata with the read-lab-metadata module, I came across an error:
Traceback (most recent call last):
File "~/Desktop/repiiis/relecov-tools/.venv/lib/python3.12/site-packages/relecov_tools/__main__.py", line 400, in read_lab_metadata
new_metadata.create_metadata_json()
File "~/Desktop/repiiis/relecov-tools/.venv/lib/python3.12/site-packages/relecov_tools/read_lab_metadata.py", line 1047, in create_metadata_json
completed_metadata = self.adding_ontology_to_enum(extended_metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/Desktop/repiiis/relecov-tools/.venv/lib/python3.12/site-packages/relecov_tools/read_lab_metadata.py", line 590, in adding_ontology_to_enum
sample_id = m_data[idx][self.unique_sample_id]
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'sequencing_sample_id'
While investigating, we found that this was caused by an issue when a value that is not in the accepted enum values in the schema and expects ontologies is provided.
When this happens, the function tries to extract the name of the sample, which for RELECOV is sequencing_sample_id, but this is not the case for all the JSON schemas.
Currently, we don't know where this misconfiguration happens - A bit more research is needed!
Extra info
A capture of a debug session available in slack: https://bu-isciii.slack.com/archives/C02JSQ5CEBB/p1772797157605379
AI
Description of the Issue
When processing laboratory metadata with the
read-lab-metadatamodule, I came across an error:While investigating, we found that this was caused by an issue when a value that is not in the accepted enum values in the schema and expects ontologies is provided.
When this happens, the function tries to extract the name of the sample, which for RELECOV is
sequencing_sample_id, but this is not the case for all the JSON schemas.Currently, we don't know where this misconfiguration happens - A bit more research is needed!
Extra info
A capture of a debug session available in slack: https://bu-isciii.slack.com/archives/C02JSQ5CEBB/p1772797157605379
AI
self.unique_sample_idis set up and fix it to adapt to other schemas