How to use the allensdk.api.queries.cell_types_api.CellTypesApi function in allensdk

To help you get started, we’ve selected a few allensdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrancoLab / BrainRender / Examples / cell_types.py View on Github external
import matplotlib.pyplot as plt

from allensdk.core.cell_types_cache import CellTypesCache
from allensdk.core.cell_types_cache import CellTypesCache
from allensdk.api.queries.cell_types_api import CellTypesApi
from allensdk.core.cell_types_cache import ReporterStatus as RS
from allensdk.core.swc import Marker


# %matplotlib inline
# %%
cells_flds = "D:\\Dropbox (UCL - SWC)\\Rotation_vte\\analysis_metadata\\anatomy\\Cell Types"

ctc = CellTypesCache(manifest_file=os.path.join(cells_flds, "manifest.json"))
# mouse cells
mouse_cells = ctc.get_cells(species=[CellTypesApi.MOUSE])
print("Mouse cells: %d" % len(mouse_cells))

# cells with reconstructions and no Cre
cells_with_reconstruction = ctc.get_cells(species=[CellTypesApi.MOUSE], require_reconstruction = True, reporter_status = RS.NEGATIVE)
print("Cells with reconstructions: %d" % len(cells_with_reconstruction))



#%%
# download and open an SWC file
cell_id = 480114344
morphology = ctc.get_reconstruction(cell_id) 
markers = ctc.get_reconstruction_markers(cell_id) 

#%%
fig, axes = plt.subplots(1, 2, sharey=True, sharex=True)