Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Visualizations #105

Open
RMOsborn012 opened this issue Apr 19, 2023 · 3 comments
Open

Custom Visualizations #105

RMOsborn012 opened this issue Apr 19, 2023 · 3 comments

Comments

@RMOsborn012
Copy link

First, I want to thank you all for making such a useful package and creating informative tutorials to use with other methods for cell-cell communication (NicheNet and Tensor cell2cell).

Unless I missed it, there isn't an option for changing the color scheme for many of the plot functions, and the default color scheme (ggplot2) is not colorblind-friendly.

I would like to change the colors to be consistent with other plots that I have created when analyzing my data (for presentations and manuscripts). I have already done this by changing the cell_anno parameter in the R/liana_plots.R source code, but the changes in R/liana_tensor.R took far longer than I care to admit. It would be great if there were an argument for defining custom color schemes in your plotting functions. I think this package is incredibly useful and look forward to any new updates.

@dbdimitrov
Copy link
Collaborator

Hi @RMOsborn012,

Most of liana's plots return ggplot/patchwork objects and these can be modified to other colours. Also, for ComplexHeatmap I allow kwargs to be passed so one can adjust the colour scheme.

Either way, I'm happy to change the pallettes in a subsequent update. Feel free to suggest a colour-blind palette (e.g. cividis?).

Hope this helps.
Daniel

@RMOsborn012
Copy link
Author

RMOsborn012 commented Apr 20, 2023

@dbdimitrov I think the more complicated plots were giving me issues, and I couldn't directly change the colors and themes with typical ggplot2 commands. Specifically, the plot_c2c_overview and plot_context_boxplot functions.

For example, when using the plot_c2c_overview function, if I use standard ggplot2 functions to change the colors, it will only change colors in the last plot.

> tensor_colors
Basal Cells Club Cells FOXJ1high Ciliated Cells FOXJ1low Ciliated Cells "#CCBB44" "#EE6677" "#228833" "#4477AA" Ionocytes Multiciliated Precursors CTRL SARS-CoV-2 "#AA3377" "#66CCEE" "#AA4499" "#999933" Adult Pediatric "#009988" "#BBBBBB"

> plot_c2c_overview(sce, group_col="age", sample_col="orig.ident") + scale_fill_manual(values = tensor_colors)

Resulting plot:
Test c2c overview.pdf

Concerning the color palettes, Khroma is an excellent package for color palettes (https://packages.tesselle.org/khroma/).

From the github:
"This R package provides an implementation of Okabe and Ito (2008), Tol (2021) and Crameri (2018) colour schemes. These schemes are ready for each type of data (qualitative, diverging or sequential), with colours that are distinct for all people, including colour-blind readers. "

@dbdimitrov
Copy link
Collaborator

Hi @RMOsborn012,

Yeah, I assume patchwork is making it too complicated. I will try to think how to enable palettes to be passed to the more complicated plots.

Thanks for the feedback!

Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants