#!/usr/bin/env python # -*- coding: utf-8 -*- ########## You need to run: ## python2.6 IPSPs_PGs_vs_granules.py import os import sys import math import pickle import datetime sys.path.extend(["..","../networks","../generators","../simulations"]) from OBNetwork import * from stimuliConstants import * ## Set OBNet_file in simset_activinhibition to have 10:1 singles, so that IPSCs are same height from simset_activinhibition import * from sim_utils import * # has build_tweaks(), and print_extras_activity() from data_utils import * RUNTIME = 3.0#6.0 # s # this must be a float, else takes as time steps ## Ensure that you use 10:1 aggregation of singles, if multiplicity = 'singles' ## so that with SYNS_PER_CLUBBED_SINGLE=10, there are no synchronous large IPSCs/IPSPs. ## But there will still be 10 IPSCs of same height for every single spike! ## For joints, 1:1 but there are 4x directed joints which'll show up say 1 in 4. multiplicity = 'joints' # 'joints' / 'singles' VOLTAGE_CLAMP = True mitralmainidx = 0 ## set lateral_mitnum to 1 for 2MITS / 2 for 2GLOMS option set in generate_neuroML.py ## Note that for directed connectivity, mit 3 is used for directed conn to mit 0 in generate_neuroml.py, ## thus mit 2 represents a non-directed conn cell. ## If you want to show asymm inhibition between directed cells, you should use mit 3 below. lateral_mitnum = 2 mitralsidekickidx = lateral_mitnum from pylab import * # part of matplotlib that depends on numpy but not scipy ## Output file name today = datetime.date.today() if NO_SINGLES: singles_str = '_NOSINGLES' else: singles_str = '_SINGLES' if NO_JOINTS: joints_str = '_NOJOINTS' else: joints_str = '_JOINTS' if NO_PGS: pgs_str = '_NOPGS' else: pgs_str = '_PGS' if IN_VIVO: invivo_str = '_invivo' else: invivo_str = '' if DIRECTED: dirt_str = '_directed'+str(FRAC_DIRECTED) else: dirt_str = '' if REVERSED_ADI: rev_str = '_reversed' else: rev_str = '' if ASYM_TEST: asym_str = '_asym' else: asym_str = '' if VOLTAGE_CLAMP: vstr = '_vclamp' else: vstr = '' #now = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M")+'_' now = '' # stable enough to not bother about the date-time of simulation outfilename = '../results/ADI/'+now+'IPSPs_PGvsgran_seed'+netseedstr+mitdistancestr+\ singles_str+joints_str+pgs_str+invivo_str+dirt_str+rev_str+asym_str+vstr+'.pickle' #----------------------------------------------------------- def setup_stim(network): num_spikes = int(10*RUNTIME) if VOLTAGE_CLAMP: mitcell = network.mitralTable[mitralmainidx] mitsoma = moose.Compartment(get_matching_children(mitcell, ['Soma','soma'])[0]) #### I block Ca and K channels in the cell #### We don't want these channels to be active when cell is held at 0mV; Na inactivates. blockChannels(mitcell, ['K','Ca']) # in moose_utils.py ## PID gain: I think for Davison 4-comp-mitral/granule: 0.5e-5 # optimal gain ## too high 0.5e-4 drives it to oscillate at high frequency, ## too low 0.5e-6 makes it have an initial overshoot (due to Na channels?) ## But for BBmit1993, gain of 1e-6 is optimal ## from moose.utils, setup_vclamp(compartment, name, delay1, width1, level1, gain=0.5e-5) network.PIDITable = setup_vclamp(mitsoma, '_somavclamp', 0, RUNTIME, 0e-3, gain=1e-6) ## network.populationDict = ## { 'populationname1':(cellname,{instanceid1:moosecell, ... }) , ... } ## network.projectionDict = ## { 'projectionname1':(source,target,[(syn_name1,pre_seg_path,post_seg_path),...]) , ... } ## PGs are aggregated 5:1 with async synapses. So for every PG spike, there will be 5 IPSCs/IPSPs. if 'PGs' in network.populationDict: PGs = network.populationDict['PGs'][1] PG_conns = network.projectionDict['PG_mitral'][2] num_PG_conns = len(PG_conns) i = 0 while i