vitessce-python icon indicating copy to clipboard operation
vitessce-python copied to clipboard

Setting colors for obsSets?

Open srivarra opened this issue 9 months ago • 2 comments

If I have an AnnData object, is it possible to manually assign colors for the different cell categories? I tried taking a look at obsSetColor but I wasn't able to figure out how to utilize it.

If it is obsSetColor is it used with with add_coordination_by_dict? Something like below?

vc.add_coordination_by_dict({
    ct.OBS_COLOR_ENCODING: {
        "obs_set_one": ["0", "12" "123"],
		"obs_set_two": ["240", "123", "58"],
    }
})

As a ease of use functionality, It would be handy if colors could be manually set with the adata.uns["<obs_category_column>_colors" which is a list of RGB values sorted by adata.obs["<obs_category_column>"].categories.cat. Many scanpy functions take into account these manual color settings as well when plotting.

Thank you!!

srivarra avatar Apr 26 '24 16:04 srivarra