AllenInstitute / AllenSDK

code for reading and processing Allen Institute for Brain Science data
https://allensdk.readthedocs.io/en/latest/
Other
336 stars 149 forks source link

How to exhaustively download and instance all the conductance based neuron models? #415

Open russelljjarvis opened 5 years ago

russelljjarvis commented 5 years ago

I am trying to exhaustively download and instance all the conductance based neuron models, and then instantiate them as NEURON simulator models. I am trying the code below, but I am running into errors

def run_all_cell_bio_configs():
    try:
        with open('all_allen_cells.p','rb') as f:
            cells = pickle.load(f)

    except:
        ctc = CellTypesCache(manifest_file='cell_types/manifest.json')
        cells = ctc.get_cells()
        with open('all_allen_cells.p','wb') as f:
            pickle.dump(cells,f)
    bp = BiophysicalApi()

    #bp.cache_stimulus = False # change to False to not download the large stimulus NWB file
    #neuronal_model_id = 472451419    # get this from the web site as above
    for cell in cells:
        #import pdb; pdb.set_trace()
        try:
            bp.cache_data(cell['id'], working_directory='.')
            os.subprocess('nrnivmodl ./modfiles')   # compile the model (only needs to be done once)
            #import pdb; pdb.set_trace()
            print(runner)
        except:
            pass

    return cells

def allen_morph_model(description):
    utils = Utils.create_utils(description)
    h = utils.h

    #The next step is to get the path of the morphology file and pass it to NEURON.

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

@russelljjarvis would you mind including the errors/traceback in your issue description?