Skip to content
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

Plot order VlnPlot #454

Closed
balthasar0810 opened this issue May 2, 2018 · 7 comments
Closed

Plot order VlnPlot #454

balthasar0810 opened this issue May 2, 2018 · 7 comments

Comments

@balthasar0810
Copy link

Dear all,

this is maybe a trivial question but how can I provide the exact sample order in VlnPlots?

Thanks and sorry, Christian

@leonfodoulian
Copy link
Contributor

Hi,

You can simply set an order of cluster identities as follows:

# Define an order of cluster identities
my_levels <- c(4,3,2,1)

# Relevel object@ident
object@ident <- factor(x = object@ident, levels = my_levels)

Best,
Leon

@balthasar0810
Copy link
Author

balthasar0810 commented May 2, 2018 via email

@leonfodoulian
Copy link
Contributor

Could you please close this issue?

Thank you!
Leon

@Frankshi5011
Copy link

Hello: I am new to Seurat. How do I do this in Seurat 3? The method described above does work.
Thanks
Frank

@Landbruce
Copy link

Landbruce commented Jun 8, 2019

Hello everyone, I am struggling to change the order of my clusters in the graphs using seurat v3.0.
I ordered them using the ClusterTree function but they came out in descending way to what I want for my graphs. I.e (*4,3,2,1) instead of (1,2,3,4). How can use the version3 to reorder the clusters list?
I have been trying the suggestions above and they are not working. Thank you so much. Victor

@tmccra2
Copy link

tmccra2 commented Sep 20, 2019

I am also wondering how to apply this to version 3.

Thanks!

@AndyR2
Copy link

AndyR2 commented Sep 24, 2019

This works for me in S v3.

object_copy <- object
my_levels <- c(set_custom_order_of_clusters)
Idents(object_copy) <- factor(Idents(object_copy), levels= my_levels)

VlnPlot(object_copy, features = c("some_gene"))

study the command changes here [under tab S v2.x vs S v3.X] to transition from v2 to v3
https://satijalab.org/seurat/essential_commands.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants