Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions scanpy_minion/pl/liana_cc_dotplot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
def liana_cc_dotplot(adata,
source_celltype:str list,
target_celltype: str list, **kwargs):

"""
Plot LIANA results
adata: anndata obj
source_celltype: celltype(s) to be used as ligands (string)
target_celltype: celltype(s) to be used as ligands (string)

return: dotplot with LR results
"""


li.pl.dotplot(adata = adata_filtered_dr,
colour='magnitude_rank',
size='specificity_rank',
inverse_size=True,
inverse_colour=True,
source_labels=source_celltype,
target_labels=target_celltype,
top_n=30,
orderby='magnitude_rank',
orderby_ascending=True,
figure_size=(8, 9)
)
1 change: 1 addition & 0 deletions scanpy_minion/tl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
from .map_to_dahlin import * # Map to dahlin
from .tryumap import * # umap from scaling
from .scvi import * # scvi
from .liana_cc_rankaggr import * #Run LIANA
24 changes: 24 additions & 0 deletions scanpy_minion/tl/liana_cc_rankaggr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from anndata import AnnData
from typing import Union


def liana_cc_rankaggr(adata: AnnData,
use_raw: bool = False,
groupby: str,
resource_name: str):
"""

"""
This function calculates consensus ligand-receptor predictions of individual methods. This is done by ranking and aggregating (RRA) the ligand-receptor interaction predictions from all methods.
adata: anndata obj

return: anndata with liana ligand-receptor interactions consensus results
"""
import liana as li
li.mt.rank_aggregate(adata_filtered_dr,use_raw=False,
groupby=groupby,
resource_name='consensus',
expr_prop=0.1
verbose=True, **kwargs)
rank_aggregate.describe()