{ "cells": [ { "cell_type": "markdown", "id": "e98c92a2", "metadata": {}, "source": [ "# Run CCCI" ] }, { "cell_type": "code", "execution_count": 1, "id": "1f55d803", "metadata": { "ExecuteTime": { "end_time": "2024-04-10T12:42:48.984671Z", "start_time": "2024-04-10T12:42:38.771151Z" }, "collapsed": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/user/BGM/qij/miniconda3/envs/stcase_tmp1/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n", "/home/user/BGM/qij/miniconda3/envs/stcase_tmp1/lib/python3.10/site-packages/torch_geometric/typing.py:54: UserWarning: An issue occurred while importing 'pyg-lib'. Disabling its usage. Stacktrace: /usr/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/user/BGM/qij/miniconda3/envs/stcase_tmp1/lib/python3.10/site-packages/libpyg.so)\n", " warnings.warn(f\"An issue occurred while importing 'pyg-lib'. \"\n", "During startup - Warning message:\n", "package ‘stats’ in options(\"defaultPackages\") was not found \n" ] } ], "source": [ "import pandas as pd\n", "import numpy as np\n", "import scanpy as sc\n", "import STCase as st" ] }, { "cell_type": "code", "execution_count": 2, "id": "a86d5bf0", "metadata": { "ExecuteTime": { "end_time": "2024-04-10T12:42:49.055135Z", "start_time": "2024-04-10T12:42:48.994458Z" } }, "outputs": [], "source": [ "DB_interaction = pd.read_csv('/home/user/data3/qij/project/cell_communication/interaction_database/selfdb_finalv/selfdb_human.csv',index_col=0)\n", "DB_complex = pd.read_csv('/home/user/data3/qij/project/cell_communication/interaction_database/selfdb_finalv/selfdb_complex_human.csv',index_col=0)\n", "DATABASES_GLOB = '/home/user/data3/qij/project/cell_communication/pySCENIC/databases/human_hg38_v10/*.genes_vs_motifs.rankings.feather'\n", "MOTIF_ANNOTATIONS_FNAME = '/home/user/data3/qij/project/cell_communication/pySCENIC/resources/motifs-v10nr_clust-nr.hgnc-m0.001-o0.0.tbl'" ] }, { "cell_type": "code", "execution_count": 3, "id": "5ddc7c4b", "metadata": { "ExecuteTime": { "end_time": "2024-04-10T12:42:50.574602Z", "start_time": "2024-04-10T12:42:49.560645Z" } }, "outputs": [], "source": [ "adata_sp311 = sc.read_h5ad('../NG-lung/spdata/sp311_nonceco.h5ad')" ] }, { "cell_type": "markdown", "id": "7bed2e71", "metadata": {}, "source": [ "## Running\n", "There are three ways to run the CCCI module" ] }, { "cell_type": "markdown", "id": "ff25c245", "metadata": {}, "source": [ "### (1) Stringent" ] }, { "cell_type": "code", "execution_count": 4, "id": "e4fd7c8c", "metadata": { "ExecuteTime": { "end_time": "2024-04-10T20:22:07.104214Z", "start_time": "2024-04-10T12:43:16.874412Z" }, "collapsed": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "##################################################################\n", "Now start to calulate radius\n", "The radius is: 220.41097976280582\n", "##################################################################\n", "Now start to get LR pair\n", "The number of keep LR pair is 1866\n", "##################################################################\n", "get_LR_gene_exp\n", "##################################################################\n", "get_close_gene\n", "##################################################################\n", "Now start to get true weight matirx\n", "Now processing the unsecreted\n", "Computed weight matrix process: |██████████████████████████████| 100%\n", "Now processing the secreted\n", "Computed weight matrix process: |██████████████████████████████| 100%\n", "##################################################################\n", "Now start to permutation test\n", "Permutation test process: |██████████████████████████████| 100%\n", "Now filter low confidence value\n", "Filter low confidence value process: |██████████████████████████████| 100%\n", "##################################################################\n", "Now start to add intracellular signals\n", "Run SCENIC\n", "Phase I: Inference of co-expression modules\n", "preparing dask client\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/user/BGM/qij/miniconda3/envs/stcase_tmp1/lib/python3.10/site-packages/distributed/node.py:182: UserWarning: Port 8787 is already in use.\n", "Perhaps you already have a cluster running?\n", "Hosting the HTTP server on port 46744 instead\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "parsing input\n", "creating dask graph\n", "16 partitions\n", "computing dask graph\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/user/BGM/qij/miniconda3/envs/stcase_tmp1/lib/python3.10/site-packages/distributed/client.py:3125: UserWarning: Sending large graph of size 107.19 MiB.\n", "This may cause some slowdown.\n", "Consider scattering data ahead of time and using futures.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "shutting down client and local cluster\n", "finished\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n", "2024-04-11 03:59:51,484 - pyscenic.utils - INFO - Calculating Pearson correlations.\n", "\n", "2024-04-11 03:59:51,854 - pyscenic.utils - WARNING - Note on correlation calculation: the default behaviour for calculating the correlations has changed after pySCENIC verion 0.9.16. Previously, the default was to calculate the correlation between a TF and target gene using only cells with non-zero expression values (mask_dropouts=True). The current default is now to use all cells to match the behavior of the R verision of SCENIC. The original settings can be retained by setting 'rho_mask_dropouts=True' in the modules_from_adjacencies function, or '--mask_dropouts' from the CLI.\n", "\tDropout masking is currently set to [False].\n", "\n", "2024-04-11 04:00:08,021 - pyscenic.utils - INFO - Creating modules.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Phase II: Prune modules for targets with cis regulatory footprints\n", "Create regulons from a dataframe of enriched features.\n", "Additional columns saved: []\n", "Phase III: Cellular regulon enrichment matrix\n", "Add intracellular signals: |██████████████████████████████| 100%\n", "##################################################################\n", "Now start to aggregate\n", "Spatial cell communication finished!\n" ] } ], "source": [ "adata_sp311_stringent = st.ccci.spatial_cell_communication_run(adata_sp311,\n", " DB_interaction,\n", " DB_complex,\n", " method='Hill',\n", " ct_key='cell_type',\n", " cell_type=None,\n", " if_hvg=False,\n", " if_filter=False,\n", " if_self=True,\n", " if_intra=True,\n", " if_stringent=True,\n", " DATABASES_GLOB=DATABASES_GLOB,\n", " MOTIF_ANNOTATIONS_FNAME=MOTIF_ANNOTATIONS_FNAME,\n", " background_number=1000,\n", " threads=10,\n", " scope=6,\n", " min_exp=0.1,\n", " cutoff=0.05)" ] }, { "cell_type": "code", "execution_count": 36, "id": "711d5919", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:56:01.778604Z", "start_time": "2024-04-11T05:55:00.341386Z" } }, "outputs": [], "source": [ "adata_sp311_stringent.write_h5ad('./adata_sp311_stringent.h5ad')" ] }, { "cell_type": "markdown", "id": "b3abba74", "metadata": {}, "source": [ "### (2) non-stringent" ] }, { "cell_type": "code", "execution_count": null, "id": "1753c1ba", "metadata": {}, "outputs": [], "source": [ "adata_sp311_nonstringent = st.ccci.spatial_cell_communication_run(adata_sp311,\n", " DB_interaction,\n", " DB_complex,\n", " method='Hill',\n", " ct_key='cell_type',\n", " cell_type=None,\n", " if_hvg=False,\n", " if_filter=False,\n", " if_self=True,\n", " if_intra=True,\n", " if_stringent=True,\n", " DATABASES_GLOB=DATABASES_GLOB,\n", " MOTIF_ANNOTATIONS_FNAME=MOTIF_ANNOTATIONS_FNAME,\n", " background_number=1000,\n", " threads=10,\n", " scope=6,\n", " min_exp=0.1,\n", " cutoff=0.05)" ] }, { "cell_type": "code", "execution_count": null, "id": "3747d188", "metadata": {}, "outputs": [], "source": [ "adata_sp311_nonstringent.write_h5ad('./adata_sp311_nonstringent.h5ad')" ] }, { "cell_type": "markdown", "id": "1e4cf23a", "metadata": {}, "source": [ "### (3) With no regard for the downstream path" ] }, { "cell_type": "code", "execution_count": null, "id": "e3a845a9", "metadata": {}, "outputs": [], "source": [ "adata_sp311_nodownstram = st.ccci.spatial_cell_communication_run(adata_sp311,\n", " DB_interaction,\n", " DB_complex,\n", " method='Hill',\n", " ct_key='cell_type',\n", " cell_type=None,\n", " if_hvg=False,\n", " if_filter=False,\n", " if_self=True,\n", " if_intra=False,\n", " if_stringent=False,\n", " DATABASES_GLOB=DATABASES_GLOB,\n", " MOTIF_ANNOTATIONS_FNAME=MOTIF_ANNOTATIONS_FNAME,\n", " background_number=1000,\n", " threads=10,\n", " scope=6,\n", " min_exp=0.1,\n", " cutoff=0.05)" ] }, { "cell_type": "code", "execution_count": null, "id": "2623f5e6", "metadata": {}, "outputs": [], "source": [ "adata_sp311_nodownstram.write_h5ad('./adata_sp311_nodownstram.h5ad')" ] }, { "cell_type": "markdown", "id": "bd018283", "metadata": {}, "source": [ "## Results" ] }, { "cell_type": "code", "execution_count": 10, "id": "1acd8888", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T02:14:56.369222Z", "start_time": "2024-04-11T02:14:56.361685Z" }, "collapsed": true }, "outputs": [ { "data": { "text/plain": [ "AnnData object with n_obs × n_vars = 2238 × 12912\n", " obs: 'in_tissue', 'array_row', 'array_col', 'sample', 'n_genes_by_counts', 'log1p_n_genes_by_counts', 'total_counts', 'log1p_total_counts', 'pct_counts_in_top_50_genes', 'pct_counts_in_top_100_genes', 'pct_counts_in_top_200_genes', 'pct_counts_in_top_500_genes', 'mt_frac', 'Perichondrium', 'Weird_morphology', 'Cartilage', 'Glands', 'Tissue', 'Multilayer_epithelium', 'Nerve', 'Venous_vessel', 'Airway_Smooth_Muscle', 'Arterial_vessel', 'Parenchyma', 'Pulmonary_vessel', 'Mesothelium', 'Small_airway', 'iBALT', '_indices', '_scvi_batch', '_scvi_labels', 'cell_type', 'total_counts_mt', 'log1p_total_counts_mt', 'pct_counts_mt'\n", " var: 'feature_types', 'genome', 'SYMBOL', 'mt', 'n_cells_by_counts-WSA_LngSP10193345', 'mean_counts-WSA_LngSP10193345', 'log1p_mean_counts-WSA_LngSP10193345', 'pct_dropout_by_counts-WSA_LngSP10193345', 'total_counts-WSA_LngSP10193345', 'log1p_total_counts-WSA_LngSP10193345', 'n_cells_by_counts-WSA_LngSP10193346', 'mean_counts-WSA_LngSP10193346', 'log1p_mean_counts-WSA_LngSP10193346', 'pct_dropout_by_counts-WSA_LngSP10193346', 'total_counts-WSA_LngSP10193346', 'log1p_total_counts-WSA_LngSP10193346', 'n_cells_by_counts-WSA_LngSP10193347', 'mean_counts-WSA_LngSP10193347', 'log1p_mean_counts-WSA_LngSP10193347', 'pct_dropout_by_counts-WSA_LngSP10193347', 'total_counts-WSA_LngSP10193347', 'log1p_total_counts-WSA_LngSP10193347', 'n_cells_by_counts-WSA_LngSP10193348', 'mean_counts-WSA_LngSP10193348', 'log1p_mean_counts-WSA_LngSP10193348', 'pct_dropout_by_counts-WSA_LngSP10193348', 'total_counts-WSA_LngSP10193348', 'log1p_total_counts-WSA_LngSP10193348', 'n_cells_by_counts-WSA_LngSP8759311', 'mean_counts-WSA_LngSP8759311', 'log1p_mean_counts-WSA_LngSP8759311', 'pct_dropout_by_counts-WSA_LngSP8759311', 'total_counts-WSA_LngSP8759311', 'log1p_total_counts-WSA_LngSP8759311', 'n_cells_by_counts-WSA_LngSP8759312', 'mean_counts-WSA_LngSP8759312', 'log1p_mean_counts-WSA_LngSP8759312', 'pct_dropout_by_counts-WSA_LngSP8759312', 'total_counts-WSA_LngSP8759312', 'log1p_total_counts-WSA_LngSP8759312', 'n_cells_by_counts-WSA_LngSP8759313', 'mean_counts-WSA_LngSP8759313', 'log1p_mean_counts-WSA_LngSP8759313', 'pct_dropout_by_counts-WSA_LngSP8759313', 'total_counts-WSA_LngSP8759313', 'log1p_total_counts-WSA_LngSP8759313', 'n_cells_by_counts-WSA_LngSP9258463', 'mean_counts-WSA_LngSP9258463', 'log1p_mean_counts-WSA_LngSP9258463', 'pct_dropout_by_counts-WSA_LngSP9258463', 'total_counts-WSA_LngSP9258463', 'log1p_total_counts-WSA_LngSP9258463', 'n_cells_by_counts-WSA_LngSP9258464', 'mean_counts-WSA_LngSP9258464', 'log1p_mean_counts-WSA_LngSP9258464', 'pct_dropout_by_counts-WSA_LngSP9258464', 'total_counts-WSA_LngSP9258464', 'log1p_total_counts-WSA_LngSP9258464', 'n_cells_by_counts-WSA_LngSP9258467', 'mean_counts-WSA_LngSP9258467', 'log1p_mean_counts-WSA_LngSP9258467', 'pct_dropout_by_counts-WSA_LngSP9258467', 'total_counts-WSA_LngSP9258467', 'log1p_total_counts-WSA_LngSP9258467', 'n_cells_by_counts-WSA_LngSP9258468', 'mean_counts-WSA_LngSP9258468', 'log1p_mean_counts-WSA_LngSP9258468', 'pct_dropout_by_counts-WSA_LngSP9258468', 'total_counts-WSA_LngSP9258468', 'log1p_total_counts-WSA_LngSP9258468', 'n_cells_by_counts', 'mean_counts', 'log1p_mean_counts', 'pct_dropout_by_counts', 'total_counts', 'log1p_total_counts'\n", " uns: '_scvi_manager_uuid', '_scvi_uuid', 'cell_type_colors', 'log1p', 'mod', 'spatial', 'radius', 'LR_pair_information', 'LR_gene_complex_information', 'LR_gene_complex_exp', 'LR_close_gene', 'LR_close_gene_exp', 'LR_cell_weight', 'Cell_neighbors', 'scenic_res', 'cell_type_list', 'LR_celltype_weight', 'LR_celltype_mean_weight', 'LR_celltype_edge_num', 'LR_celltype_aggregate_weight', 'LR_pathway_celltype_weight', 'LR_pathway_celltype_mean_weight', 'LR_pathway_celltype_edge_num', 'LR_pathway_celltype_count', 'LR_pathway_cell_weight', 'data_for_LRI'\n", " obsm: 'means_cell_abundance_w_sf', 'q05_cell_abundance_w_sf', 'q95_cell_abundance_w_sf', 'spatial', 'stds_cell_abundance_w_sf', 'distances'" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "adata_sp311_stringent" ] }, { "cell_type": "code", "execution_count": 39, "id": "e9980928", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:56:58.551101Z", "start_time": "2024-04-11T05:56:58.515690Z" } }, "outputs": [], "source": [ "## Read the CCC score of a ligand receptor pair at the cell/spot level\n", "LRP_CellLevel_CCCscore = pd.DataFrame(adata_sp311_stringent.uns['LR_cell_weight']['IL6|COMPLEX:IL6R_IL6ST'].toarray(),\n", " index=adata_sp311_stringent.obs.index, columns=adata_sp311_stringent.obs.index\n", " )" ] }, { "cell_type": "code", "execution_count": 40, "id": "a7637a4a", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:56:58.850516Z", "start_time": "2024-04-11T05:56:58.795645Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
spot_idWSA_LngSP8759311_AAACAAGTATCTCCCA-1WSA_LngSP8759311_AAACAGAGCGACTCCT-1WSA_LngSP8759311_AAACATTTCCCGGATT-1WSA_LngSP8759311_AAACCCGAACGAAATC-1WSA_LngSP8759311_AAACCGTTCGTCCAGG-1WSA_LngSP8759311_AAACCTAAGCAGCCGG-1WSA_LngSP8759311_AAACGAAGAACATACC-1WSA_LngSP8759311_AAACGAGACGGTTGAT-1WSA_LngSP8759311_AAACGGGCGTACGGGT-1WSA_LngSP8759311_AAACGGTTGCGAACTG-1
spot_id
WSA_LngSP8759311_AAACAAGTATCTCCCA-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACAGAGCGACTCCT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACATTTCCCGGATT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACCCGAACGAAATC-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACCGTTCGTCCAGG-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACCTAAGCAGCCGG-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGAAGAACATACC-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGAGACGGTTGAT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGGGCGTACGGGT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGGTTGCGAACTG-10.00.00.00.00.00.00.00.00.00.0
\n", "
" ], "text/plain": [ "spot_id WSA_LngSP8759311_AAACAAGTATCTCCCA-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACAGAGCGACTCCT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACATTTCCCGGATT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACCCGAACGAAATC-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGAAGAACATACC-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGAGACGGTTGAT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGGGCGTACGGGT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGGTTGCGAACTG-1 \n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 " ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LRP_CellLevel_CCCscore.iloc[:10,:10]" ] }, { "cell_type": "code", "execution_count": 41, "id": "79f6ab51", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:56:59.184785Z", "start_time": "2024-04-11T05:56:59.179903Z" } }, "outputs": [], "source": [ "## Read the sum CCC score of a ligand receptor pair at the cell type level\n", "LRP_CellTypeLevel_weight = pd.DataFrame(adata_sp311_stringent.uns['LR_celltype_weight']['IL6|COMPLEX:IL6R_IL6ST'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )" ] }, { "cell_type": "code", "execution_count": 42, "id": "95a3e2c7", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:56:59.670465Z", "start_time": "2024-04-11T05:56:59.622826Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
OthersArterial_vesselVenous_vesselGlandsCartilageMultilayer_epitheliumNerveAirway_Smooth_MusclePerichondriumWeird_morphology
Others44.8953011.8343485.81007810.1255693.6983771.4656923.8541004.7646542.22301713.828947
Arterial_vessel1.0392872.2376690.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000
Venous_vessel0.0000000.0000003.9089230.0000000.0000000.0000000.0000000.0000000.0000000.673586
Glands1.4173030.0000000.0000008.0184590.0000000.0000000.0000000.4223280.0000000.000000
Cartilage2.7223220.0000000.0000000.2660715.0555460.0000000.0000000.0000000.7078600.000000
Multilayer_epithelium0.5039300.0000000.0000000.0000000.0000004.1776910.0000000.0000000.0000000.000000
Nerve1.2575320.0000000.0000000.4237340.0000000.0000004.9015930.0000000.0000000.538051
Airway_Smooth_Muscle4.2008980.0000000.0000000.0000000.0000002.9728510.0000006.9193690.0000000.000000
Perichondrium2.4330860.0000000.0000000.0000001.1913740.0000000.0000000.0000003.0546770.000000
Weird_morphology12.4037920.0000000.0000002.6040880.0000000.0000002.7245910.3991740.00000021.088744
\n", "
" ], "text/plain": [ " Others Arterial_vessel Venous_vessel Glands \\\n", "Others 44.895301 1.834348 5.810078 10.125569 \n", "Arterial_vessel 1.039287 2.237669 0.000000 0.000000 \n", "Venous_vessel 0.000000 0.000000 3.908923 0.000000 \n", "Glands 1.417303 0.000000 0.000000 8.018459 \n", "Cartilage 2.722322 0.000000 0.000000 0.266071 \n", "Multilayer_epithelium 0.503930 0.000000 0.000000 0.000000 \n", "Nerve 1.257532 0.000000 0.000000 0.423734 \n", "Airway_Smooth_Muscle 4.200898 0.000000 0.000000 0.000000 \n", "Perichondrium 2.433086 0.000000 0.000000 0.000000 \n", "Weird_morphology 12.403792 0.000000 0.000000 2.604088 \n", "\n", " Cartilage Multilayer_epithelium Nerve \\\n", "Others 3.698377 1.465692 3.854100 \n", "Arterial_vessel 0.000000 0.000000 0.000000 \n", "Venous_vessel 0.000000 0.000000 0.000000 \n", "Glands 0.000000 0.000000 0.000000 \n", "Cartilage 5.055546 0.000000 0.000000 \n", "Multilayer_epithelium 0.000000 4.177691 0.000000 \n", "Nerve 0.000000 0.000000 4.901593 \n", "Airway_Smooth_Muscle 0.000000 2.972851 0.000000 \n", "Perichondrium 1.191374 0.000000 0.000000 \n", "Weird_morphology 0.000000 0.000000 2.724591 \n", "\n", " Airway_Smooth_Muscle Perichondrium Weird_morphology \n", "Others 4.764654 2.223017 13.828947 \n", "Arterial_vessel 0.000000 0.000000 0.000000 \n", "Venous_vessel 0.000000 0.000000 0.673586 \n", "Glands 0.422328 0.000000 0.000000 \n", "Cartilage 0.000000 0.707860 0.000000 \n", "Multilayer_epithelium 0.000000 0.000000 0.000000 \n", "Nerve 0.000000 0.000000 0.538051 \n", "Airway_Smooth_Muscle 6.919369 0.000000 0.000000 \n", "Perichondrium 0.000000 3.054677 0.000000 \n", "Weird_morphology 0.399174 0.000000 21.088744 " ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LRP_CellTypeLevel_weight" ] }, { "cell_type": "code", "execution_count": 43, "id": "a3d23412", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:00.164524Z", "start_time": "2024-04-11T05:57:00.160393Z" } }, "outputs": [], "source": [ "## Read the average interaction score for each interaction edge of a ligand receptor pair at the cell type level\n", "LRP_CellTypeLevel_mean_weight = pd.DataFrame(adata_sp311_stringent.uns['LR_celltype_mean_weight']['IL6|COMPLEX:IL6R_IL6ST'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )" ] }, { "cell_type": "code", "execution_count": 44, "id": "9adfbf89", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:00.786104Z", "start_time": "2024-04-11T05:57:00.770835Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
OthersArterial_vesselVenous_vesselGlandsCartilageMultilayer_epitheliumNerveAirway_Smooth_MusclePerichondriumWeird_morphology
Others0.7740570.4585870.8300110.5625320.9245940.7328460.7708200.6806650.7410060.813467
Arterial_vessel0.5196430.4475340.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000
Venous_vessel0.0000000.0000000.7817850.0000000.0000000.0000000.0000000.0000000.0000000.673586
Glands0.3543260.0000000.0000000.4009230.0000000.0000000.0000000.4223280.0000000.000000
Cartilage0.5444640.0000000.0000000.2660710.5617270.0000000.0000000.0000000.7078600.000000
Multilayer_epithelium0.5039300.0000000.0000000.0000000.0000000.6962820.0000000.0000000.0000000.000000
Nerve0.4191770.0000000.0000000.4237340.0000000.0000000.9803190.0000000.0000000.538051
Airway_Smooth_Muscle0.7001500.0000000.0000000.0000000.0000000.3716060.0000000.8649210.0000000.000000
Perichondrium1.2165430.0000000.0000000.0000000.3971250.0000000.0000000.0000001.0182260.000000
Weird_morphology0.7296350.0000000.0000000.8680290.0000000.0000000.9081970.3991740.0000000.753169
\n", "
" ], "text/plain": [ " Others Arterial_vessel Venous_vessel Glands \\\n", "Others 0.774057 0.458587 0.830011 0.562532 \n", "Arterial_vessel 0.519643 0.447534 0.000000 0.000000 \n", "Venous_vessel 0.000000 0.000000 0.781785 0.000000 \n", "Glands 0.354326 0.000000 0.000000 0.400923 \n", "Cartilage 0.544464 0.000000 0.000000 0.266071 \n", "Multilayer_epithelium 0.503930 0.000000 0.000000 0.000000 \n", "Nerve 0.419177 0.000000 0.000000 0.423734 \n", "Airway_Smooth_Muscle 0.700150 0.000000 0.000000 0.000000 \n", "Perichondrium 1.216543 0.000000 0.000000 0.000000 \n", "Weird_morphology 0.729635 0.000000 0.000000 0.868029 \n", "\n", " Cartilage Multilayer_epithelium Nerve \\\n", "Others 0.924594 0.732846 0.770820 \n", "Arterial_vessel 0.000000 0.000000 0.000000 \n", "Venous_vessel 0.000000 0.000000 0.000000 \n", "Glands 0.000000 0.000000 0.000000 \n", "Cartilage 0.561727 0.000000 0.000000 \n", "Multilayer_epithelium 0.000000 0.696282 0.000000 \n", "Nerve 0.000000 0.000000 0.980319 \n", "Airway_Smooth_Muscle 0.000000 0.371606 0.000000 \n", "Perichondrium 0.397125 0.000000 0.000000 \n", "Weird_morphology 0.000000 0.000000 0.908197 \n", "\n", " Airway_Smooth_Muscle Perichondrium Weird_morphology \n", "Others 0.680665 0.741006 0.813467 \n", "Arterial_vessel 0.000000 0.000000 0.000000 \n", "Venous_vessel 0.000000 0.000000 0.673586 \n", "Glands 0.422328 0.000000 0.000000 \n", "Cartilage 0.000000 0.707860 0.000000 \n", "Multilayer_epithelium 0.000000 0.000000 0.000000 \n", "Nerve 0.000000 0.000000 0.538051 \n", "Airway_Smooth_Muscle 0.864921 0.000000 0.000000 \n", "Perichondrium 0.000000 1.018226 0.000000 \n", "Weird_morphology 0.399174 0.000000 0.753169 " ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LRP_CellTypeLevel_mean_weight" ] }, { "cell_type": "code", "execution_count": 45, "id": "02ed1e77", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:01.279176Z", "start_time": "2024-04-11T05:57:01.274940Z" } }, "outputs": [], "source": [ "## Read the sum interaction edge number of a ligand receptor pair at the cell type level\n", "LRP_CellTypeLevel_edge_num = pd.DataFrame(adata_sp311_stringent.uns['LR_celltype_edge_num']['IL6|COMPLEX:IL6R_IL6ST'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )" ] }, { "cell_type": "code", "execution_count": 46, "id": "8f55556e", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:01.731667Z", "start_time": "2024-04-11T05:57:01.689298Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
OthersArterial_vesselVenous_vesselGlandsCartilageMultilayer_epitheliumNerveAirway_Smooth_MusclePerichondriumWeird_morphology
Others58.04.07.018.04.02.05.07.03.017.0
Arterial_vessel2.05.00.00.00.00.00.00.00.00.0
Venous_vessel0.00.05.00.00.00.00.00.00.01.0
Glands4.00.00.020.00.00.00.01.00.00.0
Cartilage5.00.00.01.09.00.00.00.01.00.0
Multilayer_epithelium1.00.00.00.00.06.00.00.00.00.0
Nerve3.00.00.01.00.00.05.00.00.01.0
Airway_Smooth_Muscle6.00.00.00.00.08.00.08.00.00.0
Perichondrium2.00.00.00.03.00.00.00.03.00.0
Weird_morphology17.00.00.03.00.00.03.01.00.028.0
\n", "
" ], "text/plain": [ " Others Arterial_vessel Venous_vessel Glands \\\n", "Others 58.0 4.0 7.0 18.0 \n", "Arterial_vessel 2.0 5.0 0.0 0.0 \n", "Venous_vessel 0.0 0.0 5.0 0.0 \n", "Glands 4.0 0.0 0.0 20.0 \n", "Cartilage 5.0 0.0 0.0 1.0 \n", "Multilayer_epithelium 1.0 0.0 0.0 0.0 \n", "Nerve 3.0 0.0 0.0 1.0 \n", "Airway_Smooth_Muscle 6.0 0.0 0.0 0.0 \n", "Perichondrium 2.0 0.0 0.0 0.0 \n", "Weird_morphology 17.0 0.0 0.0 3.0 \n", "\n", " Cartilage Multilayer_epithelium Nerve \\\n", "Others 4.0 2.0 5.0 \n", "Arterial_vessel 0.0 0.0 0.0 \n", "Venous_vessel 0.0 0.0 0.0 \n", "Glands 0.0 0.0 0.0 \n", "Cartilage 9.0 0.0 0.0 \n", "Multilayer_epithelium 0.0 6.0 0.0 \n", "Nerve 0.0 0.0 5.0 \n", "Airway_Smooth_Muscle 0.0 8.0 0.0 \n", "Perichondrium 3.0 0.0 0.0 \n", "Weird_morphology 0.0 0.0 3.0 \n", "\n", " Airway_Smooth_Muscle Perichondrium Weird_morphology \n", "Others 7.0 3.0 17.0 \n", "Arterial_vessel 0.0 0.0 0.0 \n", "Venous_vessel 0.0 0.0 1.0 \n", "Glands 1.0 0.0 0.0 \n", "Cartilage 0.0 1.0 0.0 \n", "Multilayer_epithelium 0.0 0.0 0.0 \n", "Nerve 0.0 0.0 1.0 \n", "Airway_Smooth_Muscle 8.0 0.0 0.0 \n", "Perichondrium 0.0 3.0 0.0 \n", "Weird_morphology 1.0 0.0 28.0 " ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LRP_CellTypeLevel_edge_num" ] }, { "cell_type": "code", "execution_count": 47, "id": "0171b6f3", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:02.784671Z", "start_time": "2024-04-11T05:57:02.780233Z" } }, "outputs": [], "source": [ "## Read the number of LRPs that occur between cell types\n", "LRP_number_CellTypeLevel = pd.DataFrame(adata_sp311_stringent.uns['LR_celltype_aggregate_weight']['count'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )" ] }, { "cell_type": "code", "execution_count": 48, "id": "27f8c01e", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:03.532467Z", "start_time": "2024-04-11T05:57:03.498784Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
OthersArterial_vesselVenous_vesselGlandsCartilageMultilayer_epitheliumNerveAirway_Smooth_MusclePerichondriumWeird_morphology
Others1025.0563.0313.0875.0413.0768.0487.0770.0587.0598.0
Arterial_vessel540.0686.00.04.00.00.06.00.00.098.0
Venous_vessel290.00.0482.00.00.00.00.00.00.0159.0
Glands895.04.00.01007.037.0130.0177.0384.0370.0277.0
Cartilage411.00.00.080.0839.00.022.00.0491.038.0
Multilayer_epithelium805.00.00.0116.00.0880.00.0707.02.03.0
Nerve476.018.07.0157.018.00.0567.00.013.0323.0
Airway_Smooth_Muscle768.00.00.0335.00.0646.00.0861.00.073.0
Perichondrium629.00.00.0380.0481.010.032.00.0720.092.0
Weird_morphology636.0197.0191.0305.043.03.0321.0126.0114.0664.0
\n", "
" ], "text/plain": [ " Others Arterial_vessel Venous_vessel Glands \\\n", "Others 1025.0 563.0 313.0 875.0 \n", "Arterial_vessel 540.0 686.0 0.0 4.0 \n", "Venous_vessel 290.0 0.0 482.0 0.0 \n", "Glands 895.0 4.0 0.0 1007.0 \n", "Cartilage 411.0 0.0 0.0 80.0 \n", "Multilayer_epithelium 805.0 0.0 0.0 116.0 \n", "Nerve 476.0 18.0 7.0 157.0 \n", "Airway_Smooth_Muscle 768.0 0.0 0.0 335.0 \n", "Perichondrium 629.0 0.0 0.0 380.0 \n", "Weird_morphology 636.0 197.0 191.0 305.0 \n", "\n", " Cartilage Multilayer_epithelium Nerve \\\n", "Others 413.0 768.0 487.0 \n", "Arterial_vessel 0.0 0.0 6.0 \n", "Venous_vessel 0.0 0.0 0.0 \n", "Glands 37.0 130.0 177.0 \n", "Cartilage 839.0 0.0 22.0 \n", "Multilayer_epithelium 0.0 880.0 0.0 \n", "Nerve 18.0 0.0 567.0 \n", "Airway_Smooth_Muscle 0.0 646.0 0.0 \n", "Perichondrium 481.0 10.0 32.0 \n", "Weird_morphology 43.0 3.0 321.0 \n", "\n", " Airway_Smooth_Muscle Perichondrium Weird_morphology \n", "Others 770.0 587.0 598.0 \n", "Arterial_vessel 0.0 0.0 98.0 \n", "Venous_vessel 0.0 0.0 159.0 \n", "Glands 384.0 370.0 277.0 \n", "Cartilage 0.0 491.0 38.0 \n", "Multilayer_epithelium 707.0 2.0 3.0 \n", "Nerve 0.0 13.0 323.0 \n", "Airway_Smooth_Muscle 861.0 0.0 73.0 \n", "Perichondrium 0.0 720.0 92.0 \n", "Weird_morphology 126.0 114.0 664.0 " ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LRP_number_CellTypeLevel" ] }, { "cell_type": "code", "execution_count": 49, "id": "a541f3e5", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:04.167691Z", "start_time": "2024-04-11T05:57:04.139439Z" } }, "outputs": [], "source": [ "## Read the CCC score of a pathway at the cell/spot level\n", "Pathway_CellLevel_CCCscore = pd.DataFrame(adata_sp311_stringent.uns['LR_pathway_cell_weight']['CCL'].toarray(),\n", " index=adata_sp311_stringent.obs.index, columns=adata_sp311_stringent.obs.index\n", " )" ] }, { "cell_type": "code", "execution_count": 51, "id": "1cb39076", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:25.223284Z", "start_time": "2024-04-11T05:57:25.175201Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
spot_idWSA_LngSP8759311_AAACAAGTATCTCCCA-1WSA_LngSP8759311_AAACAGAGCGACTCCT-1WSA_LngSP8759311_AAACATTTCCCGGATT-1WSA_LngSP8759311_AAACCCGAACGAAATC-1WSA_LngSP8759311_AAACCGTTCGTCCAGG-1WSA_LngSP8759311_AAACCTAAGCAGCCGG-1WSA_LngSP8759311_AAACGAAGAACATACC-1WSA_LngSP8759311_AAACGAGACGGTTGAT-1WSA_LngSP8759311_AAACGGGCGTACGGGT-1WSA_LngSP8759311_AAACGGTTGCGAACTG-1
spot_id
WSA_LngSP8759311_AAACAAGTATCTCCCA-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACAGAGCGACTCCT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACATTTCCCGGATT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACCCGAACGAAATC-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACCGTTCGTCCAGG-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACCTAAGCAGCCGG-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGAAGAACATACC-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGAGACGGTTGAT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGGGCGTACGGGT-10.00.00.00.00.00.00.00.00.00.0
WSA_LngSP8759311_AAACGGTTGCGAACTG-10.00.00.00.00.00.00.00.00.00.0
\n", "
" ], "text/plain": [ "spot_id WSA_LngSP8759311_AAACAAGTATCTCCCA-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACAGAGCGACTCCT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACATTTCCCGGATT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACCCGAACGAAATC-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGAAGAACATACC-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGAGACGGTTGAT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGGGCGTACGGGT-1 \\\n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 \n", "\n", "spot_id WSA_LngSP8759311_AAACGGTTGCGAACTG-1 \n", "spot_id \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 \n", "WSA_LngSP8759311_AAACCTAAGCAGCCGG-1 0.0 \n", "WSA_LngSP8759311_AAACGAAGAACATACC-1 0.0 \n", "WSA_LngSP8759311_AAACGAGACGGTTGAT-1 0.0 \n", "WSA_LngSP8759311_AAACGGGCGTACGGGT-1 0.0 \n", "WSA_LngSP8759311_AAACGGTTGCGAACTG-1 0.0 " ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Pathway_CellLevel_CCCscore.iloc[:10,:10]" ] }, { "cell_type": "code", "execution_count": 33, "id": "7a8a4e80", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T02:45:25.233196Z", "start_time": "2024-04-11T02:45:25.226359Z" } }, "outputs": [], "source": [ "## Read the CCC score of a pathway at the cell type level\n", "Pathway_CellTypeLevel_wight = pd.DataFrame(adata_sp311_stringent.uns['LR_pathway_celltype_weight']['CCL'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )\n", "Pathway_CellTypeLevel_mean_weight = pd.DataFrame(adata_sp311_stringent.uns['LR_pathway_celltype_mean_weight']['CCL'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )\n", "Pathway_CellTypeLevel_edge_num = pd.DataFrame(adata_sp311_stringent.uns['LR_pathway_celltype_edge_num']['CCL'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )\n", "Pathway_CellTypeLevel_count = pd.DataFrame(adata_sp311_stringent.uns['LR_pathway_celltype_count']['CCL'],\n", " index=adata_sp311_stringent.uns['cell_type_list'], columns=adata_sp311_stringent.uns['cell_type_list']\n", " )" ] }, { "cell_type": "code", "execution_count": 35, "id": "f0c573ee", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T02:46:20.179100Z", "start_time": "2024-04-11T02:46:20.175133Z" } }, "outputs": [], "source": [ "## Read all Scenic result\n", "Scenic_result = adata_sp311_stringent.uns['scenic_res']" ] }, { "cell_type": "code", "execution_count": 54, "id": "95e6feec", "metadata": { "ExecuteTime": { "end_time": "2024-04-11T05:57:45.268624Z", "start_time": "2024-04-11T05:57:45.245568Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RegulonATF2(+)ATF4(+)ATF5(+)CEBPB(+)CLOCK(+)DLX5(+)E2F1(+)E2F3(+)E2F4(+)EGR1(+)...THRA(+)THRB(+)TP53(+)TWIST1(+)XBP1(+)ZFHX3(+)ZNF398(+)ZNF430(+)ZNF587(+)ZNF611(+)
Cell
WSA_LngSP8759311_AAACAAGTATCTCCCA-10.1083280.0934270.0694330.0122420.0111660.00.0149570.0298830.0080860.017228...0.0092100.0146430.0114870.0738020.0369050.0061950.0854180.00.00.000000
WSA_LngSP8759311_AAACAGAGCGACTCCT-10.0000000.0745480.0062700.0218190.0112460.00.0204780.0038400.0106710.025917...0.0049470.0615230.0311920.0299920.0430800.0343130.0344270.00.00.038396
WSA_LngSP8759311_AAACATTTCCCGGATT-10.0000000.1006030.0256350.0451860.0098830.00.0170170.0004730.0069030.031353...0.0310140.0000000.0090680.0111240.0930360.0066810.0379720.00.00.000000
WSA_LngSP8759311_AAACCCGAACGAAATC-10.0018600.1244580.0188830.0630180.0233820.00.0262900.0068720.0124620.024987...0.0127210.0000000.0358570.0456220.0349190.0446880.0520100.00.00.000000
WSA_LngSP8759311_AAACCGTTCGTCCAGG-10.0000000.1424540.0000000.0114170.0286320.00.0152080.0250630.0060360.022820...0.0173190.0000000.0124710.0070400.0387790.0240190.0631900.00.00.000000
\n", "

5 rows × 102 columns

\n", "
" ], "text/plain": [ "Regulon ATF2(+) ATF4(+) ATF5(+) CEBPB(+) \\\n", "Cell \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.108328 0.093427 0.069433 0.012242 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.000000 0.074548 0.006270 0.021819 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.000000 0.100603 0.025635 0.045186 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.001860 0.124458 0.018883 0.063018 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.000000 0.142454 0.000000 0.011417 \n", "\n", "Regulon CLOCK(+) DLX5(+) E2F1(+) E2F3(+) \\\n", "Cell \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.011166 0.0 0.014957 0.029883 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.011246 0.0 0.020478 0.003840 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.009883 0.0 0.017017 0.000473 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.023382 0.0 0.026290 0.006872 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.028632 0.0 0.015208 0.025063 \n", "\n", "Regulon E2F4(+) EGR1(+) ... THRA(+) \\\n", "Cell ... \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.008086 0.017228 ... 0.009210 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.010671 0.025917 ... 0.004947 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.006903 0.031353 ... 0.031014 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.012462 0.024987 ... 0.012721 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.006036 0.022820 ... 0.017319 \n", "\n", "Regulon THRB(+) TP53(+) TWIST1(+) XBP1(+) \\\n", "Cell \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.014643 0.011487 0.073802 0.036905 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.061523 0.031192 0.029992 0.043080 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.000000 0.009068 0.011124 0.093036 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.000000 0.035857 0.045622 0.034919 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.000000 0.012471 0.007040 0.038779 \n", "\n", "Regulon ZFHX3(+) ZNF398(+) ZNF430(+) \\\n", "Cell \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.006195 0.085418 0.0 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.034313 0.034427 0.0 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.006681 0.037972 0.0 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.044688 0.052010 0.0 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.024019 0.063190 0.0 \n", "\n", "Regulon ZNF587(+) ZNF611(+) \n", "Cell \n", "WSA_LngSP8759311_AAACAAGTATCTCCCA-1 0.0 0.000000 \n", "WSA_LngSP8759311_AAACAGAGCGACTCCT-1 0.0 0.038396 \n", "WSA_LngSP8759311_AAACATTTCCCGGATT-1 0.0 0.000000 \n", "WSA_LngSP8759311_AAACCCGAACGAAATC-1 0.0 0.000000 \n", "WSA_LngSP8759311_AAACCGTTCGTCCAGG-1 0.0 0.000000 \n", "\n", "[5 rows x 102 columns]" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Scenic_result['auc_mtx'].head()" ] }, { "cell_type": "code", "execution_count": null, "id": "39145a36", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "stcase_tmp1", "language": "python", "name": "stcase_tmp1" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.14" } }, "nbformat": 4, "nbformat_minor": 5 }