Пример #1
0
def get_manifest_args(args):
    return runner.load_description(args)
#Based on example code at: http://alleninstitute.github.io/AllenSDK/biophysical_perisomatic_script.html
    
from allensdk.model.biophysical.utils import Utils
from allensdk.model.biophysical.runner import load_description

import sys
import json

sys.path.append('../../data')
from data_helper import get_test_sweep
    
description = load_description('manifest.json')

# configure NEURON
utils = Utils(description)
h = utils.h

print("NEURON configured")

# configure model
morphology_path = description.manifest.get_path('MORPHOLOGY')
utils.generate_morphology(morphology_path.encode('ascii', 'ignore'))
utils.load_cell_parameters()

print("Cell loaded from: %s"%morphology_path)

# configure stimulus and recording
stimulus_path = description.manifest.get_path('stimulus_path')

run_params = description.data['runs'][0]
Пример #3
0
clear_neuron()
    
count = 0

ca_dynamics = {}

for model_id in cell_dirs:
    
    if os.path.isdir(model_id):
        os.chdir(model_id)
    else:
        os.chdir('../'+model_id)
        
    print('\n\n************************************************************\n\n    Parsing %s (cell %i/%i)\n'%(model_id, count, len(cell_dirs)))
    
    description = load_description('manifest.json')

    # configure NEURON
    utils = Utils(description)
    h = utils.h

    print("NEURON configured")

    # configure model
    manifest = description.manifest
    morphology_path = description.manifest.get_path('MORPHOLOGY')
    utils.generate_morphology(morphology_path.encode('ascii', 'ignore'))
    utils.load_cell_parameters()
    
    with open('manifest.json', "r") as json_file:
        manifest_info = json.load(json_file)
Пример #4
0
import numpy as np
from allensdk.model.biophysical import runner
import json
from allensdk.ephys.ephys_extractor import EphysSweepSetFeatureExtractor
from scipy.interpolate import interp1d

typical_wave = pickle.load(open('typical_wave.p', 'rb'))
xnew = np.linspace(0,
                   float(np.max(typical_wave.times)),
                   num=len(typical_wave.times),
                   endpoint=True)

with open('manifest.json', 'r') as content:
    cell_d = json.load(content)
print(cell_d)
description = runner.load_description('manifest.json')
(vm, time) = runner.run(description)
#runner.extract_cell_features.mean_features_spike_zero(vm)

transform_function = interp1d([float(t) for t in vm], [float(v) for v in time])
print(len(xnew))
print(len(vm))
import pdb

pdb.set_trace()
vm_new = transform_function(
    xnew)  #% generate the y values for all x values in xnew
print(vm_new)
#print(len(vm_new))
#self.vM = AnalogSignal(vm_new,units = mV,sampling_period = float(xnew[1]-xnew[0]) * pq.s)