Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)