How to use the allensdk.api.queries.cell_types_api.CellTypesApi.MOUSE 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 / brainrender / Utils / AllenMorphologyAPI / AllenMorphology.py View on Github external
def __init__(self, *args, scene_kwargs={},  **kwargs):
		"""
			Initialise API interaction and fetch metadata of neurons in the Allen Database. 
		"""
		if not connected_to_internet():
			raise ConnectionError("You will need to be connected to the internet to use the AllenMorphology class")

		Paths.__init__(self, *args, **kwargs)
		self.scene = Scene(add_root=False, display_inset=False, **scene_kwargs)

		# Create a Cache for the Cell Types Cache API
		self.ctc = CellTypesCache(manifest_file=os.path.join(self.morphology_allen, 'manifest.json'))

		# Get a list of cell metadata for neurons with reconstructions, download if necessary
		self.neurons = pd.DataFrame(self.ctc.get_cells(species=[CellTypesApi.MOUSE], require_reconstruction = True))
		self.n_neurons = len(self.neurons)
		if not self.n_neurons: raise ValueError("Something went wrong and couldn't get neurons metadata from Allen")

		self.downloaded_neurons = self.get_downloaded_neurons()
github BrancoLab / BrainRender / Examples / cell_types.py View on Github external
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)
axes[0].set_aspect('equal', 'box-forced')
axes[1].set_aspect('equal', 'box-forced')

# Make a line drawing of x-y and y-z views