| multi_dittoPlot {dittoSeq} | R Documentation |
Generates multiple dittoPlots arranged into a grid.
multi_dittoPlot( object, vars, group.by, color.by = group.by, legend.show = FALSE, ncol = 3, nrow = NULL, main = "var", ylab = NULL, xlab = NULL, OUT.List = FALSE, ... )
object |
the Seurat or SingleCellExperiment object to draw from |
vars |
c("var1","var2","var3",...). A vector of gene or metadata names from which to generate the separate plots |
group.by |
String representing the name of a metadata to use for separating the cells/samples into discrete groups. |
color.by |
String representing the name of a metadata to use for setting color. Default = |
ncol, nrow |
Integers which set how many plots will be arranged per column or per row. Default = 3 columns aand however many rows are required. Set both to NULL to have the grid.arrange function figure out what might be most "square" on its own. |
main, ylab |
String which sets whether / how plot titles or y-axis labels should be added to each individual plot
|
xlab, legend.show, ... |
other paramters passed along to |
OUT.List |
Logical. (Default = FALSE) When set to |
Given multiple 'var' parameters, this function will output a dittoPlot for each one, arranged into a grid, just with some slight tweaks to the defaults.
If OUT.list was set to TRUE, the list of individual plots is output instead of the combined multi-plot.
All parameters that can be adjusted in dittoPlot can be adjusted here.
Daniel Bunis
dittoPlot for the single plot version of this function
# dittoSeq handles bulk and single-cell data quit similarly.
# The SingleCellExperiment object structure is used for both,
# but all functions can be used similarly directly on Seurat
# objects as well.
example(importDittoBulk, echo = FALSE)
myRNA
genes <- getGenes(myRNA)[1:4]
multi_dittoPlot(myRNA, genes, group.by = "clustering")
# violin-plots in front is often better for large single-cell datasets,
# but we cn change the order with 'plots'
multi_dittoPlot(myRNA, genes, "clustering",
plots = c("vlnplot","boxplot","jitter"))
#To make it output a grid that is 2x2, to add y-axis labels
# instead of titles, and to show legends...
multi_dittoPlot(myRNA, genes, "clustering",
nrow = 2, ncol = 2, #Make grid 2x2 (only one of these needed)
main = NULL, ylab = "make", #Add y axis labels instead of titles
legend.show = TRUE) #Show legends
# We can also facet with 'split.by'
multi_dittoPlot(myRNA, genes, "clustering",
split.by = "SNP")