Comments (1)
Hi @jaakoobb,
Thank you for using my package! There is no straight away parameter that handles this, as I do not generally expect NA
in the metadata variables to plot, as they are also handled by na.value
parameter in SCpubr::do_DimPlot()
.
However, I found a workaround for this. In short:
- You turn your metadata variable from a factor to a character (if it is a factor).
- Select all the
NA
values and turn them into a character value - i.e:"Remove"
. - Set the metadata variable as the
Idents
of the Seurat object via theSeurat::Idents()
function. - Plot the
DimPlot
using theidents.keep
parameter and providing all the values but the one you wish to bring to the back.
And that should do it. Here is a code example of it:
sample$seurat_clusters <- as.character(sample$seurat_clusters)
sample$seurat_clusters[is.na(sample$seurat_clusters)] <- "Remove"
sample$seurat_clusters <- as.factor(sample$seurat_clusters)
Seurat::Idents(sample) <- sample$seurat_clusters
# Plot.
p <- SCpubr::do_DimPlot(sample,
idents.keep = levels(sample)[levels(sample) != "Remove"])
p
This is how it looks with this hotfix:
I will consider coding a workaround for this behaviour for the next update. Hope this helps in the meantime!
Enrique
from scpubr.
Related Issues (20)
- Extract coordinated from do_CellularStatesPlot HOT 2
- ncol | do_DimPlot | ncol argument scaling combined plot differently to other plots HOT 3
- REQUEST | do_DimPlot | Create UMAP with Table HOT 1
- REQUEST | do_DotPlot | Allow duplicated features HOT 1
- BUG | do_FeaturePlot | diverging.palette argument is not working HOT 8
- BUG | do_VolcanoPlot | add gene tags based on logFC + pvalue HOT 1
- REQUEST | do_DotPlot | Reqeuest for the option "dot.min". HOT 1
- How to create custom mappings from p-values to annotation for BoxPlot HOT 1
- Show Genenames in featureplot for feature vector HOT 5
- Fix typo | do_ViolinPlot | Spelling Error HOT 1
- BUG | do_FeaturePlot | The legend titles are not displayed anymore HOT 7
- BUG | do_FeaturePlot | scale = T stopped working HOT 3
- Seurat v5 Support HOT 3
- Violin Feature Plots HOT 2
- REQUEST | do_FeaturePlot | Is it possible to have one feature plot with multiple genes? HOT 3
- label.font only works for legend but not for labels shown on umap HOT 4
- REQUEST | subgroups in dotplot HOT 3
- REQUEST | do_RidgePlot | Extending Data Lines
- No do_LigandReceptorPlot HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scpubr.