In [ ]:
import anndata as ad
import ACTIONet as anet
In [ ]:
%load_ext autoreload
%autoreload 2
%aimport ACTIONet
In [ ]:
adata = ad.read_h5ad("../data/pfc5k_ACTIONet_v2_python.h5ad")
In [ ]:
adata
Out[ ]:
AnnData object with n_obs × n_vars = 4505 × 17658
    obs: 'umis', 'genes', 'mito.perc', 'sizeFactors', 'Celltype', 'assigned_archetype', 'node_centrality'
    uns: 'ACTION', '__annotations___colors', 'metadata', 'obsm_annot', 'varm_annot'
    obsm: 'ACTION', 'ACTION_B', 'ACTION_normalized', 'ACTIONet2D', 'ACTIONet3D', 'ACTIONred', 'C_stacked', 'C_unified', 'H_stacked', 'H_unified', 'archetype_footprint', 'denovo_color'
    varm: 'ACTION_A', 'ACTION_V', 'unified_feature_profile', 'unified_feature_specificity'
    obsp: 'ACTIONet'
In [ ]:
import json
import itertools

f = open('../markers.json')

all_markers = json.load(f)

markers = all_markers["Brain"]["PFC"]["Mohammadi2020"]["marker.genes"]
In [ ]:
Labels, Conf, Enrichment = anet.po.cells.annotate(adata, markers)
Computing auto-correlation over network ... done
Post-smoothing expression values ... done
In [ ]:
anet.pl.plot_ACTIONet(adata, Labels)
/Users/mohammadi/miniconda3/envs/actionet/lib/python3.10/site-packages/scanpy/plotting/_tools/scatterplots.py:392: UserWarning:

No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored

Out[ ]:
<AxesSubplot: title={'center': '__annotations__'}, xlabel='actionet2d1', ylabel='actionet2d2'>
In [ ]:
markers_Velmeshev = all_markers["Brain"]["PFC"]["Velmeshev2019"]["marker.genes"]
In [ ]:
Labels_Velmeshev, Conf_Velmeshev, Enrichment_Velmeshev = anet.po.cells.annotate(adata, markers_Velmeshev)
Computing auto-correlation over network ... done
Post-smoothing expression values ... done
In [ ]:
anet.pl.plot_ACTIONet(adata, Labels_Velmeshev)
/Users/mohammadi/miniconda3/envs/actionet/lib/python3.10/site-packages/scanpy/plotting/_tools/scatterplots.py:392: UserWarning:

No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored

Out[ ]:
<AxesSubplot: title={'center': '__annotations__'}, xlabel='actionet2d1', ylabel='actionet2d2'>