saeyslab / multinichenetr

MultiNicheNet: a flexible framework for differential cell-cell communication analysis from multi-sample multi-condition single-cell transcriptomics data
GNU General Public License v3.0
119 stars 14 forks source link

Inability to Compactly Plot Multiple Phenotypes #89

Open DarioS opened 2 months ago

DarioS commented 2 months ago

make_sample_lr_prod_activity_plots_Omnipath plot is very big. Also, I have three phenotypes for each sample, two conditions per phenotype. Age: Old, Young, Diesase Recurrence: No, Yes. Smoker: No, Yes. Could you provide something to combine multiple analyses? Ideally, it would be possible to plot the Scaled Ligand Activity in Receiver column between different analyses with the union of gene pairs in rows and put a single Omnipath column at the right of the plot to create a concise multi-phenotype plot. I wonder, could group_id be allowed to be a vector? Currently, it is not.

group_id: Name of the meta data column that indicates from which group/condition a cell comes from.

make_sample_lr_prod_activity_plots_Omnipath returns a class patchwork object so users don't have a list of data frames for plots to tinker with. If a list of data frame was the function's return type, users could customise the plot.

> class(result)
  "patchwork" "gg"        "ggplot"   
> str(result)
A patchwork composed of 4 patches
- Autotagging is turned off
- Guides are collected
Layout:
4 patch areas, spanning 2 columns and 2 rows
    t l b r
1:  1 1 1 1
2:  2 1 2 1
3:  1 2 1 2
4:  2 2 2 2

It would be great if multinichenetr seamlessly supported multi-phenotypes plotting.

browaeysrobin commented 1 month ago

Hi @DarioS

The only solution in the current implementation seems to be to combine the phenotype-condition columns into one to perform a combined analysis, similar to what we demonstrate in the multifactorial vignette (https://github.com/saeyslab/multinichenetr/blob/main/vignettes/multifactorial_analysis_BreastCancer.knit.md).

We may consider adapting the plotting outputs, but this is not a priority for now.

DarioS commented 1 month ago

That seems a good workaround if the sample size is large. However, it is good to design a solution for small sample size.