MarioniLab / miloR

R package implementation of Milo for testing for differential abundance in KNN graphs
https://bioconductor.org/packages/release/bioc/html/miloR.html
GNU General Public License v3.0
316 stars 20 forks source link

Reorder Ident in plotDAbeeswarm #311

Open ShashTrip1 opened 3 months ago

ShashTrip1 commented 3 months ago

Can I reorder the idents in plotDAbeeswarm?

chizuru050314 commented 3 months ago

I also have this problem. I tried to reorder the colData(group.by) but failed. Does anybody know how to do it?

flde commented 3 months ago

You can set the factor level in the result data frame before plotting.

chizuru050314 commented 3 months ago

@flde HI, Can you show an example about how to reorder the levels?

flde commented 3 months ago

Just for clarity, I am not part of miloR. Assuming the variable you are using for group.by in plotDAbeeswarm is called ident.

ident_order <- c("A", "B", "C") # For example result$ident <- factor(result$ident, levels=ident_order) plotDAbeeswarm(result, group.by="ident")

Hope that helps.