From 1938d797a3ed339c21f78a45ee61c4769c04342f Mon Sep 17 00:00:00 2001 From: David Osumi-Sutherland Date: Tue, 17 Feb 2026 16:26:01 +0000 Subject: [PATCH 1/2] Update template_generation_tools.py Attempted fix with copilot - removing present_in_taxon hsap for CL only. --- src/template_generation_tools.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/template_generation_tools.py b/src/template_generation_tools.py index 3cd21c7f4..a6236bb08 100644 --- a/src/template_generation_tools.py +++ b/src/template_generation_tools.py @@ -64,13 +64,14 @@ def generate_class_graph_template(ccf_tools_df :pd.DataFrame, log_dict: dict): 'OBO_Validated_surrounds': '>A CCFH:IN_OBO', 'validation_date_surrounds': '>A dc:date'} - seed_sub = {'ID': 'ID', 'in_subset': 'AI in_subset', 'present_in_taxon': 'AI present_in_taxon'} + seed_sub_ub = {'ID': 'ID', 'in_subset': 'AI in_subset', 'present_in_taxon': 'AI present_in_taxon'} + seed_sub_cl = {'ID': 'ID', 'in_subset': 'AI in_subset'} seed_no_valid = {'ID': 'ID', 'ccf_part_of': 'SC ccf_part_of some %', 'ccf_located_in': 'SC ccf_located_in some %'} image_report = [] ug = UberonGraph() records = [seed] - records_ub_sub = [seed_sub] - records_cl_sub = [seed_sub] + records_ub_sub = [seed_sub_ub] + records_cl_sub = [seed_sub_cl] no_valid_records = [seed_no_valid] if ccf_tools_df.empty: return (pd.DataFrame.from_records(records), pd.DataFrame.from_records(no_valid_records), error_log, ConjunctiveGraph(), valid_error_log, report_relationship, strict_log, @@ -124,9 +125,9 @@ def generate_class_graph_template(ccf_tools_df :pd.DataFrame, log_dict: dict): if 'UBERON' in r['o']: records_ub_sub.append({'ID': r['o'], 'present_in_taxon': 'NCBITaxon:9606', 'in_subset': 'human_reference_atlas'}) if 'CL' in r['s'] and not 'PCL' in r['s']: - records_cl_sub.append({'ID': r['s'], 'present_in_taxon': 'NCBITaxon:9606', 'in_subset': 'human_reference_atlas'}) + records_cl_sub.append({'ID': r['s'], 'in_subset': 'human_reference_atlas'}) if 'CL' in r['o'] and not 'PCL' in r['o']: - records_cl_sub.append({'ID': r['o'], 'present_in_taxon': 'NCBITaxon:9606', 'in_subset': 'human_reference_atlas'}) + records_cl_sub.append({'ID': r['o'], 'in_subset': 'human_reference_atlas'}) if ('CL' in r['s'] or 'PCL' in r['s']) and 'UBERON' in r['o']: terms_ct_as.add(f"({r['s']} {r['o']})") From 1097c0dbe41951ad69a5bd17727c9ceb8e277642 Mon Sep 17 00:00:00 2001 From: David Osumi-Sutherland Date: Tue, 17 Feb 2026 16:37:19 +0000 Subject: [PATCH 2/2] Simplify subset template generation and drop present_in_taxon --- src/template_generation_tools.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/template_generation_tools.py b/src/template_generation_tools.py index a6236bb08..e5a7e844a 100644 --- a/src/template_generation_tools.py +++ b/src/template_generation_tools.py @@ -64,14 +64,13 @@ def generate_class_graph_template(ccf_tools_df :pd.DataFrame, log_dict: dict): 'OBO_Validated_surrounds': '>A CCFH:IN_OBO', 'validation_date_surrounds': '>A dc:date'} - seed_sub_ub = {'ID': 'ID', 'in_subset': 'AI in_subset', 'present_in_taxon': 'AI present_in_taxon'} - seed_sub_cl = {'ID': 'ID', 'in_subset': 'AI in_subset'} + seed_sub = {'ID': 'ID', 'in_subset': 'AI in_subset'} seed_no_valid = {'ID': 'ID', 'ccf_part_of': 'SC ccf_part_of some %', 'ccf_located_in': 'SC ccf_located_in some %'} image_report = [] ug = UberonGraph() records = [seed] - records_ub_sub = [seed_sub_ub] - records_cl_sub = [seed_sub_cl] + records_ub_sub = [seed_sub] + records_cl_sub = [seed_sub] no_valid_records = [seed_no_valid] if ccf_tools_df.empty: return (pd.DataFrame.from_records(records), pd.DataFrame.from_records(no_valid_records), error_log, ConjunctiveGraph(), valid_error_log, report_relationship, strict_log, @@ -121,9 +120,9 @@ def generate_class_graph_template(ccf_tools_df :pd.DataFrame, log_dict: dict): records.append({'ID': r['o'], 'User_label': r['user_olabel']}) if 'UBERON' in r['s']: - records_ub_sub.append({'ID': r['s'], 'present_in_taxon': 'NCBITaxon:9606', 'in_subset': 'human_reference_atlas'}) + records_ub_sub.append({'ID': r['s'], 'in_subset': 'human_reference_atlas'}) if 'UBERON' in r['o']: - records_ub_sub.append({'ID': r['o'], 'present_in_taxon': 'NCBITaxon:9606', 'in_subset': 'human_reference_atlas'}) + records_ub_sub.append({'ID': r['o'], 'in_subset': 'human_reference_atlas'}) if 'CL' in r['s'] and not 'PCL' in r['s']: records_cl_sub.append({'ID': r['s'], 'in_subset': 'human_reference_atlas'}) if 'CL' in r['o'] and not 'PCL' in r['o']: