kevinblighe / scDataviz

scDataviz: single cell dataviz and downstream analyses
61 stars 17 forks source link

UMAP split.by condition/treatment + Marker_heatmap legend position #21

Closed gastrogrj closed 2 years ago

gastrogrj commented 3 years ago

Dear Kevin,

Thanks so much for putting together such a wonderful tool, I have spent many happy hours using it!

As you will see I am a complete novice, any help is much appreciated

I'm sorry to bother but wondered if I could ask 2 questions about presentational issues I am having

1) In a UMAP with multiple conditions, to show the UMAP for each condition individually (e.g. PMID: 33929322 Supp Fig1f, see attached), would one create a distinct SCE object for each condition and merge? or is there a function I have missed in the metadataPlot function? e.g. similar to the split.by function in DimPlot

Screenshot 2021-09-15 at 15 02 44

2) Small thing really, but both in the vignette and my own data the legend appears in the middle of the heatmap?

Screenshot 2021-09-15 at 15 05 35

Best wishes

Gareth

PS you are a bioinfoMAGICIAN!

kevinblighe commented 3 years ago

Hey Gareth, my sincere apologies about the delay! - it has been a busy time. Let's do this in reverse: for #2, the plotSignatures() function, you can avail of the updated code on Github for this function, with an added parameter legendPosition (bottom, left, top, right). To install the Github version, please use:

remotes::install_github('kevinblighe/scDataviz')

For #1, unfortunately, there is no way to do that directly via scDataviz. You could do it manually by splitting the sce object based on condition , and then generating separate plots, but this may be too advanced (?) if you are a novice. It could also be done via a standard ggplot2 function and using facet_grid() or facet_wrap(). This again may be too advanced?

gastrogrj commented 3 years ago

Thanks Kevin, I'm most grateful for your reply

That makes perfect sense thank you, but am struggling the right way to phrase! After trying my best for the last few hours I can conclude that yes this is too advanced!

ggout1 <- ggplot(sce$UMAP, aes(x = "UMAP1", y = "UMAP2"), facet_wrap( ~ treatment))

split(metadata, f = metadata$treatment)

If you had any pointers these would be gratefully received, but please also feel free to close the comment if you are too busy. Thanks again.

kevinblighe commented 2 years ago

Any updates here?

kevinblighe commented 2 years ago

Please re-open if the issue persists.