How to study the entire brain
Daniel Fürth
Meletis Lab
DMC lab meeting
17th April 2015
daniel.furth@ki.se
Why studying the whole brain
Why studying the whole brain
Corticospinal axons encode the direction and amplitude of muscle force rather than the direction of displacement. (Evarts, 1968)
Why studying the whole brain
Why studying the whole brain
Why studying the whole brain
Do we really have a 'BigData' problem in neuroscience?
I will define as big data anything that exceeds the size of a standard laptop hard drive. (Engert, 2014)
a mouse brain contains 500 x 10^9 cubic micron pixels, and if we want to record all of them for 20 min (1,000 s) at 1000 Hz, we again have 500 petabytes of raw data.
Do we really have a 'BigData' problem in neuroscience?
Do we really have a BigData problem in neuroscience?
Do we really have a 'BigData' problem in neuroscience?
Do we really have a BigData problem in neuroscience?
# find the location relative to the thunder installation
import os.path as pth
imagepath = pth.join(pth.dirname(pth.realpath(thunder.__file__)), 'utils/data/fish/tif-stack')
# load the images
data = tsc.loadImages(imagepath, inputformat='tif-stack')
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('white')
sns.set_context('notebook')
img = data.first()[1]
plt.imshow(img[:,:,0], cmap="gray");
Freeman et al. (2014) Nat. Methods.
Do we really have a 'BigData' problem in neuroscience?
Do we really have a BigData problem in neuroscience?
# find the location relative to the thunder installation
import os.path as pth
imagepath = pth.join(pth.dirname(pth.realpath(thunder.__file__)), 'utils/data/fish/tif-stack')
# load the images
data = tsc.loadImages(imagepath, inputformat='tif-stack')
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('white')
sns.set_context('notebook')
img = data.first()[1]
plt.imshow(img[:,:,0], cmap="gray");
Freeman et al. (2014) Nat. Methods.
18534 x 27653 pixels
Do we really have a 'BigData' problem in neuroscience?
Twitter and Flickr have a 'BigData' problem: Tweets Flickr photos
The day before Christmas more photos are uploaded to Facebook than all photos on Flickr combined.
New York
Tokyo
Barcelona
New Orleans
Do we really have a 'BigData' problem in neuroscience?
Do we really have a 'BigData' problem in neuroscience?
http://www.parallac.org/
10 computers (146 processors)
Up to 64 cores per processor!
Freeman et al. (2014) Nature Methods
Pollak Dorocic et al. 2014
Reconstructing brain from sectioned tissue
Some problems with Allen's atlas
Non-Uniform Rational B-splines (NURBS)
NURBS surface
similar to...
works with...
NATURE BIOTECHNOLOGY | COMPUTATIONAL BIOLOGY | ANALYSIS
Kaia Achim, Jean-Baptiste Pettit, Luis R Saraiva, Daria Gavriouchkina, Tomas Larsson, Detlev Arendt & John C Marioni
Allen Brain Reference Atlas
Allen Brain Reference Atlas
Anatomic Gene Expression Atlas
Lydia Ng, et al. (2009) Nat. Neuro.
http://mouse.brain-map.org/agea
LIM-homeodomain 6 (Lhx6)
General marker for cortical interneurons
Migratory deficit of Lhx6-deficient MGE cells.
Liodis et al. 2007
LIM-homeodomain 6 (Lhx6)
Our approach
Our approach
LIM-homeodomain 6 (Lhx6)
Allen Brain Reference Atlas
Connectivity average template (Ng et al. 2014)
Allen Brain Reference Atlas
Connectivity average template (Ng et al. 2014)
Basic idea:
A
B
C
Independent
variable
Dependent
variable
Mediator
variable
Mediational statistical analysis
Basic idea.
A
B
C
cocaine
dosage
(mg/ml)
Behavior
total track length (cm)
c-fos expression
(ith region)
direct effect
indirect effect
mediating effect
Question: How much of the behavioral variability is explained by variability in c-fos expression?
Kourrich, Calu & Bonci (2015)
Some problems with unspecific binding.
Flat-field
Dark image
Some problems with unspecific binding
Can be used to segment iut processes and their direction.
xx <- faithful$eruptions
fit <- density(xx)
plot(fit)
#Line 1: loading
xx <- faithful$eruptions
#Line 2: estimate density
fit1 <- density(xx)
#Line 2: draw 10'000 bootstraps
fit2 <- replicate(10000, {
x <- sample(xx,replace=TRUE);
density(x, from=min(fit1$x), to=max(fit1$x))$y
})
#Line 3: compute 95% error "bars"
fit3 <- apply(fit2, 1, quantile,c(0.025,0.975))
#Line 4: plot the estimate
plot(fit1, ylim=range(fit3))
#Line 5: add estimation error as shaded region
polygon(c(fit1$x,rev(fit1$x)), c(fit3[1,], rev(fit3[2,])), col=’grey’, border=F)
#Line 6: add the line again since the polygon overshadows it.
lines(fit1)
What other language can do this in 6 lines of code?
# install.packages('foreach'); install.packages('doSNOW')
library(foreach)
library(doSNOW)
cl <- makeCluster(2, type = "SOCK")
registerDoSNOW(cl)
getDoParName()
#matrix operators
x <- foreach(i=1:8, .combine='rbind', .packages='wholebrain' ) %:%
foreach(j=1:2, .combine='c', .packages='wholebrain' ) %dopar% {
l <- runif(1, i, 100)
i + j + l
}
#include <string>
#include <iostream>
#include <thread>
using namespace std;
//The functions we want to make the thread run.
void task1(string msg)
{
cout << "task1 says: " << msg;
}
void task2(string msg)
{
cout << "task1 says: " << msg;
}
//Main loop.
int main()
{
thread t1(task1, "Task 1 executed");
thread t2(task2, "Task 1 executed");
t1.join();
t2.join();
}
Rcpp
#include <string>
#include <iostream>
#include <thread>
using namespace std;
//The functions we want to make the thread run.
void task1(string msg)
{
cout << "task1 says: " << msg;
}
void task2(string msg)
{
cout << "task1 says: " << msg;
}
//Main loop.
int main()
{
thread t1(task1, "Task 1 executed");
thread t2(task2, "Task 1 executed");
//let main wait for t1 and t2 to finish.
t1.join();
t2.join();
}
Rcpp
Dual core
Gene specificity
about ~24'000 genes expressed in the brain.