Skip to content

Add UniProt-to-EFO/OBA protein measurement mapping table - #2659

Merged
jamesamcl merged 7 commits into
masterfrom
copilot/create-table-uniprot-efo-mappings
Mar 25, 2026
Merged

jamesamcl merged 7 commits into
masterfrom
copilot/create-table-uniprot-efo-mappings

Conversation

Copilot AI commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

GWAS curators need a lookup table from UniProt IDs to EFO protein measurement terms.

  • New SPARQL query (src/sparql/uniprot-efo-map.sparql): Extracts all measurement terms (subclasses of EFO_0001444) with UniProt mappings from five exhaustively audited sources:
    1. Direct hasDbXref uniprot:* xrefs on measurement terms
    2. URL-style UniProt xrefs (https://www.uniprot.org/uniprotkb/*/entry) on measurement terms, normalized to uniprot: prefix
    3. is_about (IAO_0000136) relationships from measurement terms to protein entities with UniProtKB:* xrefs on annotation axioms (normalized to uniprot: prefix)
    4. is_about relationships to species-neutral PR_ protein classes, resolving to their human-specific subclasses (via only_in_taxon some NCBITaxon_9606) to extract UniProtKB:* xrefs
    5. Obsolete EFO terms with uniprot: xrefs whose term_replaced_by points to an OBA term
  • Comprehensive permutation audit: All combinations of xrefs/is_about, direct/intermediate resolution, and UniProt prefix formats (uniprot:, UniProtKB:, URL-style) were systematically verified to ensure no mappings are missed
  • Makefile integration: Added a specific target for reports/report-uniprot-efo-map.tsv using --use-graphs true to resolve OBA labels from imports, and included it in the trait_reports target for easy regeneration
  • Generated table (src/ontology/reports/report-uniprot-efo-map.tsv): 3,028 mappings (2,975 EFO + 53 OBA)

Regenerate with:

cd src/ontology
make reports/report-uniprot-efo-map.tsv
Original prompt

This section details on the original issue you should resolve

<issue_title>Create table of Uniprot - EFO mappings</issue_title>
<issue_description>As discussed, it would be helpful for GWAS curators to have access to a table of Uniprot IDs -> EFO protein measurement terms. This can be a one off generation in the first instance. </issue_description>

Comments on the Issue (you are @copilot in this section)


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

…ent mappings

- New SPARQL query (src/sparql/uniprot-efo-map.sparql) extracts all EFO
  measurement terms (subclasses of EFO_0001444) that have UniProt xrefs
- Added report-uniprot-efo-map.tsv to trait_reports Makefile target
- Generated initial mapping table with 2,355 UniProt-to-EFO entries
- Table can be regenerated via: make reports/report-uniprot-efo-map.tsv

Co-authored-by: jamesamcl <[email protected]>
Agent-Logs-Url: https://github.com/EBISPOT/efo/sessions/317866ce-95ba-4fe9-aeaa-3135cd5c0364
Copilot AI changed the title [WIP] Generate table of Uniprot IDs to EFO mappings Add UniProt-to-EFO protein measurement mapping table Mar 24, 2026
Copilot AI requested a review from jamesamcl March 24, 2026 23:38
@jamesamcl

Copy link
Copy Markdown
Member

@copilot I was expecting terms imported from OBA to be in this table too

Updated SPARQL query with a UNION to also capture OBA terms that
replaced obsolete EFO measurement terms carrying UniProt xrefs.
Added specific Makefile target with --use-graphs true to resolve
OBA labels from imports. Total mappings: 2,633 (2,580 EFO + 53 OBA).

Co-authored-by: jamesamcl <[email protected]>
Agent-Logs-Url: https://github.com/EBISPOT/efo/sessions/05017432-0e5a-4c54-acc3-3f38a6e30462

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot I was expecting terms imported from OBA to be in this table too

Updated in e05c45c. The SPARQL query now includes a UNION branch that finds obsolete EFO terms with UniProt xrefs whose term_replaced_by points to an OBA term, and outputs the OBA replacement term instead. This adds 53 OBA terms to the table (2,633 total mappings: 2,580 EFO + 53 OBA). The Makefile target uses --use-graphs true to resolve OBA labels from imports.

@jamesamcl
jamesamcl requested review from zoependlington and removed request for jamesamcl March 25, 2026 11:12
Copilot AI changed the title Add UniProt-to-EFO protein measurement mapping table Add UniProt-to-EFO/OBA protein measurement mapping table Mar 25, 2026
@jamesamcl
jamesamcl marked this pull request as ready for review March 25, 2026 11:13
@jamesamcl

Copy link
Copy Markdown
Member

@copilot Is this including both xrefs and is_about?

Added UNION branch to SPARQL query that follows is_about (IAO_0000136)
relationships from measurement terms to PR_ protein terms, extracting
UniProtKB xrefs from annotation axioms. This adds 7 additional mappings
(2,640 total: 2,580 direct xrefs + 7 via is_about + 53 OBA replacements).
UniProtKB: prefix is normalized to uniprot: for consistency.

Co-authored-by: jamesamcl <[email protected]>
Agent-Logs-Url: https://github.com/EBISPOT/efo/sessions/07d4cc89-1822-4246-864e-96093d771db3

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Is this including both xrefs and is_about?

Previously it was only capturing direct hasDbXref uniprot:* xrefs. Updated in 9f65bec to also follow is_about (IAO_0000136) relationships from measurement terms to PR_ protein entities and extract their UniProtKB:* xrefs from annotation axioms. This adds 7 additional mappings not covered by direct xrefs (2,640 total).

Note: OBA terms themselves don't use is_about relationships or carry UniProt xrefs directly — the 53 OBA entries come from the obsolete-EFO-replacement path added previously.

@jamesamcl

Copy link
Copy Markdown
Member

@copilot does it resolve uniprot ids for all PRO classes? I believe the PRO classes might be species neutral and not have uniprot ids, so we need to resolve to human in that case

The is_about UNION branch now follows species-neutral PR classes to their
human-specific subclasses (via only_in_taxon some NCBITaxon_9606) to
resolve UniProtKB xrefs. This picks up 386 additional mappings for a
total of 3,025 (2,972 EFO + 53 OBA).

Co-authored-by: jamesamcl <[email protected]>
Agent-Logs-Url: https://github.com/EBISPOT/efo/sessions/24fcd075-dd25-4c8f-92a4-8564e7ced1fc

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot does it resolve uniprot ids for all PRO classes? I believe the PRO classes might be species neutral and not have uniprot ids, so we need to resolve to human in that case

Correct — the previous version only found UniProt IDs on the few PR classes that had UniProtKB: annotation axiom xrefs directly. Most PR classes referenced via is_about are species-neutral (Category=gene) and don't carry UniProt IDs.

Updated in 41f922f to resolve through the human-specific subclass: is_about → species-neutral PR class → human subclass (via only_in_taxon some NCBITaxon_9606) → UniProtKB:* xref. This adds 386 new mappings for a total of 3,025 (2,972 EFO + 53 OBA).

@jamesamcl

Copy link
Copy Markdown
Member

@copilot what about direct is_about? looks like you only handle is_about in the PRO case now?

…resolution

The previous commit replaced the general is_about branch with the
PRO-specific human resolution. Now both paths are included:
1. is_about -> protein -> direct UniProtKB xref on annotation axiom
2. is_about -> species-neutral PR -> human subclass -> UniProtKB xref

Total: 3,026 mappings (2,973 EFO + 53 OBA).

Co-authored-by: jamesamcl <[email protected]>
Agent-Logs-Url: https://github.com/EBISPOT/efo/sessions/b00e76cf-42b2-42fc-935b-a8460f64fc5f

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot what about direct is_about? looks like you only handle is_about in the PRO case now?

You're right — the previous commit replaced the direct is_about branch with the PRO human resolution instead of keeping both. Fixed in 754d1f1: the query now has separate UNION branches for (1) is_about → protein → direct UniProtKB xref, and (2) is_about → species-neutral PR → human subclass → UniProtKB xref. Total: 3,026 mappings.

@jamesamcl

Copy link
Copy Markdown
Member

@copilot I am concerned this is still not exhaustive. Can you make sure you have covered all permutations of is_about and xrefs, whether or not we go through an intermediate term, and different prefixes used for uniprot. Afterwards comment here with a table of all of the permutations. Please check what you have done to make sure you don't miss any.

Audited all permutations of xrefs/is_about, intermediate resolution,
and UniProt prefix formats. Added a new UNION branch for URL-style
UniProt xrefs (https://www.uniprot.org/uniprotkb/*/entry) found on
2 measurement terms, normalizing to uniprot: prefix.

Total: 3,028 mappings (2,975 EFO + 53 OBA).

Co-authored-by: jamesamcl <[email protected]>
Agent-Logs-Url: https://github.com/EBISPOT/efo/sessions/3fa2caf5-19b5-4676-ae47-dde12e259840

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot I am concerned this is still not exhaustive. Can you make sure you have covered all permutations of is_about and xrefs, whether or not we go through an intermediate term, and ...

Audited all permutations and added the missing one in 680bedc. Here's the full coverage table:

# Path UniProt Prefix Status Covered Hits
1 Direct xref on measurement term uniprot: Active ✅ Branch 1 2,580
2 Direct xref on measurement term URL (https://.../uniprotkb/*/entry) Active ✅ Branch 2 (new) 2
3 is_about → protein → annotation axiom xref UniProtKB: Active ✅ Branch 3 7
4 is_about → species-neutral PR → human subclass → annotation axiom xref UniProtKB: Active ✅ Branch 4 386
5 Obsolete EFO xref → OBA replacement uniprot: Obsolete→OBA ✅ Branch 5 53

Verified not applicable (0 hits on measurement terms):

  • Direct UniProtKB: xrefs on measurement terms: none exist
  • Direct UniProt: (capital P) xrefs on measurement terms: none exist (the 1 instance is on a non-measurement obsolete term)
  • is_about targets with direct hasDbXref UniProtKB:*: PR proteins don't have direct UniProtKB xrefs, only annotation axiom xrefs
  • Human PR subclasses have both direct and annotation axiom UniProtKB: xrefs, but the annotation axiom approach is a superset for all measurement-referenced proteins
  • OBA terms have no UniProt xrefs or is_about relationships
  • Obsolete terms with OBA replacements: none use non-uniprot: prefixes or is_about
  • http://www.uniprot.org/uniprot/* (old URL format): none exist on measurement terms

Total: 3,028 mappings (2,975 EFO + 53 OBA).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create table of Uniprot - EFO mappings

2 participants