Skip to content

Commit 4f14d0d

Browse files
committed
Generalise 2 regions connectivity definition
* Also, add the .net.ml file for the two areas analysis
1 parent 512f2e2 commit 4f14d0d

File tree

2 files changed

+209
-40
lines changed

2 files changed

+209
-40
lines changed

NeuroML2/GenerateNeuroMLlite.py

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -196,34 +196,7 @@ def internal_connections(pops, W, pre_pop, post_pop):
196196
[l5e_l2e, l5e_l2i, l5e_l5e, l5e_l5i],
197197
[l5i_l2e, l5i_l2i, l5i_l5e, l5i_l5i]], dtype='U14')
198198

199-
elif n_areas == 2:
200-
v1_v1_l2e_l2e = v4_v4_l2e_l2e = 'wee'; v1_v1_l5e_l5e = v4_v4_l5e_l5e = 'wee'
201-
v1_v1_l2e_l2i = v4_v4_l2e_l2i = 'wei'; v1_v1_l5e_l5i = v4_v4_l5e_l5i = 'wei'
202-
v1_v1_l2i_l2e = v4_v4_l2i_l2e = 'wie'; v1_v1_l5i_l5e = v4_v4_l5i_l5e = 'wie'
203-
v1_v1_l2i_l2i = v4_v4_l2i_l2i = 'wii'; v1_v1_l5i_l5i = v4_v4_l5i_l5i = 'wii'
204-
205-
v1_v1_l2e_l5e = v4_v4_l2e_l5e = 'l2e_l5e'; v1_v1_l2e_l5i = v4_v4_l2e_l5i = 0;
206-
v1_v1_l5e_l2i = v4_v4_l5e_l2i = 'l5e_l2i'; v1_v1_l5e_l2e = v4_v4_l5e_l2e = 0;
207-
v1_v1_l2i_l5e = v4_v4_l2i_l5e = 0; v1_v1_l5i_l2i = v4_v4_l5i_l2i = 0;
208-
v1_v1_l5i_l2e = v4_v4_l5i_l2e = 0; v1_v1_l2i_l5i = v4_v4_l2i_l5i = 0;
209-
210-
# interareal
211-
v1_v4_l2e_l2e = 'FF_l2e_l2e'; v4_v1_l2e_l2e = 0; v1_v4_l2e_l2i = v4_v1_l2e_l2i = 0; v1_v4_l2e_l5e = v4_v1_l2e_l5e = 0; v1_v4_l2e_l5i = v4_v1_l2e_l5i= 0;
212-
v1_v4_l2i_l2e = v4_v1_l2i_l2e = 0; v1_v4_l2i_l2i = v4_v1_l2i_l2i = 0; v1_v4_l2i_l5e = v4_v1_l2i_l5e = 0; v1_v4_l2i_l5i = v4_v1_l2i_l5i= 0;
213-
v1_v4_l5e_l2e = 0; v4_v1_l5e_l2e = 'FB_l5e_l2e'; v1_v4_l5e_l2i = 0; v4_v1_l5e_l2i = 'FB_l5e_l2i'; v1_v4_l5e_l5e = 0; v4_v1_l5e_l5e = 'FB_l5e_l5e'; v1_v4_l5e_l5i = 0; v4_v1_l5e_l5i= 'FB_l5e_l2i';
214-
v1_v4_l5i_l2e = v4_v1_l5i_l2e = 0; v1_v4_l5i_l2i = v4_v1_l5i_l2i = 0; v1_v4_l5i_l5e = v4_v1_l5i_l5e = 0; v1_v4_l5i_l5i = v4_v1_l5i_l5i= 0;
215-
216-
W = np.array([ [v1_v1_l2e_l2e, v1_v1_l2e_l2i, v1_v1_l2e_l5e, v1_v1_l2e_l5i, v1_v4_l2e_l2e, v1_v4_l2e_l2i, v1_v4_l2e_l5e, v1_v4_l2e_l5i],
217-
[v1_v1_l2i_l2e, v1_v1_l2i_l2i, v1_v1_l2i_l5e, v1_v1_l2i_l5i, v1_v4_l2i_l2e, v1_v4_l2i_l2i, v1_v4_l2i_l5e, v1_v4_l2i_l5i],
218-
[v1_v1_l5e_l2e, v1_v1_l5e_l2i, v1_v1_l5e_l5e, v1_v1_l5e_l5i, v1_v4_l5e_l2e, v1_v4_l5e_l2i, v1_v4_l5e_l5e, v1_v4_l5e_l5i],
219-
[v1_v1_l5i_l2e, v1_v1_l5i_l2i, v1_v1_l5i_l5e, v1_v1_l5i_l5i, v1_v4_l5i_l2e, v1_v4_l5i_l2i, v1_v4_l5i_l5e, v1_v4_l5i_l5i],
220-
[v4_v1_l2e_l2e, v4_v1_l2e_l2i, v4_v1_l2e_l5e, v4_v1_l2e_l5i, v4_v4_l2e_l2e, v4_v4_l2e_l2i, v4_v4_l2e_l5e, v4_v4_l2e_l5i],
221-
[v4_v1_l2i_l2e, v4_v1_l2i_l2i, v4_v1_l2i_l5e, v4_v1_l2i_l5i, v4_v4_l2i_l2e, v4_v4_l2i_l2i, v4_v4_l2i_l5e, v4_v4_l2i_l5i],
222-
[v4_v1_l5e_l2e, v4_v1_l5e_l2i, v4_v1_l5e_l5e, v4_v1_l5e_l5i, v4_v4_l5e_l2e, v4_v4_l5e_l2i, v4_v4_l5e_l5e, v4_v4_l5e_l5i],
223-
[v4_v1_l5i_l2e, v4_v1_l5i_l2i, v4_v1_l5i_l5e, v4_v1_l5i_l5i, v4_v4_l5i_l2e, v4_v4_l5i_l2i, v4_v4_l5i_l5e, v4_v4_l5i_l5i]],
224-
dtype='U14')
225-
226-
elif n_areas > 2:
199+
elif n_areas >= 2:
227200

228201
nlayers = 4 #(L2/3E, L5/6, L2/3I, L5/6I)
229202

@@ -930,6 +903,13 @@ def internal_connections(pops, W, pre_pop, post_pop):
930903

931904
elif '-interareal' in sys.argv:
932905
from interareal import interareal_analysis, interareal_plt
906+
from itertools import product
907+
import pandas as pd
908+
909+
ranking = pd.read_csv('../Python/interareal/areas_ranking.txt')
910+
with open('../Python/interareal/connectivity.pickle', 'rb') as handle:
911+
conn = pickle.load(handle)
912+
933913

934914
# Set model settings
935915
wee = JEE; wei = JIE; wie = JEI; wii = JII; l5e_l2i = .75; l2e_l5e = 1
@@ -939,7 +919,6 @@ def internal_connections(pops, W, pre_pop, post_pop):
939919
minfreq_l23 = 30. # Hz
940920
minfreq_l56 = 3. # Hz
941921

942-
net_id='Interareal'
943922

944923

945924
if '-3rois' not in sys.argv and \
@@ -949,7 +928,8 @@ def internal_connections(pops, W, pre_pop, post_pop):
949928
# Note: For testing porpose, only the rest simulation is performed if the flag '-analysis' is not
950929
# passed
951930
areas = ['V1', 'V4']
952-
nareas = len(areas)
931+
conn = get_connectivity(conn, areas, ranking, conn_bin=None)
932+
net_id='Interareal_%d' %(len(areas))
953933

954934
# for testing purpose generate one single simulation
955935
if '-analysis' in sys.argv:
@@ -985,7 +965,7 @@ def internal_connections(pops, W, pre_pop, post_pop):
985965
i_l5e_l2i=l5e_l2i, i_l2e_l5e=l2e_l5e,
986966
areas=areas,
987967
dt=dt, duration=duration, Iext=Iext_rest, count=stat,
988-
net_id=net_id)
968+
net_id=net_id, conn=conn)
989969
# Run in some simulators
990970
check_to_generate_or_run(sys.argv, sim_rest)
991971
simulator = 'jNeuroML'
@@ -1000,7 +980,7 @@ def internal_connections(pops, W, pre_pop, post_pop):
1000980
i_l5e_l2i=l5e_l2i, i_l2e_l5e=l2e_l5e,
1001981
areas=areas,
1002982
dt=dt, duration=duration, Iext=Iext_stim, count=stat,
1003-
net_id=net_id)
983+
net_id=net_id, conn=conn)
1004984
# Run in some simulators
1005985
check_to_generate_or_run(sys.argv, sim_stim)
1006986
simulator = 'jNeuroML'
@@ -1053,14 +1033,6 @@ def internal_connections(pops, W, pre_pop, post_pop):
10531033

10541034
else:
10551035
#Load the array with the ordered rank
1056-
from itertools import product
1057-
import pandas as pd
1058-
1059-
ranking = pd.read_csv('../Python/interareal/areas_ranking.txt')
1060-
with open('../Python/interareal/connectivity.pickle', 'rb') as handle:
1061-
conn = pickle.load(handle)
1062-
1063-
10641036

10651037
if '-3rois' in sys.argv:
10661038
areas = ['V1', 'V4', 'MT']

0 commit comments

Comments
 (0)