Skip to content

Commit

Permalink
Merge 8de5f49 into 8a4eb45
Browse files Browse the repository at this point in the history
  • Loading branch information
espenhgn committed Feb 21, 2019
2 parents 8a4eb45 + 8de5f49 commit b5f166c
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 25 deletions.
4 changes: 2 additions & 2 deletions examples/bioRxiv281717/example_parallel_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
GNU General Public License for more details.
'''
from __future__ import division
from mpi4py import MPI
import neuron
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
Expand All @@ -150,8 +152,6 @@
h5py.version.hdf5_version))
import os
from time import time
from mpi4py import MPI
import neuron
import LFPy
from example_parallel_network_plotting import decimate

Expand Down
40 changes: 31 additions & 9 deletions examples/bioRxiv281717/example_parallel_network_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@
neuron.h.load_file("import3d.hoc")


#######################
# Functions
#######################
def get_pre_m_type(post):
'''little helper function to return the most populuous excitatory m_type
within the layer of m_type post, assuming this is representative for
excitatory external connections onto postsynaptic cells '''
if post.startswith('L23'):
return 'L23_PC'
elif post.startswith('L4'):
return 'L4_PC'
elif post.startswith('L5'):
return 'L5_TTPC1'
elif post.startswith('L6'):
return 'L6_IPC'

#######################
# Parameters
#######################


# test mode (1 cell per pop, all-to-all connectivity)
TESTING = False

Expand Down Expand Up @@ -202,21 +223,21 @@
# Excitatory
('L4_PC', 'cAD', 'L4_PC_cADpyr230_1', 2674,
dict(radius=210, loc=PSET.layer_data[3]['center'], scale=100., cap=[1078., 97.]),
dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.05, 5.),
dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.125, 5.),
# Inhibitory
('L4_LBC', 'dNAC', 'L4_LBC_dNAC222_1', 122,
dict(radius=210, loc=PSET.layer_data[3]['center'], scale=100., cap=[938., 670]),
dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.05, 5.),
dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.125, 5.),

# Layer 5
# Excitatory
('L5_TTPC1', 'cAD', 'L5_TTPC1_cADpyr232_1', 2403,
dict(radius=210, loc=PSET.layer_data[4]['center'], scale=125., cap=[719, 73.]),
dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.045, 5.),
dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.1, 5.),
# Inhibitory
('L5_MC', 'bAC', 'L5_MC_bAC217_1', 395,
dict(radius=210, loc=PSET.layer_data[4]['center'], scale=125., cap=[378., 890]),
dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.05, 5.),
dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.125, 5.),
],
dtype = [('m_type', '|{}32'.format(stringType)), ('e_type', '|{}32'.format(stringType)),
('me_type', '|{}32'.format(stringType)), ('POP_SIZE', 'i8'), ('pop_args', dict),
Expand All @@ -228,6 +249,7 @@
# names as used to denote individual cell types
# POP_SIZE : number of neurons for each morphological type as given on https://bbp.epfl.ch/nmc-portal/microcircuit


# pop_args : dict, radius, mean position (loc) and standard deviation (scale) of the soma positions
# rotation_args : dict, default rotations around x and y axis applied to each cell in the population using LFPy.NetworkCell.set_rotation() method.

Expand Down Expand Up @@ -651,13 +673,13 @@
PSET.connParamsExtrinsic = dict(
# synapse type
syntype = 'ProbAMPANMDA_EMS',
# synapse parameters (chosen using pre==post)
# synapse parameters (assumes parameters of excitatory population in the layer)
synparams = [dict(
Use = syn_param_stats['{}:{}'.format(post, post)]['Use_mean'],
Dep = syn_param_stats['{}:{}'.format(post, post)]['Dep_mean'],
Fac = syn_param_stats['{}:{}'.format(post, post)]['Fac_mean'],
Use = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['Use_mean'],
Dep = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['Dep_mean'],
Fac = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['Fac_mean'],
tau_r_AMPA = 0.2,
tau_d_AMPA = syn_param_stats['{}:{}'.format(pre, post)]['tau_d_mean'],
tau_d_AMPA = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['tau_d_mean'],
tau_r_NMDA = 0.29,
tau_d_NMDA = 43,
e=0,
Expand Down
9 changes: 4 additions & 5 deletions examples/bioRxiv281717/figure_7_8/example_parallel_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
GNU General Public License for more details.
'''
from __future__ import division
from mpi4py import MPI
import neuron
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
Expand All @@ -139,12 +141,10 @@
h5py.version.hdf5_version))
import os
from time import time
from mpi4py import MPI
import neuron
import LFPy
from example_parallel_network_plotting import decimate
import sys
import NeuroTools.parameters as ps
import parameters as ps


# set up MPI environment
Expand Down Expand Up @@ -263,7 +263,7 @@
if RANK == 0:
parameters_time = time() - tic
# open file object for writing
logfile = file(os.path.join(PSET.OUTPUTPATH, 'log.txt'), 'w', 0)
logfile = open(os.path.join(PSET.OUTPUTPATH, 'log.txt'), 'w')
logfile.write('initialization {}\n'.format(initialization_time))
print('Parameters in {} seconds'.format(parameters_time))
logfile.write('parameters {}\n'.format(parameters_time))
Expand Down Expand Up @@ -574,7 +574,6 @@
label=name,
)
ax.add_collection(polycol)
ax.axis(ax.axis('equal'))
ax.set_xlim(-400, 400)
axis = ax.axis()
ax.hlines(np.r_[0., -PSET.layer_data['thickness'].cumsum()],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@
RANK = COMM.Get_rank()


#######################
# Functions
#######################
def get_pre_m_type(post):
'''little helper function to return the most populuous excitatory m_type
within the layer of m_type post, assuming this is representative for
excitatory external connections onto postsynaptic cells '''
if post.startswith('L23'):
return 'L23_PC'
elif post.startswith('L4'):
return 'L4_PC'
elif post.startswith('L5'):
return 'L5_TTPC1'
elif post.startswith('L6'):
return 'L6_IPC'

#######################
# Parameters
#######################


# load some neuron-interface files needed for the EPFL cell types
neuron.h.load_file("stdrun.hoc")
neuron.h.load_file("import3d.hoc")
Expand Down Expand Up @@ -205,21 +226,21 @@
# # Excitatory
# ('L4_PC', 'cAD', 'L4_PC_cADpyr230_1', 2674,
# dict(radius=210, loc=PSET.layer_data[3]['center'], scale=100., cap=[1078., 97.]),
# dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.05, 5.),
# dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.125, 5.),
# # Inhibitory
# ('L4_LBC', 'dNAC', 'L4_LBC_dNAC222_1', 122,
# dict(radius=210, loc=PSET.layer_data[3]['center'], scale=100., cap=[938., 670]),
# dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.05, 5.),
# dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.125, 5.),

# Layer 5
# Excitatory
('L5_TTPC1', 'cAD', 'L5_TTPC1_cADpyr232_1', 2403,
dict(radius=210, loc=PSET.layer_data[4]['center'], scale=125., cap=[719, 73.]),
dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.045, 5.),
dict(x=np.pi/2, y=0.), ['dend', 'apic'], ['dend', 'apic'], 0.1, 5.),
# Inhibitory
('L5_MC', 'bAC', 'L5_MC_bAC217_1', 395,
dict(radius=210, loc=PSET.layer_data[4]['center'], scale=125., cap=[378., 890]),
dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.05, 5.),
dict(x=np.pi/2, y=0.), ['soma', 'dend', 'apic'], ['dend', 'apic'], 0.125, 5.),
],
dtype = [('m_type', '|{}32'.format(stringType)), ('e_type', '|{}32'.format(stringType)),
('me_type', '|{}32'.format(stringType)), ('POP_SIZE', 'i8'), ('pop_args', dict),
Expand Down Expand Up @@ -654,13 +675,13 @@
PSET.connParamsExtrinsic = dict(
# synapse type
syntype = 'ProbAMPANMDA_EMS',
# synapse parameters (chosen using pre==post)
# synapse parameters (assumes parameters of excitatory population in the layer)
synparams = [dict(
Use = syn_param_stats['{}:{}'.format(post, post)]['Use_mean'],
Dep = syn_param_stats['{}:{}'.format(post, post)]['Dep_mean'],
Fac = syn_param_stats['{}:{}'.format(post, post)]['Fac_mean'],
Use = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['Use_mean'],
Dep = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['Dep_mean'],
Fac = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['Fac_mean'],
tau_r_AMPA = 0.2,
tau_d_AMPA = syn_param_stats['{}:{}'.format(pre, post)]['tau_d_mean'],
tau_d_AMPA = syn_param_stats['{}:{}'.format(get_pre_m_type(post), post)]['tau_d_mean'],
tau_r_NMDA = 0.29,
tau_d_NMDA = 43,
e=0,
Expand Down

0 comments on commit b5f166c

Please sign in to comment.