Closed dosumis closed 6 months ago
This functionality is needed in order to demo editing hierarchy (in TDT) --> showing results in AnnData.
Ultimately we may be able to do this with RDF autogenerate by LinkML (see for example). A quick fix might be to generate a networkX object from annotation objects (accession -> has_parent accession) and query that.
networkx based solution here: https://github.com/dosumis/nhp_basal_ganglia_taxonomy/blob/main/derive_cell_ids_from_hierarchy.ipynb
Now flatten is deriving cell-ids from hierarchy: https://github.com/cellannotation/cas-tools/commit/ebc933940d22fd403cc5bb6044646b70858d8ff7
We need merge to do this (too). Demo:
For a simple hierarchy, we only need to store Cell_IDs for rank=0