DNN Model Training

This notebook is used to train DNN models.

Introduction

Model architecture

  • Recognizing the distinct transcriptomic profiles between cortical and subcortical regions and the higher functional differentiation in human cortical regions, we trained a detached deep neural network model.

  • Cortical model took separately normalized data of the cortex as input, with an input layer dimension of 4,542 and an output layer of 105 cortical region labels (for BN atlas).

  • Subcortical model took separately normalized data of the subcortex as input, with an input layer dimension of 5,063 and an output layer of 22 subcortical region labels.

Region-specific embeddings

  • We fed the regional average expression matrices into the model and extracted the outputs from the final hidden layer, which served as the foundation for constructing the homologous mapping relationships.

[1]:
import pandas as pd
[2]:
homo_mouse_region_cortex=['PL','PL','ACAd','ACAv','ACAd','ACAv','ACAd','ACAv','ACAd','ACAv','RSPd','RSPd','RSPv','RSPv','ORBl','ORBl','ORBl','ORBl','ORBm','ORBm','ORBm','ORBm','ORBvl','ORBvl','ORBvl','ORBvl','MOp','MOp','MOp','MOp','SSp-ul',
                   'SSp-m','SSp-ll','SSp-tr','VISp','VISp','VISp','VISp','AId','AIv','AUDp']
homo_human_region_cortex=['A32p','A32sg','A32p','A32p','A32sg','A32sg','A24rv','A24rv','A24cd','A24cd','A23d','A23v','A23d','A23v','A11l','A11m','A12/47o','A12/47l','A11l','A11m','A12/47o','A12/47l','A11l','A11m','A12/47o','A12/47l','A4hf','A4t','A4ul','A4ll','A1/2/3ulhf',
                   'A1/2/3tonIa','A1/2/3ll','A1/2/3tru','cCunG','rCunG','cLinG','rLinG','dIa','vIa','TE1.0 and TE1.2']
[3]:
homo_mouse_region_subcortex = ['DG','CP','PAL','CA1','SUB','CA2','CA3','ACB','MED']
homo_human_region_subcortex = ['CA4DG','body of caudate','external segment of globus pallidus','CA1','subiculum','CA2CA3','CA2CA3','nucleus accumbens','mPFtha']
[4]:
homo_cortex = pd.DataFrame()
homo_cortex['human_region'] = homo_human_region_cortex
homo_cortex['mouse_region'] = homo_mouse_region_cortex
homo_cortex.to_csv('./files/homo_cortex.csv')
[5]:
homo_subcortex = pd.DataFrame()
homo_subcortex['human_region'] = homo_human_region_subcortex
homo_subcortex['mouse_region'] = homo_mouse_region_subcortex
homo_subcortex.to_csv('./files/homo_subcortex.csv')
[6]:
homo_all = pd.DataFrame()
homo_all['human_region'] = homo_human_region_cortex+homo_human_region_subcortex
homo_all['mouse_region'] = homo_mouse_region_cortex+homo_mouse_region_subcortex
homo_all.to_csv('./files/homo_all.csv')

cortical train

[7]:
# ! python ../code/dnn/main.py -n 10 -iu 4542 -ou 105 -g_path ./files/common_stable_genes_cortex.csv -d_path ../datasets/integrated_dataset/cortical_integrated/Integrated_dataset_0.h5ad -s_path ./dnn_result/detached_model/cortical_model -m_trans_path ../datasets/processeddata/mouse_st/Mouse_trans_data_cortex.h5ad -h_trans_path ../datasets/processeddata/human_ahba/Human_trans_data_cortex.h5ad -hm_path ./files/homo_cortex.csv

subcortical train

[8]:
# ! python ../code/dnn/main.py -n 10 -iu 5063 -ou 22 -g_path ./files/common_stable_genes_subcortex.csv -d_path ../datasets/integrated_dataset/subcortical_integrated/Integrated_dataset_0.h5ad -s_path ./dnn_result/detached_model/subcortical_model -m_trans_path ../datasets/processeddata/mouse_st/Mouse_trans_data_subcortex.h5ad -h_trans_path ../datasets/processeddata/human_ahba/Human_trans_data_subcortex.h5ad -hm_path ./files/homo_subcortex.csv