Пример #1
0
def load_ordered_edge_list(timestamp, gj_conn_type, trial):
    edge_list = np.loadtxt(utils.cs_edge_list_file(timestamp, gj_conn_type,
                                                   trial),
                           delimiter=",",
                           dtype=np.int)
    edge_list.sort()
    return edge_list
def load_ordered_edge_list(timestamp, gj_conn_type, trial):
    edge_list = np.loadtxt(utils.cs_edge_list_file(timestamp, gj_conn_type, trial),
                           delimiter=",",
                           dtype=np.int)
    edge_list.sort()
    return edge_list
 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]
     edges = []
     for conn in syn_conns:
Пример #4
0
 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
     ]
     edges = []