Accessing the AllenSDK with Jupyter Notebooks

We could spend all day going through the cells in the website database to find some interesting comparisons. But, it’s much quicker to do these comparisons by accessing the entire database directly, through the Allen Software Development Kit (SDK).

There's an interactive walkthrough of these materials the second half of the video at right.

If you’re at UC San Diego, you should run this code on the UCSD Data Hub (Option 2 below). Otherwise, you can run it on Binder, or locally on your computer.

Option 1: From Colab or Binder

This is the easiest option (if you’re not in one of my courses at UCSD), though the code itself may run more slowly and you'll need to install some packages within the notebooks. Simply click either of the images at right to launch a dashboard containing both notebooks.

Once you’re done with the Introduction to Jupyter Notebook, open one of the CellTypesLesson notebooks.

Saving your work in Colab

If you'd like to save your work in Google Colaboratory, follow these steps:

  1. In Colab, go to File > Save. This will save the notebook in your Google Drive.

  2. In your Google Drive, look for a folder called "Colab Notebooks." Open it.

  3. In this folder, you should see your saved copy of the notebook. Click on it, and at the top choose "Open in Google Colaboratory."

Option 2: From the UCSD Data Hub

This option is for UC San Diego students.

  1. Go to https://datahub.ucsd.edu/hub/user-redirect/git-sync?repo=https://github.com/ajuavinett/CellTypesLesson.

  2. If necessary, log in with your UCSD credentials.

  3. You’ll land on a page where you’re asked to choose a container to spawn. Choose the container with your course name..

  4. On the Jupyter dashboard, you should seeIntroduction to Jupyter Notebooks” From here, you can follow the directions in the Jupyter Notebook.

  5. Once you're done with the introductory notebook, open the one of the CellTypesLesson notebooks.

  6. Note: When you’re done, go to the Running tab and Shutdown all of your terminal & notebook processes (see orange "Shutdown button":

Option 3: From a local computer

If you’d like to access the SDK locally, follow these steps. Note: If you’re in BIPN145, you should do this lab through the Data Hub (Option 2 above).

  1. Make sure that you have the Anaconda Python 3.7 distribution installed on your computer.

  2. If necessary, install Git on your computer. You can click “Next” through all of the options.

  3. If you're using Windows, open an Anaconda Prompt window. This will open a new Python terminal. If you're using a Mac, open a Terminal window.

    • Hint: Search for “Anaconda” in Windows and you should see come up as an option. Similarly, you can search for Terminal in Mac.

  4. Change directories into your Documents folder by typing cd Documents

    • Note: Depending on which directory your Anaconda Prompt / Terminal Window opens in, this step may or may not work. If you're having issues, simply skip to the next step.

  5. Next, we’ll clone the necessary Python notebooks into your Documents directory. Type git clone http://www.github.com/ajuavinett/CellTypesLesson.git to clone the lab codebase into your folder.

  6. Next, we need to install the allenSDK tools. In your Anaconda Prompt / Terminal Window, type pip install --user allenSDK If you receive an error, try pip install allenSDK. You can find additional instructions on installing the SDK here.

  7. After the AllenSDK package has installed, you can open Jupyter Notebook in two ways:

    • In Terminal, type jupyter notebook

    • Open the Anaconda Navigator, and click on Jupyter Notebook.

  8. A Jupyter Notebook landing page (the Dashboard) should open.

  9. On the dashboard, you should now see a folder CellTypesLesson. Click into it, and open “Introduction to Jupyter Notebooks” From here, you can follow the directions in the Jupyter Notebook.

  10. Once you're done with the introductory notebook, open one of the CellTypesLesson notebooks.


Cell Types Lesson Roadmap

Understand how the data was collected.

Access the Allen Cell Types Dataset on their website. In this part, you can use the web interface to look at raw electrophysiology recordings and biocytin fills from mouse and human cells.


Learn about the basics of coding & using Jupyter notebooks. If you'd like to learn a bit of Python, this is a great chance to do so!

Analyze data through the Allen Software Development Kit (SDK)