Problem: The ontology filter sidebar only showed counts for prefixes with annotation bitmaps (GO, CHEBI, HP). MI and OM terms had no entity annotation bitmaps because most MI terms annotate relations (not entities) and OM terms are used for entity typing, not annotations.
Fix:
-
Inserted missing ontology terms into
entitytable:- 43,009 terms were missing from
entity(only 46,729 existed; 89,738 total inontology_term). - Inserted as
entity_type = 'OM:0012:Cv Term'withcanonical_identifier_type = 'OM:0204:Cv Term Accession'. - Updated
sourcesarray to include the ontology prefix.
- 43,009 terms were missing from
-
Fixed bitmap rebuild procedures:
rebuild_annotation_term_bitmaps()was referencing the non-existententity_annotationtable.- Updated to use
entity_relationwithrelation_category = 'annotation'. - Updated
rebuild_annotation_term_relation_bitmaps()to userelation_annotation_termjoined withentity.
-
Rebuilt all bitmaps via
CALL rebuild_all_bitmaps(). -
Updated
getScopedOntologyPrefixCounts:- No scope (explore page): returns total term counts per prefix from
ontology_termtable. - With scope (selection annotation tab): returns scoped annotation counts as before.
- No scope (explore page): returns total term counts per prefix from
Result: MI (1,653) and OM (321) now appear in the explore page filter sidebar with correct counts.
Files changed:
omnipath-svelte/src/lib/server/queries/ontology-term.ts
Review omnipath_build build process to align ontology term handling — ensure all ontology terms are inserted into entity during build, and that the sources field is populated with the ontology prefix.
We should also connect make connect sources as a foreign key to the resources table, maybe we could use the resource name here as a key? and then in the resources we should have a special kind for ontology resources? so we give ontology sources a different icon/emoji in the ui. i guess we also need input modules for ontologies then, but these can be quite minimalistic since we only need to download and parse obo files, which are very standardized.