Skip to content

Commit 923670a

Browse files
committed
revision
1 parent 7b40457 commit 923670a

10 files changed

+176
-83
lines changed

data/.DS_Store

14 KB
Binary file not shown.

data/Fig5_6/ttf_area.npy

320 Bytes
Binary file not shown.

notebooks/Fig1_CCG.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"mouse_ID = '388523'\n",
3737
"\n",
3838
"# 1. load df\n",
39-
"basepath = '/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/example_388523/'\n",
39+
"basepath = '~/data/example_388523/'\n",
4040
"df_tmp = pd.read_csv(basepath+'mouse'+mouse_ID+'_cortex_meta.csv')\n",
4141
"df_tmp = df_tmp[df_tmp.FR>2]\n",
4242
"df_tmp = df_tmp.reset_index()\n",

notebooks/Fig1_clustering_method.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
"plt.style.use('default')\n",
1919
"%matplotlib inline\n",
2020
"\n",
21-
"sys.path.append(\"/Users/xiaoxuanj/work/work_allen/Ephys/code_library/ephys_code\")\n",
22-
"\n",
2321
"import functional_clustering as fc\n"
2422
]
2523
},
@@ -37,7 +35,7 @@
3735
"outputs": [],
3836
"source": [
3937
"mouse_ID='388523'\n",
40-
"basepath = '/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/example_388523/'\n",
38+
"basepath = '~/data/example_388523/'\n",
4139
"X = np.load(basepath+'mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
4240
"df = pd.read_csv(basepath+'mouse'+mouse_ID+'_meta_cluster_RF.csv', index_col=0)\n",
4341
"\n",

notebooks/Fig2_weight_Fig3_distribution.ipynb

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@
1717
"import matplotlib.pyplot as plt\n",
1818
"plt.style.use('default')\n",
1919
"%matplotlib inline\n",
20-
"import seaborn as sns\n",
21-
"\n",
22-
"sys.path.append(\"/Users/xiaoxuanj/work/work_allen/Ephys/code_library/ephys_code/\")\n",
23-
"\n",
24-
"import data_loader as dl\n",
25-
"\n",
26-
"import get_layer_dict as gd\n"
20+
"import seaborn as sns\n"
2721
]
2822
},
2923
{
@@ -500,11 +494,11 @@
500494
"for idx, mouse_ID in enumerate(mouse_IDs):\n",
501495
" print(mouse_ID)\n",
502496
" # 1. load df\n",
503-
" X = np.load('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/CM/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
497+
" X = np.load('~/data/CM/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
504498
" # spontaneous\n",
505499
" #X = np.load('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/adjacency_matrix/RF_onscreen/mouse'+mouse_ID+'_adjacency_matrix_RF_spon.npy')\n",
506500
" \n",
507-
" df = pd.read_csv('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/meta_cluster_RF/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
501+
" df = pd.read_csv('~/data/CM/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
508502
" DF.append(df)\n",
509503
" print(len(df))\n",
510504
" N[idx, 0] = len(df[df.cluster==1])/len(df)\n",
@@ -988,15 +982,6 @@
988982
"layers.shape"
989983
]
990984
},
991-
{
992-
"cell_type": "code",
993-
"execution_count": 20,
994-
"metadata": {},
995-
"outputs": [],
996-
"source": [
997-
"np.save('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/archive/layer_distribution.npy', layers)"
998-
]
999-
},
1000985
{
1001986
"cell_type": "code",
1002987
"execution_count": 21,
@@ -1124,15 +1109,6 @@
11241109
"layers = np.array(layers)"
11251110
]
11261111
},
1127-
{
1128-
"cell_type": "code",
1129-
"execution_count": 24,
1130-
"metadata": {},
1131-
"outputs": [],
1132-
"source": [
1133-
"np.save('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/archive/area_distribution.npy', layers)"
1134-
]
1135-
},
11361112
{
11371113
"cell_type": "code",
11381114
"execution_count": 23,
@@ -1425,10 +1401,7 @@
14251401
"\n",
14261402
"plt.title('$r_P$ = ' + str(np.around(pow(r_p,1),2)) + '; $P_P$ = ' + str(np.around(p_p,6)) + '\\n' + \\\n",
14271403
" '$r_S$ = ' + str(np.around(pow(r_s,1),2)) + '; $P_S$ = ' + str(np.around(p_s,6)))\n",
1428-
"\n",
1429-
"#plt.savefig('/Users/xiaoxuanj/Documents/Paper_functional_connectivity/materials/driver_proportion_GHS.pdf')\n",
1430-
"\n",
1431-
"#plt.savefig('/Users/xiaoxuanj/Documents/presentations/COSYNE2020/talk/materials/proportion_HS_platform.pdf')"
1404+
"\n"
14321405
]
14331406
},
14341407
{
@@ -1653,7 +1626,7 @@
16531626
"driven=[]\n",
16541627
"\n",
16551628
"for idx, mouse_ID in enumerate(mouse_IDs):\n",
1656-
" df = pd.read_csv('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/meta_cluster_RF/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
1629+
" df = pd.read_csv('~/data/CM/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
16571630
" \n",
16581631
" DF = df\n",
16591632
" \n",
@@ -2181,7 +2154,7 @@
21812154
"driven=[]\n",
21822155
"\n",
21832156
"for idx, mouse_ID in enumerate(mouse_IDs):\n",
2184-
" df = pd.read_csv('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/meta_cluster_RF/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
2157+
" df = pd.read_csv('~/data/CM/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
21852158
" \n",
21862159
" DF = df\n",
21872160
" \n",
@@ -2321,9 +2294,7 @@
23212294
"execution_count": null,
23222295
"metadata": {},
23232296
"outputs": [],
2324-
"source": [
2325-
"et"
2326-
]
2297+
"source": []
23272298
}
23282299
],
23292300
"metadata": {

notebooks/Fig3_div_conv.ipynb

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
"plt.style.use('default')\n",
1919
"%matplotlib inline\n",
2020
"import seaborn as sns\n",
21-
"\n",
22-
"sys.path.append(\"/Users/xiaoxuanj/work/work_allen/Ephys/code_library/ephys_code/\")\n",
23-
"\n",
24-
"import data_loader as dl\n"
21+
"\n"
2522
]
2623
},
2724
{
@@ -246,16 +243,8 @@
246243
" for mouse_ID in mouse_IDs:\n",
247244
" #print(mouse_ID)\n",
248245
" # 1. load RF on screen matrix and meta\n",
249-
" X = np.load('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/Fig3/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
250-
" df = pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/Fig3/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
251-
"\n",
252-
" # 2. load full matrix with FR>2 (N is dominanted by weak connections)\n",
253-
" #X = np.load('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/adjacency_matrix/mouse'+mouse_ID+'_adjacency_matrix.npy')\n",
254-
" #df = pd.read_csv('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/adjacency_matrix/mouse'+mouse_ID+'_adjacency_matrix.csv')\n",
255-
"\n",
256-
" #from denoise_matrix import denoise_matrix\n",
257-
" #X, k, threshold = denoise_matrix(X, threshold=0.95, plot=True)\n",
258-
"\n",
246+
" X = np.load('~/data/Fig3/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
247+
" df = pd.read_csv('~/data/Fig3/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
259248
"\n",
260249
" assert len(df)==np.shape(X)[0]\n",
261250
"\n",
@@ -846,8 +835,8 @@
846835
"for mouse_ID in mouse_IDs:\n",
847836
" print(mouse_ID)\n",
848837
" # 1. load RF on screen matrix and meta\n",
849-
" X = np.load('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/Fig3/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
850-
" df = pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/Fig3/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
838+
" X = np.load('~/data/Fig3/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
839+
" df = pd.read_csv('~/data/Fig3/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
851840
"\n",
852841
" # 2. load full matrix with FR>2 (N is dominanted by weak connections)\n",
853842
" #X = np.load('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/adjacency_matrix/mouse'+mouse_ID+'_adjacency_matrix.npy')\n",

notebooks/Fig5_6_inout_index.ipynb

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@
1717
"import matplotlib.pyplot as plt\n",
1818
"plt.style.use('default')\n",
1919
"%matplotlib inline\n",
20-
"import seaborn as sns\n",
21-
"\n",
22-
"sys.path.append(\"/Users/xiaoxuanj/work/work_allen/Ephys/code_library/ephys_code/\")\n",
23-
"\n",
24-
"import data_loader as dl\n",
25-
"\n",
26-
"import get_layer_dict as gd\n"
20+
"import seaborn as sns\n"
2721
]
2822
},
2923
{
@@ -944,12 +938,12 @@
944938
" for mouse_ID in mouse_IDs:\n",
945939
" print(mouse_ID)\n",
946940
" # 1. load df\n",
947-
" X = np.load('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/Fig3/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
941+
" X = np.load('~/data/Fig3/mouse'+mouse_ID+'_adjacency_matrix_RF.npy')\n",
948942
"\n",
949943
" #from denoise_matrix import denoise_matrix\n",
950944
" #X, k, threshold = denoise_matrix(X, threshold=0.95, plot=True)\n",
951945
"\n",
952-
" df = pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/Fig3/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
946+
" df = pd.read_csv('~/data/Fig3/mouse'+mouse_ID+'_meta_cluster_RF.csv')\n",
953947
"\n",
954948
" # get unique depth for each probe\n",
955949
" depth={}\n",
@@ -1010,8 +1004,8 @@
10101004
"source": [
10111005
"# save all \n",
10121006
"AMO_all = np.array(AMO_all)\n",
1013-
"np.save('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/inout_index_threshold.npy', AMO_all)\n",
1014-
"np.save('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/thresholds.npy', thresholds)\n"
1007+
"np.save('~/data/Fig5_6/inout_index_threshold.npy', AMO_all)\n",
1008+
"np.save('~/data/Fig5_6/thresholds.npy', thresholds)\n"
10151009
]
10161010
},
10171011
{
@@ -1051,7 +1045,7 @@
10511045
}
10521046
],
10531047
"source": [
1054-
"AMO_all = np.load('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/inout_index_threshold.npy')\n",
1048+
"AMO_all = np.load('~/data/Fig5_6/inout_index_threshold.npy')\n",
10551049
"AMO_all.shape"
10561050
]
10571051
},
@@ -1207,9 +1201,6 @@
12071201
"#X = [ -0.357, -0.059, -0.093, 0.152,0.327, 0.441] # platform paper\n",
12081202
"X = [-0.50149, -0.13929, -0.12294, -0.00431, 0.11828, 0.29330] # CC-CT-TC global HS from Harris\n",
12091203
"\n",
1210-
"#for t in ids:\n",
1211-
" #[AMO, probe_reorder] = np.load('/Users/xiaoxuanj/work/work_allen/Ephys/processed_data/inout_index/threshold'+t+'.npy', allow_pickle=True)\n",
1212-
"\n",
12131204
"for idx in range(6):\n",
12141205
" AMO = AMO_all[idx]\n",
12151206
" plt.figure(figsize=(3,3))\n",

notebooks/Fig5_TTF_area.ipynb

Lines changed: 148 additions & 0 deletions
Large diffs are not rendered by default.

notebooks/Fig7_psth.ipynb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"metadata": {},
110110
"outputs": [],
111111
"source": [
112-
"df_new = pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/population_psth_properties_RF_alltrials_removedlow_corrected.csv')\n"
112+
"df_new = pd.read_csv('~/data/Fig7/population_psth_properties_RF_alltrials_removedlow_corrected.csv')\n"
113113
]
114114
},
115115
{
@@ -264,10 +264,7 @@
264264
" yerr = np.nanstd(tmp3)\n",
265265
" g.ax_joint.errorbar(x,y, xerr=xerr, yerr=yerr, ecolor='k', fmt='o', mfc='white', capthick=1)\n",
266266
" \n",
267-
"g.set_axis_labels('First peak time (cluster 2)', 'First peak time (cluster 3)', fontsize=14)\n",
268-
"\n",
269-
"\n",
270-
"\n"
267+
"g.set_axis_labels('First peak time (cluster 2)', 'First peak time (cluster 3)', fontsize=14)\n"
271268
]
272269
},
273270
{
@@ -715,8 +712,7 @@
715712
"mouseID='412804'\n",
716713
"\n",
717714
"# 1. load spikes\n",
718-
"#basepath = '/Volumes/local1/work_allen/Ephys/mouse'+mouseID\n",
719-
"basepath = '/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/example_psth/'\n",
715+
"basepath = '~/data/example_psth/'\n",
720716
"\n",
721717
"# spikes for preferred condition\n",
722718
"spikes_pref = np.load(basepath+'psth_pref_trial.npy')\n",

notebooks/modular_paper_anova_stats.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"metadata": {},
5858
"outputs": [],
5959
"source": [
60-
"df_psth=pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/population_psth_properties_RF_alltrials_removedlow_corrected.csv', index_col=0)"
60+
"df_psth=pd.read_csv('~/data/Fig7/population_psth_properties_RF_alltrials_removedlow_corrected.csv', index_col=0)"
6161
]
6262
},
6363
{
@@ -300,7 +300,7 @@
300300
"metadata": {},
301301
"outputs": [],
302302
"source": [
303-
"df_mi = pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/modulation_index_individual.csv', index_col=0)"
303+
"df_mi = pd.read_csv('~/data/Fig4/modulation_index_individual.csv', index_col=0)"
304304
]
305305
},
306306
{
@@ -577,7 +577,7 @@
577577
"metadata": {},
578578
"outputs": [],
579579
"source": [
580-
"df=pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/div_conv_threshold0.csv', index_col=0)"
580+
"df=pd.read_csv('~/data/Fig3/div_conv_threshold0.csv', index_col=0)"
581581
]
582582
},
583583
{
@@ -666,7 +666,7 @@
666666
"metadata": {},
667667
"outputs": [],
668668
"source": [
669-
"df=pd.read_csv('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/div_conv_shuffle_nothreshold.csv', index_col=0)"
669+
"df=pd.read_csv('~/data/Fig3/div_conv_shuffle_nothreshold.csv', index_col=0)"
670670
]
671671
},
672672
{
@@ -764,7 +764,7 @@
764764
"metadata": {},
765765
"outputs": [],
766766
"source": [
767-
"layers = np.load('/Users/xiaoxuanj/Dropbox/2019 information_flow_paper/Neuron submission/second_submission/data/layer_distribution.npy')"
767+
"layers = np.load('~/data/Fig3/layer_distribution.npy')"
768768
]
769769
},
770770
{

0 commit comments

Comments
 (0)