Closed RobertWhitener closed 7 months ago
:smile: Thanks, glad you're enjoying the package!
Hmmmm faceting in the genes/vars direction is not a feature of dittoDotPlot currently, but it's certainly something you could do outside of R with a tool like Illustrator. I'll have to think about if there's a good way to implement the user-input of how to 'split' genes into categories... I've also had the desire.
Some scoping of the potential feature add:
What I'm thinking is either a list structure like split.vars = list(celltype1 = c("gene1", "gene2"), celltype2 = c("gene3", "gene4"))
or just a string vector (that's the same length as vars
) like split.vars = c("celltype1", "celltype1", "celltype2", "celltype2")
. Just something that I can have the function 1) interpret, and 2) add to the data.frame that's given to ggplot + facet_wrap() / facet_grid().
(With an SCE, because there's a 'rowData' = Seurat@meta.data
equivalent for genes, there could be a simpler way where you could label your genes by celltype within the 'rowData'. Then I'd be able to let you just name that 'rowData' column... But that doesn't help you =p, just me scoping out this add further!)
FYI, this was also requested on Biostars earlier today.
Good poke. Lot's on the ditto-docket rn, but this could be a quicker one. Multiple asks for this feature now & I know that I'd use this feature myself too, so this can at least jump to the top of the not-yet-started list!
Implementation has begun in #142
Ultimately implemented around use of the normal vars
input, where you give it a list to provide groupings. For example:
example("importDittoBulk", echo = FALSE)
logcounts(myRNA)[1:4,1:40] <- 0 # to add dropout to this mock bulk data
dittoDotPlot(
myRNA,
vars = list(
'T cell'=c("gene1", "gene2"),
'B cell'=c("gene3", "gene4")),
group.by = "clustering")
Install via remotes::install_github("dtm2451/dittoSeq@dotplot-categories")
to test and make use of this functionality for now. I still need to finalize with unit testing, updated documentation, and potentially some automated theme()
updates to make the facet labels less intrusive, before deploying into the package.
Got a chance to add to this implementation! Almost ready to merge now =).
categories.split.adjust
and categories.theme.adjust
but why would you =p.vars
-axis even when users might want to coord_flip()
them to the y-axis, I've decided to build in a vars.dir
input as well!Made from code:
library(dittoSeq)
example(importDittoBulk, echo = FALSE)
logcounts(myRNA)[1:4,1:40] <- 0
dittoDotPlot(
myRNA, group.by = "clustering",
vars = list(
Naive = paste0("gene", 1:5),
Stimulated = paste0("gene", 6:8),
Other = paste0("gene", 9:10)),
vars.dir = "y"
)
Merged in! This will make it into bioc-devel in the coming days!
Hi, Thank you for this package! Im currently using it to generate DotPlots from our Seurat object because it is giving us much greater flexibility for the dotplots.
I've successfully generated a DotPlot which is grouped by celltype (columns), and then split each group by condition.
I'm wondering, is there a way to 'split' my featurelist (rows in my case) so that I can add some padding between each set of n numbers of features?
That would greatly help with the visualization of the data.
Thanks again!
Genes_of_interest is a vector of 48 features which is sorted by relative enrichment in each CELLTYPE, so adding a little padding between the rows that correspond to different CELLTYPEs would be amazing!
Robert