allensdk.api.queries.biophysical_api module¶
- class allensdk.api.queries.biophysical_api.BiophysicalApi(base_uri=None)[source]¶
Bases:
RmaTemplate
- BIOPHYSICAL_MODEL_TYPE_IDS = (491455321, 329230710)¶
- build_rma(neuronal_model_id, fmt='json')[source]¶
Construct a query to find all files related to a neuronal model.
- Parameters:
- neuronal_model_idinteger or string representation
key of experiment to retrieve.
- fmtstring, optional
json (default) or xml
- Returns:
- string
RMA query url.
- cache_data(neuronal_model_id, working_directory=None)[source]¶
Take a an experiment id, query the Api RMA to get well-known-files download the files, and store them in the working directory.
- Parameters:
- neuronal_model_idint or string representation
found in the neuronal_model table in the api
- working_directorystring
Absolute path name where the downloaded well-known files will be stored.
- create_manifest(fit_path='', model_type='', stimulus_filename='', swc_morphology_path='', marker_path='', sweeps=[])[source]¶
Generate a json configuration file with parameters for a a biophysical experiment.
- Parameters:
- fit_pathstring
filename of a json configuration file with cell parameters.
- stimulus_filenamestring
path to an NWB file with input currents.
- swc_morphology_pathstring
file in SWC format.
- sweepsarray of integers
which sweeps in the stimulus file are to be used.
- get_neuronal_models(specimen_ids, num_rows='all', count=False, model_type_ids=None, **kwargs)[source]¶
Fetch all of the biophysically detailed model records associated with a particular specimen_id
- Parameters:
- specimen_idslist
One or more integer ids identifying specimen records.
- num_rowsint, optional
how many records to retrieve. Default is ‘all’.
- countbool, optional
If True, return a count of the lines found by the query. Default is False.
- model_type_idslist, optional
One or more integer ids identifying categories of neuronal model. Defaults to all-active and perisomatic biophysical_models.
- Returns:
- List of dict
Each element is a biophysical model record, containing a unique integer id, the id of the associated specimen, and the id of the model type to which this model belongs.
- get_well_known_file_ids(neuronal_model_id)[source]¶
Query the current RMA endpoint with a neuronal_model id to get the corresponding well known file ids.
- Returns:
- list
A list of well known file id strings.
- is_well_known_file_type(wkf, name)[source]¶
Check if a structure has the expected name.
- Parameters:
- wkfdict
A well-known-file structure with nested type information.
- namestring
The expected type name
See also
read_json
where this helper function is used.
- read_json(json_parsed_data)[source]¶
Get the list of well_known_file ids from a response body containing nested sample,microarray_slides,well_known_files.
- Parameters:
- json_parsed_datadict
Response from the Allen Institute Api RMA.
- Returns:
- list of strings
Well known file ids.
- rma_templates = {'model_queries': [{'name': 'models_by_specimen', 'description': 'see name', 'model': 'NeuronalModel', 'num_rows': 'all', 'count': False, 'criteria': '[neuronal_model_template_id$in{{biophysical_model_types}}],[specimen_id$in{{specimen_ids}}]', 'criteria_params': ['specimen_ids', 'biophysical_model_types']}]}¶