{ "cells": [ { "cell_type": "markdown", "id": "f7638063", "metadata": {}, "source": [ "# Graph-based Random Walk\n", "\n", "This notebook is used to construct a Human-Mouse graph through Random Walk method.\n", "\n", "### Introduction\n", "\n", "##### Human diffusion-based tractography\n", "\n", "- We utilized diffusion data from the [Human Connectome Project (HCP)](https://www.humanconnectome.org/study/hcp-young-adult/data-releases), which have been preprocessed following HCP's standard pipeline.\n", "- Further post-processing steps of tractography were carried out using [MRtrix3](http://mrtrix.readthedocs.io).\n", "\n", "##### Mouse Tracer\n", "\n", "- Tracer data maps neural connectivity by tracking the movement of injected tracers along axonal pathways in animal brains.\n", "- The mouse connectome data we used was initially sourced from the [Allen Mouse Connectivity Atlas](https://connectivity.brain-map.org).\n", "\n", "##### Embedding space generated from Human-Mouse graph\n", "\n", "- Intra-species edges are defined by anatomical connectivity, derived from mouse viral tracer data and human tractography.\n", "- Cross-species edges were established using transcriptomic latent embeddings from DNN model, constrained by coarse-scale anatomical hierarchies.\n", "- For the pruned Human-Mouse graph, we used the [Node2vec algorithm by Sporns et al.](https://www.nature.com/articles/s41467-018-04614-w) to construct graph embedding.\n" ] }, { "cell_type": "markdown", "id": "0b6734d0-339a-44b1-b0bf-ab83a78983c5", "metadata": {}, "source": [ "### Define human and mouse ROIs" ] }, { "cell_type": "code", "execution_count": 1, "id": "aef375f9-6b03-4ebd-9668-6dbece49d8f5", "metadata": { "scrolled": true }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "id": "12fde0ab-a0d2-4fd4-8cc3-b936aaa3b5fc", "metadata": {}, "outputs": [], "source": [ "human_select_cortex_region = ['A8m', 'A8dl', 'A9l', 'A6dl','A6m','A9m', 'A10m', 'A9/46d','IFJ', 'A46', 'A9/46v', 'A8vl','A6vl','A10l', 'A44d', 'IFS', 'A45c', 'A45r', 'A44op','A44v', 'A14m', 'A12/47o', 'A11l','A11m', 'A13', 'A12/47l','A32p','A32sg','A24cd','A24rv','A4hf', 'A6cdl', 'A4ul', 'A4t', 'A4tl', 'A6cvl','A1/2/3ll', 'A4ll','A1/2/3ulhf', 'A1/2/3tonIa', 'A2','A1/2/3tru','A7r', 'A7c', 'A5l', 'A7pc', 'A7ip', 'A39c', 'A39rd', 'A40rd', 'A40c', 'A39rv','A40rv',\n", " 'A7m', 'A5m', 'dmPOS','A31','A23d','A23c','A23v','cLinG', 'rCunG','cCunG', 'rLinG', 'vmPOS', 'mOccG', 'V5/MT+', 'OPC', 'iOccG', 'msOccG', 'lsOccG',\n", " 'G', 'vIa', 'dIa', 'vId/vIg', 'dIg', 'dId','A38m', 'A41/42', 'TE1.0 and TE1.2', 'A22c', 'A38l', 'A22r', 'A21c', 'A21r', 'A37dl', 'aSTS', 'A20iv', 'A37elv', 'A20r', 'A20il', 'A37vl', 'A20cl','A20cv', 'A20rv', 'A37mv', 'A37lv', 'A35/36r', 'A35/36c', 'lateral PPHC', 'A28/34', 'TH','TI','rpSTS','cpSTS']\n", "mouse_select_cortex_region = ['ACAd', 'ACAv', 'PL','ILA', 'ORBl', 'ORBm', 'ORBvl','MOp','SSp-n', 'SSp-bfd', 'SSp-ll', 'SSp-m',\n", " 'SSp-ul', 'SSp-tr', 'SSp-un','SSs','PTLp','RSPagl','RSPd', 'RSPv','VISpm','VISp','VISal','VISl','VISpl','AId','AIp','AIv','GU','VISC','TEa', 'PERI', 'ECT','AUDd', 'AUDp',\n", " 'AUDpo', 'AUDv'] " ] }, { "cell_type": "code", "execution_count": 3, "id": "205c62b1-0156-4656-905b-b0aafaa78ca2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "105" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(human_select_cortex_region)" ] }, { "cell_type": "code", "execution_count": 4, "id": "46001225-9829-4770-90b7-7d0aa34b545e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "37" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(mouse_select_cortex_region)" ] }, { "cell_type": "code", "execution_count": 5, "id": "6c1efed5-eb81-492e-8feb-797786172b3a", "metadata": {}, "outputs": [], "source": [ "human_select_subcortex_region = ['mAmyg', 'lAmyg', 'CA1', 'CA4DG', 'CA2CA3', 'subiculum','Claustrum', 'head of caudate', 'body of caudate', 'Putamen',\n", " 'posterovemtral putamen', 'nucleus accumbens','external segment of globus pallidus','internal segment of globus pallidus', 'mPMtha', 'Stha','cTtha', 'Otha',\n", " 'mPFtha','lPFtha','rTtha', 'PPtha']\n", "mouse_select_subcortex_region = ['LA', 'BLA', 'BMA', 'PA','CA1', 'CA2', 'CA3', 'DG', 'SUB', 'ACB', 'CP', 'FS', 'SF', 'SH','sAMY', 'PAL', 'VENT', 'SPF', 'SPA', 'PP', 'GENd', 'LAT', 'ATN',\n", " 'MED', 'MTN', 'ILM', 'GENv', 'EPI', 'RT']" ] }, { "cell_type": "code", "execution_count": 6, "id": "0fc1a28e-38c4-4208-9675-913b3c66d3d8", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "127" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(human_select_cortex_region+human_select_subcortex_region)" ] }, { "cell_type": "code", "execution_count": 7, "id": "c223e459-ccc1-4e8a-893a-1f31b2b8a325", "metadata": {}, "outputs": [], "source": [ "Human_select_region = human_select_cortex_region + human_select_subcortex_region\n", "Mouse_select_region = mouse_select_cortex_region + mouse_select_subcortex_region" ] }, { "cell_type": "code", "execution_count": 8, "id": "5da02845-9fb8-4c72-afa1-518bbdff0d9e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "127" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(Human_select_region)" ] }, { "cell_type": "code", "execution_count": 9, "id": "8b645208-17d7-483b-9afc-df721b55d74b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "66" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(Mouse_select_region)" ] }, { "cell_type": "code", "execution_count": 10, "id": "ef7c47dd-a2ed-411f-b467-5f5d2e0bd2ce", "metadata": {}, "outputs": [], "source": [ "import warnings\n", "warnings.filterwarnings('ignore')\n", "import os\n", "import pandas as pd\n", "import numpy as np\n", "import seaborn as sns\n", "from matplotlib import pyplot as plt\n", "import pickle" ] }, { "cell_type": "markdown", "id": "73135b44-5501-4306-be8e-c1f1f97d2f1e", "metadata": {}, "source": [ "## Generate human and mouse graph" ] }, { "cell_type": "markdown", "id": "760da94f", "metadata": {}, "source": [ "Load human structural connectivity data and region info table" ] }, { "cell_type": "code", "execution_count": 11, "id": "9a93519c-90a5-447f-b7fc-d29bd3f71560", "metadata": {}, "outputs": [], "source": [ "Human_dti_dataframe=pd.read_csv('../../tutorials/structural_connection/human_127atlas_dti.csv')" ] }, { "cell_type": "code", "execution_count": 12, "id": "6aa87606-171d-48f4-8262-8091eb597e38", "metadata": {}, "outputs": [], "source": [ "Human_dti_dataframe.set_index('Unnamed: 0',drop=True,inplace=True)" ] }, { "cell_type": "code", "execution_count": 13, "id": "7d74e51b-1293-48f1-b7de-c573c42965c8", "metadata": {}, "outputs": [], "source": [ "human_127atlas = pd.read_excel('../../transbrain/atlas/roi_of_bn_atlas.xlsx')" ] }, { "cell_type": "code", "execution_count": 17, "id": "c844ba8a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | Anatomical Name | \n", "Full Name | \n", "Atlas Type | \n", "Left Index | \n", "Right Index | \n", "Atlas Index | \n", "
|---|---|---|---|---|---|---|
| 0 | \n", "A8m | \n", "A8m, medial area 8 | \n", "BN | \n", "1 | \n", "2 | \n", "1 | \n", "
| 1 | \n", "A8dl | \n", "A8dl, dorsolateral area 8 | \n", "BN | \n", "3 | \n", "4 | \n", "2 | \n", "
| 2 | \n", "A9l | \n", "A9l, lateral area 9 | \n", "BN | \n", "5 | \n", "6 | \n", "3 | \n", "
| 3 | \n", "A6dl | \n", "A6dl, dorsolateral area 6 | \n", "BN | \n", "7 | \n", "8 | \n", "4 | \n", "
| 4 | \n", "A6m | \n", "A6m, medial area 6 | \n", "BN | \n", "9 | \n", "10 | \n", "5 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 122 | \n", "rTtha | \n", "rTtha, rostral temporal thalamus | \n", "BN | \n", "237 | \n", "238 | \n", "123 | \n", "
| 123 | \n", "PPtha | \n", "PPtha, posterior parietal thalamus | \n", "BN | \n", "239 | \n", "240 | \n", "124 | \n", "
| 124 | \n", "Otha | \n", "Otha, occipital thalamus | \n", "BN | \n", "241 | \n", "242 | \n", "125 | \n", "
| 125 | \n", "cTtha | \n", "cTtha, caudal temporal thalamus | \n", "BN | \n", "243 | \n", "244 | \n", "126 | \n", "
| 126 | \n", "lPFtha | \n", "lPFtha, lateral pre-frontal thalamus | \n", "BN | \n", "245 | \n", "246 | \n", "127 | \n", "
127 rows × 6 columns
\n", "