
。


Androgen: involved in the growth and development of the male reproductive organs. EGFR: regulates growth, survival, migration, apoptosis, proliferation, and differentiation in mammalian cells Estrogen: promotes the growth and development of the female reproductive organs. Hypoxia: promotes angiogenesis and metabolic reprogramming when O2 levels are low. JAK-STAT: involved in immunity, cell division, cell death, and tumor formation. MAPK: integrates external signals and promotes cell growth and proliferation. NFkB: regulates immune response, cytokine production and cell survival. p53: regulates cell cycle, apoptosis, DNA repair and tumor suppression. PI3K: promotes growth and proliferation. TGFb: involved in development, homeostasis, and repair of most tissues. TNFa: mediates haematopoiesis, immune surveillance, tumour regression and protection from infection. Trail: induces apoptosis. VEGF: mediates angiogenesis, vascular permeability, and cell migration. WNT: regulates organ morphogenesis during development and tissue repair.
progeny = dc.get_progeny(organism='human', top=500)
progeny



#pip install "decoupler>=1.4.0"
import scanpy as sc
import decoupler as dc
import plotnine as p9
import liana as li
from liana.method import MistyData, genericMistyData, lrMistyData
from liana.method.sp import RandomForestModel, LinearModel, RobustLinearModel
adata = sc.read("test.h5ad")
adata.layers['counts'] = adata.X.copy()
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)
sc.pl.spatial(adata, color=[None, 'celltype_niche'], size=1.3, palette='Set1')
adata.obsm['compositions']
# Rename to more informative names
full_names = {'Adipo': 'Adipocytes',
'CM': 'Cardiomyocytes',
'Endo': 'Endothelial',
'Fib': 'Fibroblasts',
'PC': 'Pericytes',
'prolif': 'Proliferating',
'vSMCs': 'Vascular_SMCs',
}
# but only for the ones that are in the data
adata.obsm['compositions'].columns = [full_names.get(c, c) for c in adata.obsm['compositions'].columns]
comps = li.ut.obsm_to_adata(adata, 'compositions')
comps.var# obtain genesets
progeny = dc.get_progeny(organism='human', top=500)
# use multivariate linear model to estimate activity
dc.run_mlm(
mat=adata,
net=progeny,
source='source',
target='target',
weight='weight',
verbose=True,
use_raw=False,
)
# extract progeny activities as an AnnData object
acts_progeny = li.ut.obsm_to_adata(adata, 'mlm_estimate')
# Check how the pathway activities look like
sc.pl.spatial(acts_progeny, color=['Hypoxia', 'JAK-STAT'], cmap='RdBu_r', size=1.3)
misty = genericMistyData(intra=comps, extra=acts_progeny, cutoff=0.05, bandwidth=200, n_neighs=6)misty(model=RandomForestModel, n_jobs=-1, verbose = True)
li.pl.interactions(misty, view='juxta', return_fig=True, figure_size=(7,5))
sc.pp.highly_variable_genes(adata)
hvg = adata.var[adata.var['highly_variable']].index
misty = lrMistyData(adata[:, hvg], bandwidth=200, set_diag=False, cutoff=0.01, nz_threshold=0.1)
(
li.pl.interactions(misty, view='extra', return_fig=True, figure_size=(6, 5), top_n=25, key=abs) +
p9.scale_fill_gradient2(low = "blue", mid = "white", high = "red", midpoint = 0) +
p9.labs(y='Receptor', x='Ligand')
)
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。