Comments (13)
I've finally put together a version of how this could work, and within the base dittoPlot instead of multi_dittoPlot. BiocManager::install("dtm2451/dittoSeq@multivar-dittoPlot")
if you want to try!
from dittoseq.
Hmmm, do A-G represent genes, or sets of genes?, here and treatment is a sample grouping?
from dittoseq.
A-G would be genes. The treatment would be a sample grouping, sorry, I could have clarified better in the OP.
from dittoseq.
No worries! Just wanted to clarify =). I like the idea and will ponder on how best to implement. Potentially could be an alternate plotting functionality in the back-end, but accessible with just multi_dittoPlot(..., group.by = "vars")
.
from dittoseq.
Ohh, very nice, thanks for the addition!
from dittoseq.
Is there a way to produce the dittobarplot similar to the figure above, i.e. the group-by is plotted within one axis and not split between different graphs?
from dittoseq.
Yep! You can't do it in the "release" version yet, but you can if you install from github.
It'll be available from dittoSeq 1.10 after the next Bioconductor release in November.
In v1.9.2 or higher, you would give the desired set of var
s to var
(can be any metadata or genes of the object).
Customization Details: You can use multivar.aes
to switch between displaying those vars in faceting/splitting, color, or x-axis groupings. And when using splitting, and split.by = "<something_else>"
, you can use multivar.split.dir
to control which direction the var
data goes .
Install with:
if (!requireNamespace("remotes")) { install.packages("remotes") }
remotes::install_github("dtm2451/dittoSeq")
Usage = any of these:
library(dittoSeq)
example("importDittoBulk", echo = FALSE)
dittoPlot(object = myRNA, var = c("gene1", "gene2", "gene3"), group.by = "timepoint") # default: `multivar.aes = "split"`
dittoPlot(object = myRNA, var = c("gene1", "gene2", "gene3"), group.by = "timepoint", multivar.aes = "group")
dittoPlot(object = myRNA, var = c("gene1", "gene2", "gene3"), group.by = "timepoint", multivar.aes = "color")
# Or with extra split.by variable:
dittoPlot(object = myRNA, var = c("gene1", "gene2", "gene3"), group.by = "timepoint",
split.by = "clustering") # default: `multivar.split.dir = "col"`
dittoPlot(object = myRNA, var = c("gene1", "gene2", "gene3"), group.by = "timepoint",
split.by = "clustering", multivar.split.dir = "row")
from dittoseq.
Is there a way to produce the dittobarplot similar to the figure above, i.e. the group-by is plotted within one axis and not split between different graphs?
Oops, on re-read, noticing you asked about dittoBarPlot(). Can you clarify how you mean, @vivianschu?
Stab#2... dittoFreqPlot() splits the var-levels / cell types of a dittoBarPlot() up, so if you mean like a dittoFreqPlot() with the cell types all side-by-side: I hadn't thought to build multivar.aes
-like control for that function, but you could achieve a similar feel by giving split.nrow = 1
...
dittoFreqPlot(myRNA, "clustering", group.by = "groups", sample.by = "sample",
split.nrow = 1)
from dittoseq.
My bad! I meant dittoBoxPlot, not dittoBarPlot.
I tested out your suggestions on how to produce those plots (particularly interested in how to reproduce the last one), however they generate the same result with box plots stacked instead of in one row.
I am trying to illustrate a gene's expression level among each cluster, comparing the control samples to the treatment, where grey = control and blue = treatment.
Here is my pseudoscript below, which produce the image above:
if (!requireNamespace("remotes")) { install.packages("remotes") }
remotes::install_github("dtm2451/dittoSeq")
library(dittoSeq)
dittoBoxPlot(seurat_object, "Gene", group.by = "condition", split.by = "cluster", multivar.split.dir = "row")
Any suggestions on how to modify this to create the box plots in one row? Was my installation of the new dittoPlot version incorrect?
from dittoseq.
Ohhhh! You don't need the new version unless you wanted to do something like:
dittoBoxPlot(seurat_object, c("Gene1", "Gene2"), ...)
This issue
was about plotting results for multiple genes / vars in a single plot.
If you are just trying to put all your split.by = "cluster"
facets in a single row, all you need to do is to add split.nrow = 1
!
(And fyi, syntax for dittoBoxPlot is exactly the same as for dittoPlot. So as you may already have noticed, you can modify any example code that uses dittoPlot by just adding in the "Box". The ONLY difference between the two lies in their default values for the 'plots' input.)
from dittoseq.
Wonderful!! Thank you so much - I didn't realize the solution was so simple.
Last question -- is there a method to place the group.by labels on the bottom instead of the top?
from dittoseq.
Yup! The documentation path is a bit hard to follow, but I tried to describe in the docs for the 'split.adjust' input how you can use it to pass tweaks into the faceting functions. Since you're only giving one variable to 'split.by', you'd follow ?facet_wrap
for options. And looking there, I see a 'strip.position' input. Try adding: split.adjust = list(strip.position = "bottom")
from dittoseq.
Thanks so much!!
from dittoseq.
Related Issues (20)
- Throw error if dimReds are NA HOT 3
- working with altExps HOT 14
- dittoHeatmap on "scale.data" and rowSums == 0 HOT 4
- Prepare for upcoming Seurat v5 release
- Changing titles on multi-plots / pseudo facet titles HOT 2
- How to remove median in boxplot? HOT 7
- Add parameter to control boxplot outlier size HOT 2
- Change colors of genes in dittoHeatmap HOT 4
- Error generating dittoheatmap HOT 2
- Dotplot on single gene split by two conditions HOT 5
- dittoHeatmap HOT 5
- dittoHeatmap with pale heat map colors HOT 1
- Support for Seurat V5? HOT 3
- Marker disappeared in the heatmap HOT 3
- White line on heatmap HOT 2
- Error in .subscript.2ary(x, i, j, drop = TRUE) : subscript out of bounds HOT 1
- dittoHeatmap : Error in .var_OR_get_meta_or_gene(x, object, assay, slot) HOT 2
- interactive heatmap HOT 2
- dittoheatmap label color HOT 1
- dittobarplot color HOT 1
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 dittoseq.