cellannotation / cell-annotation-schema

General, open-standard schema for cell annotations
9 stars 1 forks source link

Flattening to Anndata - cell label #68

Closed dosumis closed 6 months ago

dosumis commented 7 months ago

When flattening to AnnData cell_label should keep the original obs key.

This keeps compatibility with the CZI schema and allows for different flattening schemes.

e.g. Siletti - non neurona Anndatal

has the obs key::value pair

{ "supercluster_term" : "Oligodendrocyte precursor" }

in CAS annotation object with curated annotation metadata:

labelset cell_label cell_ontology_term_id cell_ontology_term rationale rationale_doi positive_gene_evidence
supercluster_term Oligodendrocyte precursor CL:0002453 oligodendrocyte precursor cell Supported by marker expression and annotation transfer from Middle Temporal Gyrus dataset (Jorstad et al., 2023) DOI:10.1126/science.adf6812 PDGFRA, SOX10

loading CAS to anndata & flattening to obs:

supercluster_term supercluster_term--cell_ontology_term_id supercluster_term--cell_ontology_term supercluster_term--rationale supercluster_term--rationale_doi supercluster_term--positive_gene_evidence
Oligodendrocyte precursor CL:0002453 oligodendrocyte precursor cell Supported by marker expression and annotation transfer from Middle Temporal Gyrus dataset (Jorstad et al., 2023) DOI:10.1126/science.adf6812 PDGFRA, SOX10
dosumis commented 7 months ago

Update - turns out this is what the cap_anndata_schema specifies. This just needs to be reflected in the flattening script. Keeping ticket for reference while flattening code is updated.