saeyslab / nichenetr

NicheNet: predict active ligand-target links between interacting cells
452 stars 113 forks source link

use scaled ligand activity or ligand activity to find condition-related ligand? #209

Closed sadiexiaoyu closed 9 months ago

sadiexiaoyu commented 11 months ago

Hi,

Thank you for the cool software! I have a question regarding to whether should use scaled ligand activity or ligand activity to find condition-related ligand ? It seems that scaled ligand activity is a transformed result and is better for comparisons across different conditions, as seen in https://github.com/saeyslab/nichenetr/issues/149. But from the vignette of Differential Nichenetr https://github.com/saeyslab/nichenetr/blob/master/vignettes/differential_nichenet.md, the output example showed super low value of scaled-ligand activity, but high ligand activity as follows:

Screen Shot 2023-07-19 at 16 06 33

And the vignette wrote that On this plot, we can see that some strongly DE ligand-receptor pairs in the KC niche, have also high scaled ligand activity on KCs - making them strong predictions for further validation. important: ligand-receptor pairs with both high differential expression and ligand activity (=target gene enrichment) are very interesting predictions as key regulators of your intercellular communication process of interest !

So, should we only care about ligand activity, and ignore the low value of scaled ligand activity?

csangara commented 11 months ago

Hi,

Thanks for bringing this to our attention. Normally we will still advise people to use the scaled ligand activity to find condition-related ligands.

The "low" value of scaled ligand activity you see here was caused by outliers. With the shift to the V2 prior model, we changed the ligand activity measure from Pearson correlation to AUPR, which unfortunately can more easily generate outliers. This causes the visualization to be dominated by a few ligands, and others having very light colors. As we were going to deprecate Differential NicheNet, there was an oversight with this vignette.

I will try to see if I can still tweak some visualization parameters so that they are not so influenced by outliers, and I will also adapt the text accordingly.

csangara commented 11 months ago

I've added an extra parameter in make_ligand_activity_target_exprs_plot, namely by setting scaled_ligand_activity_limits = "IQR", the range of values considered for the color scale are [Q1-1.5*IQR, Q3+1.5*IQR] as in boxplots. Outliers will therefore have their colors squished to the min or max color. The visualization looks better now:

image