allensdk.api.queries.cell_types_api module

class allensdk.api.queries.cell_types_api.CellTypesApi(base_uri=None)[source]

Bases: RmaApi

HUMAN = 'Homo Sapiens'
MARKER_FILE_TYPE = '3DNeuronMarker'
MOUSE = 'Mus musculus'
NWB_FILE_TYPE = 'NWBDownload'
SWC_FILE_TYPE = '3DNeuronReconstruction'
filter_cells(cells, require_morphology, require_reconstruction, reporter_status, species)[source]

Filter a list of cell specimens to those that optionally have morphologies or have morphological reconstructions.

Parameters:
cells: list

List of cell metadata dictionaries to be filtered

require_morphology: boolean

Filter out cells that have no morphological images.

require_reconstruction: boolean

Filter out cells that have no morphological reconstructions.

reporter_status: list

Filter for cells that have a particular cell reporter status

species: list

Filter for cells that belong to one or more species. If None, return all. Must be one of [ CellTypesApi.MOUSE, CellTypesApi.HUMAN ].

filter_cells_api(cells, require_morphology=False, require_reconstruction=False, reporter_status=None, species=None, simple=True)[source]
get_cell(id)[source]

Query the API for a one cells in the Cell Types Database.

Returns:
list

Meta data for one cell.

get_ephys_features()[source]

Query the API for the full table of EphysFeatures for all cells.

get_ephys_sweeps(specimen_id)[source]

Query the API for a list of sweeps for a particular cell in the Cell Types Database.

Parameters:
specimen_id: int

Specimen ID of a cell.

Returns:
list: List of sweep dictionaries belonging to a cell
get_morphology_features()[source]

Query the API for the full table of morphology features for all cells

Notes

by default the tags column is removed because it isn’t useful

list_cells(id=None, require_morphology=False, require_reconstruction=False, reporter_status=None, species=None)[source]

Query the API for a list of all cells in the Cell Types Database.

Parameters:
id: int

ID of a cell. If not provided returns all matching cells.

require_morphology: boolean

Only return cells that have morphology images.

require_reconstruction: boolean

Only return cells that have morphological reconstructions.

reporter_status: list

Return cells that have a particular cell reporter status.

species: list

Filter for cells that belong to one or more species. If None, return all. Must be one of [ CellTypesApi.MOUSE, CellTypesApi.HUMAN ].

Returns:
list

Meta data for all cells.

list_cells_api(id=None, require_morphology=False, require_reconstruction=False, reporter_status=None, species=None)[source]
save_ephys_data(specimen_id, file_name)[source]

Save the electrophysology recordings for a cell as an NWB file.

Parameters:
specimen_id: int

ID of the specimen, from the Specimens database model in the Allen Institute API.

file_name: str

Path to save the NWB file.

save_reconstruction(specimen_id, file_name)[source]

Save the morphological reconstruction of a cell as an SWC file.

Parameters:
specimen_id: int

ID of the specimen, from the Specimens database model in the Allen Institute API.

file_name: str

Path to save the SWC file.

save_reconstruction_markers(specimen_id, file_name)[source]

Save the marker file for the morphological reconstruction of a cell. These are comma-delimited files indicating points of interest in a reconstruction (truncation points, early tracing termination, etc).

Parameters:
specimen_id: int

ID of the specimen, from the Specimens database model in the Allen Institute API.

file_name: str

Path to save the marker file.

simplify_cells_api(cells)[source]