BrainHack

101

:

A Beginners Guide to Computational Neuroscience

Greg Kiar & the BrainHack Team

Outline

  • the objective
  • the tools
    • github
    • docker
    • jupyter
    • ...
  • analyze connectomes
  • visualize the results

we have...

  • an overwhelming amount of neuroscience data
  • a myriad of tools
  • a growing need for (basic) coding

... and we want to...

  • process lots of data
  • perform robust analyses
  • learn and communicate our results
  • share our methods
  • enable others to build upon our work

..., but...

  • code can be unorganized and hard to use
  • tools give different answers across versions
  • differences across operating systems are confusing
  • reproducing analyses is often difficult
  • this sounds like it requires lots of programming

...; thankfully...

  • tools exist to help with these problems
  • we're in BrainHack 101 :smirk:

major challenges

  1. code is often unorganized, unversioned, and undocumented
  2. installation is difficult and operating systems can cause differences
  3. communicating and reproducing analyses is often difficult or incomplete

approach

1. FOR (each_challenge):
2.  discuss_problem;
3.  describe_solution;
4.  learn_about_tools;
5.  practice;
6. ENDFOR

challenge 1:

code sharing

  • how do you share it?
  • what happens when you make changes?
  • what if there are bugs?
  • how do you get credit?

features we want

  • code hosted in the cloud
  • version control and change tracking
  • mechanism for receiving feedback
  • possibility of attaching a DOI

tools to help

  • Github
  • Zenodo

Github

... has a great getting started guide

Before jumping in, we'll quickly demonstrate Github as a solution for our problem

cloud-hosted code

versions and changes

versions history

feedback

history

zenodo

jumping in

head back up to the guide and start playing

your objective is to:

  1. create a repo
  2. add a license
  3. add "code"
  4. create a version
  5. create an issue
  6. add hook for Zenodo

challenge 2:

tool portability

  • how can you make it work acoss OS?
  • how can you make install easy?
  • how can you make it clear what version you're using?

features we want

  • agnostic to OS
  • one-click installation
  • version control

tools to help

  • Docker
  • CircleCI/TravisCI*


*we mention continuous integration (CI) here and provide resources, but it is beyond the scope of what we cover in class.

Docker

... also has a great getting started guide

Let's again demonstrate how Docker is a suitable answer to our problem, then play

OS agnostic

one-click install

version control

history

continuous integration

history history

trying it out

head back up, click on the guide, and give it a shot

your task is to:

  1. install Docker
  2. launch + run "hello, world!"
  3. create Dockerhub account
  4. create simple Dockerfile
  5. build your image
  6. push image to Dockerhub
  7. push Dockerfile to GitHub
  8. (bonus) link with CI

challenge 3:

reproducible analyses

  • how can you make your analysis reproducible?
  • how can you communicate it clearly?
  • how can you demonstrate the robustness of your analyses?

features we want

  • simple execution-interface
  • text annotations of analyses
  • interactive widgets

tools to help

  • Jupyter
  • Jupyter Widgets


jupyter

... has several resources to help you get started with Jupyter and widgets.

We are going to demonstrate using Jupyter with Python, but it works with other languages as well

execution interface

history

text annotations

history

interactive widgets

history

trying it out

Go back to the documentation, click on the guide, and play!

your task is to:

  1. install Jupyter and Jupyter Widgets
  2. launch a Jupyter server
  3. create a Jupyter notebook
  4. use a Jupyter widget in your notebook
  5. push your notebook to GitHub

tying it together

Now that you have learned all of these tools, your challenge is to create and share a reproducible and open analysis including the following:

  • code on Github
  • data somewhere public*
  • environment in a Dockerfile
  • interactive plot/analysis in Jupyter

*"where" depends on the data; ask me first:smile:

there are resources

For each of these steps, there is an example in the scratch the dura repository which can help, as well as everything you've done so far.

There is also suggested data that can serve as a nice starting place for some cool graph analyses in this repo

closing remarks

you are all awesome, did awesome, and I hope you enjoyed yourselves!

learn more with some of these helpful links

please always reach out with any questions!

githubgkiar
emailgreg.kiar@mcgill.ca
emailg_kiar

Thank you!!!

Acknowledgements

email email email email email email email email email email ......