{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip3 install scanpy[leiden] opentsne scikit-misc","metadata":{"id":"BXFep4E1kXUx","outputId":"ceb49acc-f786-45f1-afcb-ca9a7139cbc8","execution":{"iopub.status.busy":"2023-01-29T17:01:33.992160Z","iopub.execute_input":"2023-01-29T17:01:33.992551Z","iopub.status.idle":"2023-01-29T17:01:46.748833Z","shell.execute_reply.started":"2023-01-29T17:01:33.992463Z","shell.execute_reply":"2023-01-29T17:01:46.747562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nimport sys","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","id":"ydBe6telkXU8","execution":{"iopub.status.busy":"2023-01-29T17:01:46.750863Z","iopub.execute_input":"2023-01-29T17:01:46.751205Z","iopub.status.idle":"2023-01-29T17:01:46.756600Z","shell.execute_reply.started":"2023-01-29T17:01:46.751174Z","shell.execute_reply":"2023-01-29T17:01:46.755407Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"DATA_DIR_RAW = \"/kaggle/input/msci-raw-counts-anndata\"\n# Cite\nFP_CITE_RAW_TRAIN_INPUTS = os.path.join(DATA_DIR_RAW,\"train_cite_inputs_raw.ann.h5\")\nFP_CITE_RAW_TRAIN_TARGETS = os.path.join(DATA_DIR_RAW,\"train_cite_targets_raw.ann.h5\")\nFP_CITE_RAW_TEST_INPUTS = os.path.join(DATA_DIR_RAW,\"test_cite_inputs_raw.ann.h5\")","metadata":{"id":"qIiAE2DGkXVO","execution":{"iopub.status.busy":"2023-01-29T17:01:46.758602Z","iopub.execute_input":"2023-01-29T17:01:46.759128Z","iopub.status.idle":"2023-01-29T17:01:46.768819Z","shell.execute_reply.started":"2023-01-29T17:01:46.759083Z","shell.execute_reply":"2023-01-29T17:01:46.767756Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import gc\n\nimport anndata as ad\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as stats\nimport seaborn as sns\nimport scanpy as sc\nfrom collections import OrderedDict\n\nfrom openTSNE import TSNE\n\nsc.settings.verbosity = 3\nsc.set_figure_params(dpi=150)\nsns.set_style(\"ticks\")","metadata":{"id":"jyPoXS6rkXVQ","execution":{"iopub.status.busy":"2023-01-29T17:18:45.288680Z","iopub.execute_input":"2023-01-29T17:18:45.289183Z","iopub.status.idle":"2023-01-29T17:18:45.298060Z","shell.execute_reply.started":"2023-01-29T17:18:45.289146Z","shell.execute_reply":"2023-01-29T17:18:45.296807Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"metadata_fp = \"/kaggle/input/open-problems-multimodal/metadata.csv\"\nadd_metadata_fp = \"/kaggle/input/open-problems-multimodal/metadata_cite_day_2_donor_27678.csv\"\nmetadata = pd.read_csv(metadata_fp)\nadd_metadata = pd.read_csv(add_metadata_fp)\nmetadata = pd.concat([metadata, add_metadata])\nmetadata.set_index(\"cell_id\", inplace=True)\nmetadata.head()","metadata":{"id":"Ykg8qbKkkXVS","outputId":"46ccfa1e-efa8-4b6b-9720-952cecde0cd1","execution":{"iopub.status.busy":"2023-01-29T17:01:49.289946Z","iopub.execute_input":"2023-01-29T17:01:49.290369Z","iopub.status.idle":"2023-01-29T17:01:50.007959Z","shell.execute_reply.started":"2023-01-29T17:01:49.290309Z","shell.execute_reply":"2023-01-29T17:01:50.006781Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def annotate(adata: ad.AnnData, metadata: pd.DataFrame, f_donors: [str]):\n    adata.obs[\"cell_type\"] = metadata[\"cell_type\"][adata.obs_names]\n    adata.obs[\"day\"] = metadata[\"day\"][adata.obs_names].astype(str)\n    adata.obs[\"donor\"] = metadata[\"donor\"][adata.obs_names].astype(str)\n    adata.obs[\"gender\"] = \"m\"\n    adata.obs.loc[adata.obs[\"donor\"].isin(f_donors), \"gender\"] = \"f\"\n    adata.obs[\"n_genes_counts\"] = (adata.X > 0).sum(axis=1).A1\n    adata.obs[\"read_depth\"] = adata.X.sum(axis=1).A1","metadata":{"id":"zzjh4x-3kXV_","execution":{"iopub.status.busy":"2023-01-29T17:01:50.009485Z","iopub.execute_input":"2023-01-29T17:01:50.009885Z","iopub.status.idle":"2023-01-29T17:01:50.018141Z","shell.execute_reply.started":"2023-01-29T17:01:50.009850Z","shell.execute_reply":"2023-01-29T17:01:50.016818Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"N_top = 3000","metadata":{"id":"O1WX9_GikXWC","execution":{"iopub.status.busy":"2023-01-29T17:01:50.019875Z","iopub.execute_input":"2023-01-29T17:01:50.020313Z","iopub.status.idle":"2023-01-29T17:01:50.030155Z","shell.execute_reply.started":"2023-01-29T17:01:50.020270Z","shell.execute_reply":"2023-01-29T17:01:50.029280Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def save_hvgs(fp: str, hvgs: list):\n    with open(fp, \"w\") as f:\n        f.write(\"\\n\".join(hvgs))","metadata":{"id":"0gNfSUlUkXWC","execution":{"iopub.status.busy":"2023-01-29T17:01:50.031662Z","iopub.execute_input":"2023-01-29T17:01:50.032174Z","iopub.status.idle":"2023-01-29T17:01:50.046719Z","shell.execute_reply.started":"2023-01-29T17:01:50.032129Z","shell.execute_reply":"2023-01-29T17:01:50.045362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def load_hvgs(fp: str):\n    with open(fp, \"r\") as f:\n        return f.read.splitlines()","metadata":{"id":"WRObCp2ykXWD","execution":{"iopub.status.busy":"2023-01-29T17:01:50.048442Z","iopub.execute_input":"2023-01-29T17:01:50.048928Z","iopub.status.idle":"2023-01-29T17:01:50.062153Z","shell.execute_reply.started":"2023-01-29T17:01:50.048880Z","shell.execute_reply":"2023-01-29T17:01:50.060774Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# HVGs","metadata":{"id":"2fUtC2ZHkXWE"}},{"cell_type":"code","source":"cite_raw_train = sc.read_h5ad(FP_CITE_RAW_TRAIN_INPUTS)\ncite_raw_test = sc.read_h5ad(FP_CITE_RAW_TEST_INPUTS)\ncite_raw = ad.concat([cite_raw_train, cite_raw_test], merge=\"same\")\ndel cite_raw_train\ndel cite_raw_test\ngc.collect()\nannotate(cite_raw, metadata, f_donors = [\"13176\", ])\ncite_raw.layers[\"counts\"] = cite_raw.X.copy()\ncite_raw","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:01:50.063243Z","iopub.execute_input":"2023-01-29T17:01:50.063660Z","iopub.status.idle":"2023-01-29T17:02:51.342857Z","shell.execute_reply.started":"2023-01-29T17:01:50.063623Z","shell.execute_reply":"2023-01-29T17:02:51.341482Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.experimental.pp.highly_variable_genes(cite_raw, n_top_genes=3000, batch_key=\"donor\")\nsc.experimental.pp.normalize_pearson_residuals_pca(cite_raw)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:02:51.344532Z","iopub.execute_input":"2023-01-29T17:02:51.344950Z","iopub.status.idle":"2023-01-29T17:05:39.044746Z","shell.execute_reply.started":"2023-01-29T17:02:51.344912Z","shell.execute_reply":"2023-01-29T17:05:39.043631Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pl.pca(cite_raw, color=[\"cell_type\", \"donor\", \"day\", \"n_genes_counts\"])","metadata":{"id":"Y__lAaDhkXWV","outputId":"909ed3b3-1b5a-4ced-c125-0d8430553078","execution":{"iopub.status.busy":"2023-01-29T17:05:39.046159Z","iopub.execute_input":"2023-01-29T17:05:39.046543Z","iopub.status.idle":"2023-01-29T17:05:43.248850Z","shell.execute_reply.started":"2023-01-29T17:05:39.046509Z","shell.execute_reply":"2023-01-29T17:05:43.247800Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import gc\ngc.collect()","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:05:43.255282Z","iopub.execute_input":"2023-01-29T17:05:43.255759Z","iopub.status.idle":"2023-01-29T17:05:43.468608Z","shell.execute_reply.started":"2023-01-29T17:05:43.255690Z","shell.execute_reply":"2023-01-29T17:05:43.467196Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### color by proteins","metadata":{"id":"SF9PK5VrkXWZ"}},{"cell_type":"code","source":"cite_target = pd.read_hdf('/kaggle/input/open-problems-multimodal/train_cite_targets.h5')","metadata":{"id":"3QQuXFnvkXWa","execution":{"iopub.status.busy":"2023-01-29T17:05:43.471006Z","iopub.execute_input":"2023-01-29T17:05:43.472047Z","iopub.status.idle":"2023-01-29T17:05:44.325307Z","shell.execute_reply.started":"2023-01-29T17:05:43.471993Z","shell.execute_reply":"2023-01-29T17:05:44.323606Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cite_raw_w_target = cite_raw[cite_target.index].copy()\nprots_df = pd.DataFrame(cite_target, columns=cite_target.columns, index=cite_raw_w_target.obs.index)\nfor prot in prots_df.columns:\n    q5, q95 = np.quantile(prots_df.loc[:, prot], [0.05, 0.95])\n    prots_df.loc[:, prot][np.where(prots_df.loc[:, prot] < q5)[0]] = q5\n    prots_df.loc[:, prot][np.where(prots_df.loc[:, prot] > q95)[0]] = q95\n\ncite_raw_w_target.obs = pd.concat([cite_raw_w_target.obs, prots_df], axis=1)\n\ncite_raw_w_target.obs.head()","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:05:44.327674Z","iopub.execute_input":"2023-01-29T17:05:44.328275Z","iopub.status.idle":"2023-01-29T17:05:51.416589Z","shell.execute_reply.started":"2023-01-29T17:05:44.328226Z","shell.execute_reply":"2023-01-29T17:05:51.415055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import gc\ndel cite_raw\ngc.collect()","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:05:51.418237Z","iopub.execute_input":"2023-01-29T17:05:51.418655Z","iopub.status.idle":"2023-01-29T17:05:51.598958Z","shell.execute_reply.started":"2023-01-29T17:05:51.418617Z","shell.execute_reply":"2023-01-29T17:05:51.597838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"set1 = [\"CD26\", \"CD158\", \"FceRIa\", \"CD49d\", \"CD142\", \"CD162\", \"CD33\", \"CD38\", \"CD82\", \"CD32\"]\nset2 = [\"CD49b\", \"CD45RA\", \"CD13\", \"CD123\", \"CD95\", \"CD49f\", \"CD72\", \"CD62L\", \"CD112\", \"CD9\"]\nset3 = [\"CD142\", \"CD95\", \"CD58\", \"CD32\", \"CD45RO\", \"CD38\", \"CD82\", \"FceRIa\", \"CD155\", \"CD105\"]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:05:51.600501Z","iopub.execute_input":"2023-01-29T17:05:51.600919Z","iopub.status.idle":"2023-01-29T17:05:51.608724Z","shell.execute_reply.started":"2023-01-29T17:05:51.600882Z","shell.execute_reply":"2023-01-29T17:05:51.607477Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pl.pca(cite_raw_w_target, color=set1, size=20)\nsc.pl.pca(cite_raw_w_target, color=set2, size=20)\nsc.pl.pca(cite_raw_w_target, color=set3, size=20)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:05:51.610281Z","iopub.execute_input":"2023-01-29T17:05:51.610621Z","iopub.status.idle":"2023-01-29T17:06:14.093157Z","shell.execute_reply.started":"2023-01-29T17:05:51.610590Z","shell.execute_reply":"2023-01-29T17:06:14.091851Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pl.pca(cite_raw_w_target, color=\"CD38\", size=20)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:06:14.094690Z","iopub.execute_input":"2023-01-29T17:06:14.095103Z","iopub.status.idle":"2023-01-29T17:06:14.874675Z","shell.execute_reply.started":"2023-01-29T17:06:14.095069Z","shell.execute_reply":"2023-01-29T17:06:14.873311Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Correlation analysis","metadata":{}},{"cell_type":"code","source":"cite_raw_w_target_masp = cite_raw_w_target[cite_raw_w_target.obs[\"cell_type\"] == \"MasP\"].copy()\ncite_target_masp = cite_target.loc[cite_raw_w_target_masp.obs_names]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:25.585819Z","iopub.execute_input":"2023-01-29T17:32:25.586387Z","iopub.status.idle":"2023-01-29T17:32:27.348886Z","shell.execute_reply.started":"2023-01-29T17:32:25.586348Z","shell.execute_reply":"2023-01-29T17:32:27.347308Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cite_raw_w_target_masp.shape","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:27.352244Z","iopub.execute_input":"2023-01-29T17:32:27.352791Z","iopub.status.idle":"2023-01-29T17:32:27.360499Z","shell.execute_reply.started":"2023-01-29T17:32:27.352724Z","shell.execute_reply":"2023-01-29T17:32:27.359229Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pl.pca(cite_raw_w_target_masp, color=\"CD32\", size=20)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:27.362419Z","iopub.execute_input":"2023-01-29T17:32:27.363175Z","iopub.status.idle":"2023-01-29T17:32:27.831896Z","shell.execute_reply.started":"2023-01-29T17:32:27.363130Z","shell.execute_reply":"2023-01-29T17:32:27.830861Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# del cite_raw_w_target, cite_target\ngc.collect()\n","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:29.907200Z","iopub.execute_input":"2023-01-29T17:32:29.907627Z","iopub.status.idle":"2023-01-29T17:32:30.246389Z","shell.execute_reply.started":"2023-01-29T17:32:29.907592Z","shell.execute_reply":"2023-01-29T17:32:30.245281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pc1_w_target = cite_raw_w_target_masp.obsm[\"X_pca\"][:, 0]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:30.665838Z","iopub.execute_input":"2023-01-29T17:32:30.666280Z","iopub.status.idle":"2023-01-29T17:32:30.671944Z","shell.execute_reply.started":"2023-01-29T17:32:30.666244Z","shell.execute_reply":"2023-01-29T17:32:30.670955Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(pc1_w_target)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:31.882715Z","iopub.execute_input":"2023-01-29T17:32:31.883188Z","iopub.status.idle":"2023-01-29T17:32:32.377326Z","shell.execute_reply.started":"2023-01-29T17:32:31.883149Z","shell.execute_reply":"2023-01-29T17:32:32.376498Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cite_raw_w_target_masp.obs[\"PC1\"] = pc1_w_target\nsc.pl.pca(cite_raw_w_target_masp, color='PC1', frameon=False)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:32.903561Z","iopub.execute_input":"2023-01-29T17:32:32.904682Z","iopub.status.idle":"2023-01-29T17:32:33.267949Z","shell.execute_reply.started":"2023-01-29T17:32:32.904639Z","shell.execute_reply":"2023-01-29T17:32:33.266802Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#selected_cells = cite_raw_w_target_masp[np.where(pc1_w_target > 50)].obs_names","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:34.196398Z","iopub.execute_input":"2023-01-29T17:32:34.196946Z","iopub.status.idle":"2023-01-29T17:32:34.202588Z","shell.execute_reply.started":"2023-01-29T17:32:34.196901Z","shell.execute_reply":"2023-01-29T17:32:34.201078Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def calculate_corr(col):\n    return stats.spearmanr(pc1_w_target, col.T)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:35.059486Z","iopub.execute_input":"2023-01-29T17:32:35.061109Z","iopub.status.idle":"2023-01-29T17:32:35.066432Z","shell.execute_reply.started":"2023-01-29T17:32:35.061052Z","shell.execute_reply":"2023-01-29T17:32:35.065371Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def calculate_corr_prot(col):\n    return stats.spearmanr(pc1_w_target, col.T)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:35.926692Z","iopub.execute_input":"2023-01-29T17:32:35.927543Z","iopub.status.idle":"2023-01-29T17:32:35.932464Z","shell.execute_reply.started":"2023-01-29T17:32:35.927500Z","shell.execute_reply":"2023-01-29T17:32:35.931508Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"spearman_corr = np.apply_along_axis(calculate_corr, 0, cite_raw_w_target_masp.X.todense())","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:32:37.593853Z","iopub.execute_input":"2023-01-29T17:32:37.596464Z","iopub.status.idle":"2023-01-29T17:33:40.352682Z","shell.execute_reply.started":"2023-01-29T17:32:37.596414Z","shell.execute_reply":"2023-01-29T17:33:40.351417Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(spearman_corr[0, :])","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:34:01.765248Z","iopub.execute_input":"2023-01-29T17:34:01.766176Z","iopub.status.idle":"2023-01-29T17:34:02.595788Z","shell.execute_reply.started":"2023-01-29T17:34:01.766124Z","shell.execute_reply":"2023-01-29T17:34:02.594623Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gene_set_abs_corr_05 = cite_raw_w_target_masp.var_names[np.where((np.abs(spearman_corr[0]) > 0.45) & (spearman_corr[1] <= 0.01))]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:35:22.722762Z","iopub.execute_input":"2023-01-29T17:35:22.723218Z","iopub.status.idle":"2023-01-29T17:35:22.729507Z","shell.execute_reply.started":"2023-01-29T17:35:22.723184Z","shell.execute_reply":"2023-01-29T17:35:22.728378Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(gene_set_abs_corr_05)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:35:23.262794Z","iopub.execute_input":"2023-01-29T17:35:23.263821Z","iopub.status.idle":"2023-01-29T17:35:23.271491Z","shell.execute_reply.started":"2023-01-29T17:35:23.263771Z","shell.execute_reply":"2023-01-29T17:35:23.270247Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"spearman_corr_prot = np.apply_along_axis(calculate_corr_prot, 0, cite_target_masp.to_numpy())\nprot_set_abs_corr_05 = cite_target_masp.columns[np.where((np.abs(spearman_corr_prot[0]) > 0.1) & (spearman_corr_prot[1] <= 0.01))]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:35:25.342209Z","iopub.execute_input":"2023-01-29T17:35:25.342683Z","iopub.status.idle":"2023-01-29T17:35:25.734221Z","shell.execute_reply.started":"2023-01-29T17:35:25.342649Z","shell.execute_reply":"2023-01-29T17:35:25.732798Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(spearman_corr_prot[0])","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:36:03.347200Z","iopub.execute_input":"2023-01-29T17:36:03.348577Z","iopub.status.idle":"2023-01-29T17:36:03.828545Z","shell.execute_reply.started":"2023-01-29T17:36:03.348493Z","shell.execute_reply":"2023-01-29T17:36:03.827222Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#top_cor_cd = cite_target_masp.columns[np.argmax(np.abs(spearman_corr_prot))]\ntop_cor_cd = \"CD32\"","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:36:05.672994Z","iopub.execute_input":"2023-01-29T17:36:05.674376Z","iopub.status.idle":"2023-01-29T17:36:05.678405Z","shell.execute_reply.started":"2023-01-29T17:36:05.674322Z","shell.execute_reply":"2023-01-29T17:36:05.677485Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def calculate_corr_with_cd_prot(col):\n    return stats.spearmanr(cite_target_masp.loc[:, top_cor_cd].to_numpy(), col.T)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:36:07.243672Z","iopub.execute_input":"2023-01-29T17:36:07.244501Z","iopub.status.idle":"2023-01-29T17:36:07.250382Z","shell.execute_reply.started":"2023-01-29T17:36:07.244458Z","shell.execute_reply":"2023-01-29T17:36:07.249181Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def calculate_corr_with_cd_gene(col):\n    return stats.spearmanr(cite_target_masp.loc[:, top_cor_cd].to_numpy(), col.T)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:36:07.342636Z","iopub.execute_input":"2023-01-29T17:36:07.343878Z","iopub.status.idle":"2023-01-29T17:36:07.350741Z","shell.execute_reply.started":"2023-01-29T17:36:07.343812Z","shell.execute_reply":"2023-01-29T17:36:07.349359Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"spearman_corr_gene_with_cd = np.apply_along_axis(calculate_corr_with_cd_gene, 0, cite_raw_w_target_masp.X.todense())\nspearman_corr_prot_with_cd = np.apply_along_axis(calculate_corr_with_cd_prot, 0, cite_target_masp.to_numpy())","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:36:08.408653Z","iopub.execute_input":"2023-01-29T17:36:08.410159Z","iopub.status.idle":"2023-01-29T17:37:06.200336Z","shell.execute_reply.started":"2023-01-29T17:36:08.410064Z","shell.execute_reply":"2023-01-29T17:37:06.199245Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"spearman_corr_gene_with_cd_dict = {cite_raw_w_target_masp.var_names[i]: spearman_corr_gene_with_cd[:, i] for i, gene in enumerate(spearman_corr_gene_with_cd[0])}\nspearman_corr_prot_with_cd_dict = {cite_target_masp.columns[i]: spearman_corr_prot_with_cd[:, i] for i, gene in enumerate(spearman_corr_prot_with_cd[0])}\nspearman_corr_gene_dict = {cite_raw_w_target_masp.var_names[i]: spearman_corr[:, i] for i, gene in enumerate(spearman_corr[0])}\nspearman_corr_prot_dict = {cite_target_masp.columns[i]: spearman_corr_prot[:, i] for i, gene in enumerate(spearman_corr_prot[0])}","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:40:17.248794Z","iopub.execute_input":"2023-01-29T17:40:17.249287Z","iopub.status.idle":"2023-01-29T17:40:17.350559Z","shell.execute_reply.started":"2023-01-29T17:40:17.249250Z","shell.execute_reply":"2023-01-29T17:40:17.349468Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"spearman_corr_gene_with_cd_dict_sorted = OrderedDict({k: v for k, v in sorted(spearman_corr_gene_with_cd_dict.items(), key=lambda item: np.abs(item[1][0]), reverse=True) if v[1] <= 0.01})\nspearman_corr_gene_dict_sorted = OrderedDict({k: v for k, v in sorted(spearman_corr_gene_dict.items(), key=lambda item: np.abs(item[1][0]), reverse=True) if v[1] <= 0.01})","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:41:17.803436Z","iopub.execute_input":"2023-01-29T17:41:17.803956Z","iopub.status.idle":"2023-01-29T17:41:17.915149Z","shell.execute_reply.started":"2023-01-29T17:41:17.803917Z","shell.execute_reply":"2023-01-29T17:41:17.913882Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(set(list(spearman_corr_gene_with_cd_dict_sorted.keys())[:100]).intersection(list(spearman_corr_gene_dict_sorted.keys())[:100]))","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:30.850199Z","iopub.execute_input":"2023-01-29T17:42:30.851179Z","iopub.status.idle":"2023-01-29T17:42:30.861724Z","shell.execute_reply.started":"2023-01-29T17:42:30.851120Z","shell.execute_reply":"2023-01-29T17:42:30.860913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"prot_set_abs_corr_05_cd = cite_target_masp.columns[np.where((np.abs(spearman_corr_prot_with_cd[0]) > 0.1) & (spearman_corr_prot_with_cd[1] <= 0.01))]\ngene_set_abs_corr_05_cd = cite_raw_w_target_masp.var_names[np.where((np.abs(spearman_corr_gene_with_cd[0]) > 0.45) & (spearman_corr_gene_with_cd[1] <= 0.01))]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:37.868884Z","iopub.execute_input":"2023-01-29T17:42:37.869400Z","iopub.status.idle":"2023-01-29T17:42:37.876827Z","shell.execute_reply.started":"2023-01-29T17:42:37.869363Z","shell.execute_reply":"2023-01-29T17:42:37.875645Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print({\"ENSG00000072694_FCGR2B\": spearman_corr_gene_with_cd_dict[\"ENSG00000072694_FCGR2B\"], \n        \"ENSG00000143226_FCGR2A\": spearman_corr_gene_with_cd_dict[\"ENSG00000143226_FCGR2A\"], \n       \"ENSG00000244682_FCGR2C\": spearman_corr_gene_with_cd_dict[\"ENSG00000244682_FCGR2C\"]})","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:37.951508Z","iopub.execute_input":"2023-01-29T17:42:37.952969Z","iopub.status.idle":"2023-01-29T17:42:37.962179Z","shell.execute_reply.started":"2023-01-29T17:42:37.952907Z","shell.execute_reply":"2023-01-29T17:42:37.960781Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print({\"ENSG00000072694_FCGR2B\": spearman_corr_gene_dict[\"ENSG00000072694_FCGR2B\"], \n        \"ENSG00000143226_FCGR2A\": spearman_corr_gene_dict[\"ENSG00000143226_FCGR2A\"], \n       \"ENSG00000244682_FCGR2C\": spearman_corr_gene_dict[\"ENSG00000244682_FCGR2C\"]})","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:42.771944Z","iopub.execute_input":"2023-01-29T17:42:42.772461Z","iopub.status.idle":"2023-01-29T17:42:42.780415Z","shell.execute_reply.started":"2023-01-29T17:42:42.772420Z","shell.execute_reply":"2023-01-29T17:42:42.779031Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(prot_set_abs_corr_05_cd)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:43.842465Z","iopub.execute_input":"2023-01-29T17:42:43.843025Z","iopub.status.idle":"2023-01-29T17:42:43.852030Z","shell.execute_reply.started":"2023-01-29T17:42:43.842979Z","shell.execute_reply":"2023-01-29T17:42:43.850598Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(prot_set_abs_corr_05)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:45.125205Z","iopub.execute_input":"2023-01-29T17:42:45.125699Z","iopub.status.idle":"2023-01-29T17:42:45.135372Z","shell.execute_reply.started":"2023-01-29T17:42:45.125663Z","shell.execute_reply":"2023-01-29T17:42:45.133796Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(gene_set_abs_corr_05_cd)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:46.053797Z","iopub.execute_input":"2023-01-29T17:42:46.054795Z","iopub.status.idle":"2023-01-29T17:42:46.062127Z","shell.execute_reply.started":"2023-01-29T17:42:46.054749Z","shell.execute_reply":"2023-01-29T17:42:46.060766Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(gene_set_abs_corr_05)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:48.262716Z","iopub.execute_input":"2023-01-29T17:42:48.263371Z","iopub.status.idle":"2023-01-29T17:42:48.268971Z","shell.execute_reply.started":"2023-01-29T17:42:48.263334Z","shell.execute_reply":"2023-01-29T17:42:48.268115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(set(gene_set_abs_corr_05).intersection(set(gene_set_abs_corr_05_cd)))","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:50.282935Z","iopub.execute_input":"2023-01-29T17:42:50.283879Z","iopub.status.idle":"2023-01-29T17:42:50.291072Z","shell.execute_reply.started":"2023-01-29T17:42:50.283833Z","shell.execute_reply":"2023-01-29T17:42:50.290220Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(set(prot_set_abs_corr_05).intersection(set(prot_set_abs_corr_05_cd)))","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:51.596569Z","iopub.execute_input":"2023-01-29T17:42:51.597358Z","iopub.status.idle":"2023-01-29T17:42:51.605393Z","shell.execute_reply.started":"2023-01-29T17:42:51.597315Z","shell.execute_reply":"2023-01-29T17:42:51.604509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gene_set_abs_corr_05_cd","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:53.377197Z","iopub.execute_input":"2023-01-29T17:42:53.378583Z","iopub.status.idle":"2023-01-29T17:42:53.386160Z","shell.execute_reply.started":"2023-01-29T17:42:53.378534Z","shell.execute_reply":"2023-01-29T17:42:53.384899Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"top_cors = np.argsort(spearman_corr_gene_with_cd[np.where(np.abs(spearman_corr_gene_with_cd) > 0.35)])[:20]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:57.502295Z","iopub.execute_input":"2023-01-29T17:42:57.502796Z","iopub.status.idle":"2023-01-29T17:42:57.509856Z","shell.execute_reply.started":"2023-01-29T17:42:57.502755Z","shell.execute_reply":"2023-01-29T17:42:57.508718Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pl.pca(cite_raw_w_target, color=[\"ENSG00000143226_FCGR2A\", \"CD32\"], size=20)\nsc.pl.pca(cite_raw_w_target, color=[\"ENSG00000072694_FCGR2B\", \"CD32\"], size=20)\nsc.pl.pca(cite_raw_w_target, color=[\"ENSG00000244682_FCGR2C\", \"CD32\"], size=20)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:48:27.721207Z","iopub.execute_input":"2023-01-29T17:48:27.721714Z","iopub.status.idle":"2023-01-29T17:48:33.694323Z","shell.execute_reply.started":"2023-01-29T17:48:27.721676Z","shell.execute_reply":"2023-01-29T17:48:33.693434Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"top_20_RNA = gene_set_abs_corr_05[top_cors]\ntop_20_RNA\nsc.pl.pca(cite_raw_w_target, color=top_20_RNA, size=20)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:42:58.736864Z","iopub.execute_input":"2023-01-29T17:42:58.737881Z","iopub.status.idle":"2023-01-29T17:43:22.407840Z","shell.execute_reply.started":"2023-01-29T17:42:58.737833Z","shell.execute_reply":"2023-01-29T17:43:22.406440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"stats.spearmanr(cite_raw_w_target_masp.obsm[\"X_pca\"][:, 0], cite_target_masp.loc[:, top_cor_cd].T)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:22.409851Z","iopub.execute_input":"2023-01-29T17:43:22.410189Z","iopub.status.idle":"2023-01-29T17:43:22.422333Z","shell.execute_reply.started":"2023-01-29T17:43:22.410158Z","shell.execute_reply":"2023-01-29T17:43:22.420904Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"stats.spearmanr(cite_raw_w_target_masp[:, \"ENSG00000143226_FCGR2A\"].X.todense(), cite_target_masp.loc[:, top_cor_cd].T)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:22.424522Z","iopub.execute_input":"2023-01-29T17:43:22.425343Z","iopub.status.idle":"2023-01-29T17:43:22.512649Z","shell.execute_reply.started":"2023-01-29T17:43:22.425291Z","shell.execute_reply":"2023-01-29T17:43:22.511494Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"stats.spearmanr(cite_raw_w_target_masp.obsm[\"X_pca\"][:, 0], cite_raw_w_target_masp[:, \"ENSG00000143226_FCGR2A\"].X.todense())","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:22.515853Z","iopub.execute_input":"2023-01-29T17:43:22.516200Z","iopub.status.idle":"2023-01-29T17:43:22.597053Z","shell.execute_reply.started":"2023-01-29T17:43:22.516169Z","shell.execute_reply":"2023-01-29T17:43:22.595879Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"CD32_top_20_RNA = {rna: stats.spearmanr(cite_raw_w_target_masp[:, rna].X.todense(), cite_target_masp.loc[:, top_cor_cd].T) for rna in top_20_RNA}\nCD32_top_20_RNA","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:22.598370Z","iopub.execute_input":"2023-01-29T17:43:22.598698Z","iopub.status.idle":"2023-01-29T17:43:23.987569Z","shell.execute_reply.started":"2023-01-29T17:43:22.598666Z","shell.execute_reply":"2023-01-29T17:43:23.986442Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.distplot(cite_raw_w_target_masp[:, \"ENSG00000143226_FCGR2A\"].X.todense())","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:23.989522Z","iopub.execute_input":"2023-01-29T17:43:23.990516Z","iopub.status.idle":"2023-01-29T17:43:24.572867Z","shell.execute_reply.started":"2023-01-29T17:43:23.990480Z","shell.execute_reply":"2023-01-29T17:43:24.571724Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(np.count_nonzero(cite_raw_w_target_masp[:, \"ENSG00000143226_FCGR2A\"].X.todense()), len(cite_raw_w_target_masp[:, \"ENSG00000143226_FCGR2A\"].X.todense()))","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:24.574238Z","iopub.execute_input":"2023-01-29T17:43:24.574583Z","iopub.status.idle":"2023-01-29T17:43:24.714211Z","shell.execute_reply.started":"2023-01-29T17:43:24.574550Z","shell.execute_reply":"2023-01-29T17:43:24.712699Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Enrichment analysis","metadata":{}},{"cell_type":"code","source":"!pip install gseapy mygene","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:24.715957Z","iopub.execute_input":"2023-01-29T17:43:24.716423Z","iopub.status.idle":"2023-01-29T17:43:36.080162Z","shell.execute_reply.started":"2023-01-29T17:43:24.716376Z","shell.execute_reply":"2023-01-29T17:43:36.078572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import gseapy as gp\nimport mygene","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:36.082050Z","iopub.execute_input":"2023-01-29T17:43:36.083674Z","iopub.status.idle":"2023-01-29T17:43:36.088893Z","shell.execute_reply.started":"2023-01-29T17:43:36.083624Z","shell.execute_reply":"2023-01-29T17:43:36.087563Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gene_set_abs_corr_05","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:36.092613Z","iopub.execute_input":"2023-01-29T17:43:36.092934Z","iopub.status.idle":"2023-01-29T17:43:36.105866Z","shell.execute_reply.started":"2023-01-29T17:43:36.092903Z","shell.execute_reply":"2023-01-29T17:43:36.104678Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gene_set_abs_corr_05_conv = [x.split(\"_\")[1] for x in gene_set_abs_corr_05.tolist()]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:36.107301Z","iopub.execute_input":"2023-01-29T17:43:36.108296Z","iopub.status.idle":"2023-01-29T17:43:36.115277Z","shell.execute_reply.started":"2023-01-29T17:43:36.108259Z","shell.execute_reply":"2023-01-29T17:43:36.114163Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_gene = gp.enrichr(\n    gene_list=gene_set_abs_corr_05_conv,\n    gene_sets=['KEGG_2021_Human'],\n    organism='human',\n    outdir=None,\n)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:44:56.347942Z","iopub.execute_input":"2023-01-29T17:44:56.348500Z","iopub.status.idle":"2023-01-29T17:45:01.353337Z","shell.execute_reply.started":"2023-01-29T17:44:56.348458Z","shell.execute_reply":"2023-01-29T17:45:01.352396Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_prot = gp.enrichr(\n    gene_list=prot_set_abs_corr_05.tolist(),\n    gene_sets=['KEGG_2021_Human'],\n    organism='human',\n    outdir=None,\n)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:45:01.355076Z","iopub.execute_input":"2023-01-29T17:45:01.356178Z","iopub.status.idle":"2023-01-29T17:45:05.768405Z","shell.execute_reply.started":"2023-01-29T17:45:01.356142Z","shell.execute_reply":"2023-01-29T17:45:05.767406Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_gene.results.sort_values(['Adjusted P-value',  'Combined Score'], ascending=[True, False])[:10]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:45:05.770157Z","iopub.execute_input":"2023-01-29T17:45:05.770472Z","iopub.status.idle":"2023-01-29T17:45:05.794533Z","shell.execute_reply.started":"2023-01-29T17:45:05.770442Z","shell.execute_reply":"2023-01-29T17:45:05.793207Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_prot.results.sort_values(['Adjusted P-value',  'Combined Score'], ascending=[True, False])[:10]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:45:05.797687Z","iopub.execute_input":"2023-01-29T17:45:05.798553Z","iopub.status.idle":"2023-01-29T17:45:05.819765Z","shell.execute_reply.started":"2023-01-29T17:45:05.798499Z","shell.execute_reply":"2023-01-29T17:45:05.818598Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gene_set_abs_corr_05_cd_conv = [x.split(\"_\")[1] for x in gene_set_abs_corr_05_cd.tolist()]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:52.452826Z","iopub.execute_input":"2023-01-29T17:43:52.453995Z","iopub.status.idle":"2023-01-29T17:43:52.458966Z","shell.execute_reply.started":"2023-01-29T17:43:52.453955Z","shell.execute_reply":"2023-01-29T17:43:52.457770Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_gene_cd = gp.enrichr(\n    gene_list=gene_set_abs_corr_05_cd_conv,\n    gene_sets=['KEGG_2021_Human'],\n    organism='human',\n    outdir=None\n)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:52.460373Z","iopub.execute_input":"2023-01-29T17:43:52.460696Z","iopub.status.idle":"2023-01-29T17:43:56.913741Z","shell.execute_reply.started":"2023-01-29T17:43:52.460658Z","shell.execute_reply":"2023-01-29T17:43:56.912612Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_prot_cd = gp.enrichr(\n    gene_list=prot_set_abs_corr_05_cd.tolist(),\n    gene_sets=['KEGG_2021_Human'],\n    organism='human',\n    outdir=None,\n)","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:43:56.915164Z","iopub.execute_input":"2023-01-29T17:43:56.916901Z","iopub.status.idle":"2023-01-29T17:44:01.382104Z","shell.execute_reply.started":"2023-01-29T17:43:56.916859Z","shell.execute_reply":"2023-01-29T17:44:01.380891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_gene_cd.results.sort_values(['Adjusted P-value',  'Combined Score'], ascending=[True, False])[:10]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:44:01.384658Z","iopub.execute_input":"2023-01-29T17:44:01.385078Z","iopub.status.idle":"2023-01-29T17:44:01.407372Z","shell.execute_reply.started":"2023-01-29T17:44:01.385031Z","shell.execute_reply":"2023-01-29T17:44:01.405969Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"enr_prot_cd.results.sort_values(['Adjusted P-value',  'Combined Score'], ascending=[True, False])[:10]","metadata":{"execution":{"iopub.status.busy":"2023-01-29T17:44:01.408914Z","iopub.execute_input":"2023-01-29T17:44:01.409307Z","iopub.status.idle":"2023-01-29T17:44:01.430557Z","shell.execute_reply.started":"2023-01-29T17:44:01.409272Z","shell.execute_reply":"2023-01-29T17:44:01.429633Z"},"trusted":true},"execution_count":null,"outputs":[]}]}