Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 12 additions & 40 deletions NeuroML2/GenerateNeuroMLlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,34 +207,7 @@ def internal_connections(pops, W, pre_pop, post_pop):
[l5e_l2e, l5e_l2i, l5e_l5e, l5e_l5i],
[l5i_l2e, l5i_l2i, l5i_l5e, l5i_l5i]], dtype='U14')

elif n_areas == 2:
v1_v1_l2e_l2e = v4_v4_l2e_l2e = 'wee'; v1_v1_l5e_l5e = v4_v4_l5e_l5e = 'wee'
v1_v1_l2e_l2i = v4_v4_l2e_l2i = 'wei'; v1_v1_l5e_l5i = v4_v4_l5e_l5i = 'wei'
v1_v1_l2i_l2e = v4_v4_l2i_l2e = 'wie'; v1_v1_l5i_l5e = v4_v4_l5i_l5e = 'wie'
v1_v1_l2i_l2i = v4_v4_l2i_l2i = 'wii'; v1_v1_l5i_l5i = v4_v4_l5i_l5i = 'wii'

v1_v1_l2e_l5e = v4_v4_l2e_l5e = 'l2e_l5e'; v1_v1_l2e_l5i = v4_v4_l2e_l5i = 0;
v1_v1_l5e_l2i = v4_v4_l5e_l2i = 'l5e_l2i'; v1_v1_l5e_l2e = v4_v4_l5e_l2e = 0;
v1_v1_l2i_l5e = v4_v4_l2i_l5e = 0; v1_v1_l5i_l2i = v4_v4_l5i_l2i = 0;
v1_v1_l5i_l2e = v4_v4_l5i_l2e = 0; v1_v1_l2i_l5i = v4_v4_l2i_l5i = 0;

# interareal
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;
v1_v4_l2i_l2e = v4_v1_l2i_l2e = 0; v1_v4_l2i_l2i = v4_v1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l2e, v4_v4_l2i_l2i, v4_v4_l2i_l5e, v4_v4_l2i_l5i],
[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],
[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]],
dtype='U14')

elif n_areas > 2:
elif n_areas >= 2:

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

Expand Down Expand Up @@ -948,6 +921,13 @@ def internal_connections(pops, W, pre_pop, post_pop):

elif '-interareal' in sys.argv:
from interareal import interareal_analysis, interareal_plt
from itertools import product
import pandas as pd

ranking = pd.read_csv('../Python/interareal/areas_ranking.txt')
with open('../Python/interareal/connectivity.pickle', 'rb') as handle:
conn = pickle.load(handle)


# Set model settings
wee = JEE; wei = JIE; wie = JEI; wii = JII; l5e_l2i = .75; l2e_l5e = 1
Expand All @@ -957,7 +937,6 @@ def internal_connections(pops, W, pre_pop, post_pop):
minfreq_l23 = 30. # Hz
minfreq_l56 = 3. # Hz

net_id='Interareal'


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

# for testing purpose generate one single simulation
if '-analysis' in sys.argv:
Expand Down Expand Up @@ -1003,7 +983,7 @@ def internal_connections(pops, W, pre_pop, post_pop):
i_l5e_l2i=l5e_l2i, i_l2e_l5e=l2e_l5e,
areas=areas,
dt=dt, duration=duration, Iext=Iext_rest, count=stat,
net_id=net_id)
net_id=net_id, conn=conn)
# Run in some simulators
check_to_generate_or_run(sys.argv, sim_rest)
simulator = 'jNeuroML'
Expand All @@ -1018,7 +998,7 @@ def internal_connections(pops, W, pre_pop, post_pop):
i_l5e_l2i=l5e_l2i, i_l2e_l5e=l2e_l5e,
areas=areas,
dt=dt, duration=duration, Iext=Iext_stim, count=stat,
net_id=net_id)
net_id=net_id, conn=conn)
# Run in some simulators
check_to_generate_or_run(sys.argv, sim_stim)
simulator = 'jNeuroML'
Expand Down Expand Up @@ -1071,14 +1051,6 @@ def internal_connections(pops, W, pre_pop, post_pop):

else:
#Load the array with the ordered rank
from itertools import product
import pandas as pd

ranking = pd.read_csv('../Python/interareal/areas_ranking.txt')
with open('../Python/interareal/connectivity.pickle', 'rb') as handle:
conn = pickle.load(handle)



if '-3rois' in sys.argv:
areas = ['V1', 'V4', 'MT']
Expand Down
Loading