mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 22:28:11 +08:00
Return empty colors for .cxg v0.0 files (#1441)
* Return empty colors for .cxg v0.0 files Fixes https://github.com/chanzuckerberg/cellxgene/issues/1440 The CxgAdaptor.get_colors method currently assumes that the .cxg file has cxg_group_metadata. As a result, the /api/v0.2/colors endpoint always fails for .cxg v0.0 files. * Add test fixture
This commit is contained in:
@@ -195,6 +195,8 @@ class CxgAdaptor(DataAdaptor):
|
||||
return diffexp_cxg.diffexp_ttest(self, maskA, maskB, top_n, lfc_cutoff)
|
||||
|
||||
def get_colors(self):
|
||||
if self.cxg_version == "0.0":
|
||||
return dict()
|
||||
meta = self.open_array("cxg_group_metadata").meta
|
||||
return json.loads(meta["cxg_category_colors"]) if "cxg_category_colors" in meta else dict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user