Пример #1
0
    for (t,v1,v2) in zip(h.tlog,h.Vlog1,h.Vlog2):
        f.write("%f %f %f\n" % (t,v1,v2))
    f.close()
    

@click.command()
@click.option("--template-path", required=True, type=click.Path(exists=True, file_okay=False, dir_okay=True))
@click.option("--forest-path", required=True, type=click.Path(exists=True, file_okay=True, dir_okay=False))
def main(template_path,forest_path):
    
    comm = MPI.COMM_WORLD
    rank = comm.Get_rank()

    h('objref nil, pc, tlog, Vlog, spikelog')
    h.load_file("nrngui.hoc")
    h.xopen("./lib.hoc")
    h.xopen ("./tests/rn.hoc")
    h.xopen(template_path+'/MOPPCell.hoc')
    h.pc = h.ParallelContext()
    
    popName = "MOPP"
    (trees,_) = read_tree_selection (comm, forest_path, popName, [1052650])
    
    tree = next(iter(viewvalues(trees)))
    
    passive_test(tree,-60)
    ap_rate_test(tree,-60)

if __name__ == '__main__':
    main(args=sys.argv[(utils.list_find(lambda s: s.find("MOPPCellTest.py") != -1,sys.argv)+1):])
Пример #2
0
    else:
        if t_min is None:
            time_range = [0.0, t_max]
        else:
            time_range = [t_min, t_max]

    if not populations:
        populations = ['eachPop']

    plot.plot_spike_histogram(spike_events_path,
                              spike_events_namespace,
                              include=populations,
                              time_variable=t_variable,
                              time_range=time_range,
                              pop_rates=True,
                              bin_size=bin_size,
                              smooth=smooth,
                              quantity=quantity,
                              fontSize=font_size,
                              overlay=overlay,
                              graph_type=graph_type,
                              progress=progress,
                              saveFig=True,
                              figFormat=save_format)


if __name__ == '__main__':
    main(args=sys.argv[(
        utils.list_find(lambda x: os.path.basename(x) == script_name, sys.argv
                        ) + 1):])
Пример #3
0
@click.option("--font-size", type=float, default=14)
@click.option("--verbose", "-v", type=bool, default=False, is_flag=True)
def main(config, config_prefix, connectivity_path, coords_path,
         vertex_metrics_namespace, distances_namespace, destination, sources,
         normed, metric, graph_type, bin_size, font_size, verbose):

    utils.config_logging(verbose)
    logger = utils.get_script_logger(script_name)

    env = Env(config_file=config, config_prefix=config_prefix)

    plot.plot_vertex_metrics(env,
                             connectivity_path,
                             coords_path,
                             vertex_metrics_namespace,
                             distances_namespace,
                             destination,
                             sources,
                             metric=metric,
                             normed=normed,
                             bin_size=bin_size,
                             fontSize=font_size,
                             graph_type=graph_type,
                             saveFig=True)


if __name__ == '__main__':
    main(args=sys.argv[(utils.list_find(
        lambda x: os.path.basename(x) == os.path.basename(script_name), sys.
        argv) + 1):])
Пример #4
0
import click
from dentate import env
from dentate import io_utils
from dentate import utils
from env import Env


@click.command()
@click.option("--config",
              '-c',
              required=True,
              type=click.Path(exists=True, file_okay=True, dir_okay=False))
@click.option("--output-path",
              default='dentate_h5types.h5',
              type=click.Path(exists=False, file_okay=True, dir_okay=False))
@click.option("--template-path",
              required=True,
              type=click.Path(exists=True, file_okay=False, dir_okay=True))
@click.option('--gap-junctions', is_flag=True)
def main(config, output_path, template_path, gap_junctions):

    env = Env(config_file=config, template_paths=template_path)
    io_utils.make_h5types(env, output_path, gap_junctions=gap_junctions)


if __name__ == '__main__':
    main(args=sys.argv[(utils.list_find(
        lambda x: os.path.basename(x) == os.path.basename(__file__), sys.argv
    ) + 1):])
Пример #5
0
@click.option("--distances-namespace", '-t', type=str, default='Arc Distances')
@click.option("--metric", type=str, default='dendrite_length')
@click.option("--metric-index", type=int, default=0)
@click.option("--percentile", type=float)
#@click.option("--normed", type=bool, default=False, is_flag=True)
@click.option("--font-size", type=float, default=14)
@click.option("--verbose", "-v", type=bool, default=False, is_flag=True)
def main(config, config_prefix, forest_path, coords_path, population,
         metric_namespace, distances_namespace, metric, metric_index,
         percentile, font_size, verbose):

    env = Env(config_file=config, config_prefix=config_prefix)

    plot.plot_tree_metrics(env,
                           forest_path,
                           coords_path,
                           population,
                           metric_namespace,
                           distances_namespace,
                           metric=metric,
                           metric_index=metric_index,
                           percentile=percentile,
                           fontSize=font_size,
                           saveFig=True,
                           verbose=verbose)


if __name__ == '__main__':
    main(args=sys.argv[(
        utils.list_find(lambda s: s.find(script_name) != -1, sys.argv) + 1):])
Пример #6
0
                        if isinstance(param_rst, dict):
                            for const_name, const_range in sorted(
                                    viewitems(param_rst)):
                                param_path = (param_fst, const_name)
                                param_tuples.append(
                                    SynParam(pop_name, source, sec_type,
                                             syn_name, param_path,
                                             const_range))
                                param_key = '%s.%s.%s.%s.%s.%s' % (
                                    pop_name, str(source), sec_type, syn_name,
                                    param_fst, const_name)
                                param_names.append(param_key)
                        else:
                            param_name = param_fst
                            param_range = param_rst
                            param_tuples.append(
                                SynParam(pop_name, source, sec_type, syn_name,
                                         param_name, param_range))
                            param_key = '%s.%s.%s.%s.%s' % (pop_name, source,
                                                            sec_type, syn_name,
                                                            param_name)
                            param_names.append(param_key)

    return ParamSpec(param_names=param_names, param_tuples=param_tuples)


if __name__ == '__main__':
    main(args=sys.argv[(
        list_find(lambda x: os.path.basename(x) == os.path.basename(__file__),
                  sys.argv) + 1):])
Пример #7
0
    (trees, _) = read_tree_selection(forest_path, popName, [gid], comm=comm)
    if synapses_path is not None:
        synapses_iter = read_cell_attribute_selection (synapses_path, popName, [gid], \
                                                       "Synapse Attributes", comm=comm)
    else:
        synapses_iter = None

    gid, tree = next(trees)
    if synapses_iter is not None:
        (_, synapses) = next(synapses_iter)
    else:
        synapses = None

    if 'mech_file' in env.celltypes[popName]:
        mech_file_path = env.config_prefix + '/' + env.celltypes[popName][
            'mech_file']
    else:
        mech_file_path = None

    template_class = getattr(h, "MossyCell")

    if (synapses is not None):
        synapse_test(template_class, mech_file_path, gid, tree, synapses,
                     v_init, env)


if __name__ == '__main__':
    main(args=sys.argv[(
        utils.list_find(lambda s: s.find("MossyCellTest.py") != -1, sys.argv) +
        1):])
Пример #8
0
                            gid=gid,
                            load_edges=load_edges,
                            load_weights=load_weights,
                            mech_file_path=mech_file_path)
    context.update(locals())

    init_biophysics(cell,
                    reset_cable=True,
                    correct_cm=correct_for_spines,
                    correct_g_pas=correct_for_spines,
                    env=env,
                    verbose=verbose)
    init_syn_mech_attrs(cell, env)
    config_biophys_cell_syns(env,
                             gid,
                             pop_name,
                             insert=True,
                             insert_netcons=True,
                             insert_vecstims=True,
                             verbose=verbose)

    if verbose:
        report_topology(cell, env)


if __name__ == '__main__':
    main(args=sys.argv[(
        list_find(lambda s: s.find(os.path.basename(__file__)) != -1, sys.argv
                  ) + 1):],
         standalone_mode=False)
Пример #9
0
    pop_name = "BC"
    gid = 1039000
    (trees_dict, _) = read_tree_selection(forest_path,
                                          pop_name, [gid],
                                          comm=env.comm)
    synapses_dict = read_cell_attribute_selection(synapses_path,
                                                  pop_name, [gid],
                                                  "Synapse Attributes",
                                                  comm=env.comm)

    (_, tree) = next(trees_dict)
    (_, synapses) = next(synapses_dict)

    v_init = -60

    template_class = getattr(h, "BasketCell")

    ap_test(template_class, tree, v_init)
    passive_test(template_class, tree, v_init)
    ap_rate_test(template_class, tree, v_init)
    fi_test(template_class, tree, v_init)
    gap_junction_test(env, template_class, tree, v_init)
    synapse_test(template_class, gid, tree, synapses, v_init, env)


if __name__ == '__main__':
    main(args=sys.argv[(
        utils.list_find(lambda s: s.find("BasketCellTest.py") != -1, sys.argv
                        ) + 1):])
Пример #10
0
    (trees, _) = read_tree_selection(forest_path, pop_name, [gid], comm=comm)
    if synapses_path is not None:
        synapses_dict = read_cell_attribute_selection (synapses_path, pop_name, [gid], \
                                                       "Synapse Attributes", comm=comm)
    else:
        synapses_dict = None

    gid, tree = next(trees)
    if synapses_dict is not None:
        (_, synapses) = next(synapses_dict)
    else:
        synapses = None

    if 'mech_file' in env.celltypes[pop_name]:
        mech_file_path = env.config_prefix + '/' + env.celltypes[pop_name][
            'mech_file']
    else:
        mech_file_path = None

    template_class = getattr(h, "DGC")

    if (synapses is not None):
        synapse_test(template_class, mech_file_path, gid, tree, synapses,
                     v_init, env)


if __name__ == '__main__':
    main(args=sys.argv[(
        utils.list_find(lambda s: s.find("GranuleCellTest.py") != -1, sys.argv
                        ) + 1):])
Пример #11
0
              type=click.Path(exists=True, file_okay=False, dir_okay=True))
@click.option("--forest-path",
              required=True,
              type=click.Path(exists=True, file_okay=True, dir_okay=False))
def main(template_path, forest_path):

    comm = MPI.COMM_WORLD
    rank = comm.Get_rank()

    h('objref nil, pc, tlog, Vlog, spikelog')
    h.load_file("nrngui.hoc")
    h.xopen("./lib.hoc")
    h.xopen("./tests/rn.hoc")
    h.xopen(template_path + '/AxoAxonicCell.hoc')
    h.pc = h.ParallelContext()

    popName = "AAC"
    (trees, _) = read_tree_selection(comm, forest_path, popName, [1042800])

    tree = next(iter(viewvalues(trees)))

    passive_test(tree, -60)
    ap_rate_test(tree, -60)
    gap_junction_test(tree, -60)


if __name__ == '__main__':
    main(args=sys.argv[(
        utils.list_find(lambda s: s.find("AxoAxonicCellTest.py") != -1, sys.
                        argv) + 1):])