コード例 #1
0
ファイル: build_network.py プロジェクト: tjbanks/bmtk
    'morphology': 'Pvalb_469628681_m.swc',
    'model_template': 'nml:Cell_473862421.cell.nml'
}]

point_models = [{
    'model_name': 'LIF_exc',
    'ei': 'e',
    'dynamics_params': 'IntFire1_exc_1.json'
}, {
    'model_name': 'LIF_inh',
    'ei': 'i',
    'dynamics_params': 'IntFire1_inh_1.json'
}]

morphologies = {
    p['model_name']: SWCReader(
        os.path.join('../biophys_components/morphologies', p['morphology']))
    for p in bio_models
}


def build_edges(src,
                trg,
                sections=['basal', 'apical'],
                dist_range=[50.0, 150.0]):
    """Function used to randomly assign a synaptic location based on the section (soma, basal, apical) and an
    arc-length dist_range from the soma. This function should be passed into the network and called during the build
    process.

    :param src: source cell (dict)
    :param trg: target cell (dict)
    :param sections: list of target cell sections to synapse onto
コード例 #2
0
        'dynamics_params': 'NONE' if use_nml else 'json/473863035_fit.json'
    }
]

cortex = NetworkBuilder("cortex")
for i, model_props in enumerate(cell_models):
    cortex.add_nodes(N=3,
                     x=[i*30.0 + j for j in range(3)],  y=[0.0]*3, z=[0.0]*3,  # space cells every 10nm along x axs
                     model_type='biophysical',
                     model_processing='aibs_perisomatic',
                     **model_props)

cortex.build()
cortex.save_nodes(output_dir='network')

morphologies = {p['model_name']: SWCReader(os.path.join('../shared_components/morphologies', p['morphology']))
                for p in cell_models}


def build_edges(src, trg, sections=['basal', 'apical'], dist_range=[50.0, 150.0]):
    # Get morphology and soma center for the target cell
    swc_reader = morphologies[trg['model_name']]
    target_coords = [trg['x'], trg['y'], trg['z']]

    sec_ids, sec_xs = swc_reader.choose_sections(sections, dist_range)  # randomly choose sec_ids
    coords = swc_reader.get_coord(sec_ids, sec_xs, soma_center=target_coords)  # get coords of sec_ids
    dist = swc_reader.get_dist(sec_ids)
    swctype = swc_reader.get_type(sec_ids)
    return sec_ids, sec_xs, coords[0][0], coords[0][1], coords[0][2], dist[0], swctype[0]

# Feedfoward excitatory virtual cells
コード例 #3
0
ファイル: build_network.py プロジェクト: vogdb/sonata
        'morphology': 'Nr5a1_471087815_m',
        'model_template': 'nml:Cell_473863035.cell.nml'
    },
    {
        'model_name': 'PV1', 'ei': 'i',
        'morphology': 'Pvalb_470522102_m',
        'model_template': 'nml:Cell_472912177.cell.nml'
    },
    {
        'model_name': 'PV2', 'ei': 'i',
        'morphology': 'Pvalb_469628681_m',
        'model_template': 'nml:Cell_473862421.cell.nml'
    }
]

morphologies = {p['model_name']: SWCReader(os.path.join('../shared_components/morphologies',
                                                        '{}.swc'.format(p['morphology'])))
                for p in cell_models}
def build_edges(src, trg, sections=['basal', 'apical'], dist_range=[50.0, 150.0]):
    """Function used to randomly assign a synaptic location based on the section (soma, basal, apical) and an
    arc-length dist_range from the soma. This function should be passed into the network and called during the build
    process.

    :param src: source cell (dict)
    :param trg: target cell (dict)
    :param sections: list of target cell sections to synapse onto
    :param dist_range: range (distance from soma center) to place
    :return:
    """
    # Get morphology and soma center for the target cell
    swc_reader = morphologies[trg['model_name']]
    target_coords = [trg['x'], trg['y'], trg['z']]