Starlitnightly/omicverse

defined order for the plot of groups

Closed this issue · 1 comments

We may need to the defined order of groups, when we plot with 'plot_cellproportion' in OV.
So, could you provide a parameter for the order of groups?

Hi,

Thank you for your suggestion. You can use the following code to adjust the order of groups using adata.obs['major_celltype'].cat.reorder_categories:

adata.obs['major_celltype'] = adata.obs['major_celltype'].cat.reorder_categories(['B cells', 'T cells', 'Plasma',
                                                                                   'Macro', 'Mono', 'Mast', 'DC',
                                                                                   'Principal cell', 'Podocyte',
                                                                                   'Proximal tubular cell',
                                                                                   'Distal tubular cell',
                                                                                   'Loop of Henle cell',
                                                                                   'Intercalated cell', 'Fibro', 'Tumor/TECs'])

Feel free to let me know if you have any more questions!

Zehua