mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 07:58:11 +08:00
fix: Handle non-categorical columns with colors + update deprecated AnnData API (#2758)
Yeah that makes sense! Mergingg
This commit is contained in:
@@ -228,6 +228,6 @@ def convert_anndata_category_colors_to_cxg_category_colors(data):
|
||||
|
||||
# create the cellxgene color entry for this category
|
||||
cxg_colors[category_name] = dict(
|
||||
zip(data.obs[category_name].cat.categories, [convert_color_to_hex_format(c) for c in data.uns[uns_key]])
|
||||
zip(data.obs[category_name].astype('category').cat.categories, [convert_color_to_hex_format(c) for c in data.uns[uns_key]])
|
||||
)
|
||||
return cxg_colors
|
||||
|
||||
@@ -22,7 +22,7 @@ def corpora_get_versions_from_anndata(adata):
|
||||
"""
|
||||
|
||||
# per Corpora AnnData spec, this is a corpora file if the following is true
|
||||
if "version" not in adata.uns_keys():
|
||||
if "version" not in list(adata.uns.keys()):
|
||||
return None
|
||||
version = adata.uns["version"]
|
||||
if not isinstance(version, collections.abc.Mapping) or "corpora_schema_version" not in version:
|
||||
|
||||
Reference in New Issue
Block a user