Closed Rafael-Silva-Oliveira closed 1 month ago
Hi @Rafael-Silva-Oliveira,
Thanks a lot for the suggestion and the code. I hope that soon we'll get someone to work a bit on the visualisations of liana.
In the meantime, there is also this thread with code to make some really nice plots by users: https://github.com/saezlab/liana-py/issues/85
Hi @Rafael-Silva-Oliveira,
Thanks a lot for the suggestion and the code. I hope that soon we'll get someone to work a bit on the visualisations of liana.
In the meantime, there is also this thread with code to make some really nice plots by users: #85
Super, thank you for mentioning that, I'll have a look! :)
Also, @dbdimitrov what version of plotnine are you using? I'm getting an error here:
li.multi.nmf(lrdata, n_components=None, inplace=True, random_state=0, max_iter=200, verbose=True)
when n_components = None since this if statement prints an elbow plot and I'm getting an error which I believe is version issue; I have the latest plotnine version, so I'd like to check which one was yours just to re-run the code and see how many factors I should use :)
Hi @Rafael-Silva-Oliveira,
I should definitely change this - i.e. the plot should not be part of this function.
Re version: plotnine version = "0.12.4"
Hi @Rafael-Silva-Oliveira,
I should definitely change this - i.e. the plot should not be part of this function.
Re version: plotnine version = "0.12.4"
I think the elbow plot makes a lot of sense there, just perhaps another if statement and a parameter associated with the function like "plot_elbow=True" per default and then the user can just change to False if they don't want to plot it
Thanks, works with that version :)
Is your feature request related to a problem? Please describe.
Would be super cool to expand some of the plotting functionality of LIANA+ and make it even more of a strong contestant for the go-to tool for CCC/LR analysis for both scRNA and Spatial transcriptomics, so this request would be to create a plot like this (adapted from the ccinet_plot from stLearn, which unfortunately isn't quite compatible with HD spatial data nor well maintained - https://stlearn.readthedocs.io/en/stable/tutorials/stLearn-CCI.html)
Describe the solution you'd like From their plotting functionality, something like this:
Contribution
I've made an attempt at adapting the code using a 10X Visium HD dataset after processing with Bin2Cell to extract actual cell locations and using CellTypist for cell type inference
The input would be the adata.uns["liana_res"] as follows:
The output is:
Which seems to be very "uni-directional". It does seem that (as expected) a particular receptor is associated with a particular "source" cell type and thus we see one main cell type with the arrows pointing to all other cell types, instead of something like we see in the stLearn plot. Perhaps there's another function in Liana that would allow this visualization to be more insightful?
Here's the dataframe in case you just want to load it and test it out inter_data.xlsx
Happy to discuss this further!
Thanks
Other plots form stLearn that could be re-adapted and used in LIANA
Another possible implementation of the heatmap/dotplot plots, using lr_mean instead of # interactions as seen in the stLearn plot:
EDIT: Ignore the last feature of the dotplot, completely forgot it already has one dotplot function which already shows the source and target as well as the interactions :)