-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting colors for obsSets? #339
Comments
vc.link_views_by_dict([spatial_view, another_view], {
ct.OBS_COLOR_ENCODING: "cellSetSelection",
ct.OBS_SET_SELECTION: [
["colname", "obs_set_one"],
["colname", "obs_set_two"],
],
ct.OBS_SET_COLOR: [
{
"path": ["colname", "obs_set_one"],
"color": [0, 12, 123],
},
{
"path": ["colname", "obs_set_two"],
"color": [240, 123, 58],
},
]
}, meta=False) Hi @srivarra this can be done with the above. The OBS_COLOR_ENCODING tells Vitessce whether to use the sets (categorical) vs. the gene expression values (quantitative) for colors. (For historical reasons the accepted values for this are the strings Thanks for the suggestion about using the |
@keller-mark Thank you very much! I'll go ahead and give this a try! |
If I have an
AnnData
object, is it possible to manually assign colors for the different cell categories? I tried taking a look atobsSetColor
but I wasn't able to figure out how to utilize it.If it is
obsSetColor
is it used with withadd_coordination_by_dict
? Something like below?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 byadata.obs["<obs_category_column>"].categories.cat
. Many scanpy functions take into account these manual color settings as well when plotting.Thank you!!
The text was updated successfully, but these errors were encountered: