From 98c1ab05ac7b7e28f14cefb625aa3e1c99822e15 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 29 Aug 2024 13:47:22 -0500 Subject: [PATCH 1/2] Incorrect edge created because mediadive id mislabeled as NCBITaxon id --- kg_microbe/transform_utils/mediadive/mediadive.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/kg_microbe/transform_utils/mediadive/mediadive.py b/kg_microbe/transform_utils/mediadive/mediadive.py index 40dfff5f..659a3eaf 100644 --- a/kg_microbe/transform_utils/mediadive/mediadive.py +++ b/kg_microbe/transform_utils/mediadive/mediadive.py @@ -392,18 +392,7 @@ def run(self, data_file: Union[Optional[Path], Optional[str]] = None, show_statu ], ] ) - if strain.get(ID_COLUMN): - medium_strain_edge.extend( - [ - [ - ncbi_strain_id, - SUBCLASS_PREDICATE, - NCBITAXON_PREFIX+str(strain.get(ID_COLUMN)), - RDFS_SUBCLASS_OF, - strain_id - ], - ] - ) + edge_writer.writerows(medium_strain_edge) if SOLUTIONS_KEY not in json_obj: From 6ba6481039943430a56c7263cf9d47e30bfdc326 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 29 Aug 2024 14:01:59 -0500 Subject: [PATCH 2/2] formatted --- kg_microbe/transform_utils/mediadive/mediadive.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kg_microbe/transform_utils/mediadive/mediadive.py b/kg_microbe/transform_utils/mediadive/mediadive.py index 659a3eaf..deb37270 100644 --- a/kg_microbe/transform_utils/mediadive/mediadive.py +++ b/kg_microbe/transform_utils/mediadive/mediadive.py @@ -85,7 +85,6 @@ NCBI_CATEGORY, NCBI_TO_MEDIUM_EDGE, NCBITAXON_ID_COLUMN, - NCBITAXON_PREFIX, OBJECT_ID_COLUMN, PUBCHEM_KEY, PUBCHEM_PREFIX, @@ -369,7 +368,9 @@ def run(self, data_file: Union[Optional[Path], Optional[str]] = None, show_statu else: ncbi_strain_id = STRAIN_PREFIX + strain_id.replace(":", "_") - if not (isinstance(ncbi_strain_id, float) and math.isnan(ncbi_strain_id)): + if not ( + isinstance(ncbi_strain_id, float) and math.isnan(ncbi_strain_id) + ): medium_strain_nodes.extend( [ [