huayc09 / SeuratExtend

https://huayc09.github.io/SeuratExtend/
GNU General Public License v3.0
101 stars 8 forks source link

reverse order of the cluster values in the ClusterDistrBar #11

Closed pcantalupo closed 2 months ago

pcantalupo commented 2 months ago

In the vignette, B cell is plotted at the bottom of the stacked bars. How do I reverse the order so that B cell is at the top, then CD4 memory below it, etc... I tried to reverse the factor levels but it did not work. image

huayc09 commented 2 months ago

Thank you for your question. I've just added a new parameter reverse_order to the ClusterDistrBar function to make it easier to adjust the stacking order. By default, it's set to TRUE, so you can simply set it to FALSE to reverse the order. Here's an example:

ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, flip = FALSE, reverse_order = FALSE)

This should place B cells at the top of the stacked bars, followed by CD4 memory cells, and so on.

You can try this out by updating to the latest version of SeuratExtend. Let me know if it works for you!

pcantalupo commented 2 months ago

That worked Thank you.

However, I don't see the option in the documentation for ClusterDistrBar.

huayc09 commented 2 months ago

Thank you for reminding. Apologize for my oversight. I've just added the documentation in the new update. It should be visible now. :)