def load_positions(timestamp, gj_conn_type, trial): positions = np.loadtxt(utils.cs_cell_positions_file(timestamp, gj_conn_type, trial), delimiter=",") return positions
for gj_conn_type in ['2010', '2012']: sim_config_name = 'coupling_strength_' + gj_conn_type + 'gap' sim_config = project.simConfigInfo.getSimConfig(sim_config_name) project.neuronSettings.setNoConsole() for trial in range(n_trials): print('=====new trial: regenerating network=====') # generate nC_seed = Long(random.getrandbits(32)) pm.doGenerate(sim_config_name, nC_seed) while pm.isGenerating(): time.sleep(0.02) print('network generated') ##=== save network structure === cell_positions_file = open( utils.cs_cell_positions_file(timestamp, gj_conn_type, trial), 'wb') edge_list_file = open( utils.cs_edge_list_file(timestamp, gj_conn_type, trial), 'wb') cell_positions_writer = csv.writer(cell_positions_file) edge_list_writer = csv.writer(edge_list_file) # extract connectivity structure if gj_conn_type == '2010': conn_names = ['GJ2010_reduced_TTX'] elif gj_conn_type == '2012': conn_names = [ 'GJ_reduced_TTX_GCL', 'GJ_reduced_TTX_ML1', 'GJ_reduced_TTX_ML2', 'GJ_reduced_TTX_ML3' ] syn_conns = [ project.generatedNetworkConnections.getSynapticConnections(conn) for conn in conn_names
for gj_conn_type in ['2010', '2012']: sim_config_name = 'coupling_strength_' + gj_conn_type + 'gap' sim_config = project.simConfigInfo.getSimConfig(sim_config_name) project.neuronSettings.setNoConsole() for trial in range(n_trials): print('=====new trial: regenerating network=====') # generate nC_seed = Long(random.getrandbits(32)) pm.doGenerate(sim_config_name, nC_seed) while pm.isGenerating(): time.sleep(0.02) print('network generated') ##=== save network structure === cell_positions_file = open(utils.cs_cell_positions_file(timestamp, gj_conn_type, trial), 'wb') edge_list_file = open(utils.cs_edge_list_file(timestamp, gj_conn_type, trial), 'wb') cell_positions_writer = csv.writer(cell_positions_file) edge_list_writer = csv.writer(edge_list_file) # extract connectivity structure if gj_conn_type == '2010': conn_names = ['GJ2010_reduced_TTX'] elif gj_conn_type == '2012': conn_names = ['GJ_reduced_TTX_GCL', 'GJ_reduced_TTX_ML1', 'GJ_reduced_TTX_ML2',
def load_positions(timestamp, gj_conn_type, trial): positions = np.loadtxt(utils.cs_cell_positions_file( timestamp, gj_conn_type, trial), delimiter=",") return positions