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

How to change plotting order in plot_dimred, as in Seurat? #63

Open
erzakiev opened this issue Oct 4, 2023 · 0 comments
Open

How to change plotting order in plot_dimred, as in Seurat? #63

erzakiev opened this issue Oct 4, 2023 · 0 comments

Comments

@erzakiev
Copy link

erzakiev commented Oct 4, 2023

I want to change the plotting order in accordance to the expression level of a certain gene/set of genes:
cells expressing a certain gene at a higher level are plotted on top of those expressing it at a lower level.

Because I see that with the current plotting scheme the cells with low expression are often plotted above the cells with high expression of a certain gene.

In Seurat, for instance, the plotting order can be controlled with an argument called order

Seurat::FeaturePlot(x, "feature", cols = c("grey90", viridis::inferno(10000, begin = 0, end = 1, direction = -1)), reduction = "pca", dims = c(2,3))

When order=F
image

When ordering is to be done:
image

For the ggplot2, the basis of our plot_dimred, I found this post and tried both answers, none worked.

Reproducible example:

library(dyno)
smol <- readRDS(url('https://drive.google.com/u/0/uc?id=1ZjMOSiF2BULWIO4A5Ki58jGDfyMEXYAF&export=download'))
plot_dimred(smol, feature_oi = 'T_signature_gene')

image

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

No branches or pull requests

1 participant