The brain is truly one of the final frontiers of human exploration.
Understanding how the brain works has vast consequences for human health and for computation.
Imagine how computers might change if we actually understood thinking and even consciousness.
On this episode, you'll meet Justin Kiggins and Corinne Titor,
who are research scientists using Python for their daily work at the Paul Allen Brain Institute.
They're joined by Nicholas Kane, who's a software developer there,
supporting scientists using Python as well.
Now, even if you aren't interested in brain science directly,
I really encourage you to listen to this entire interview.
It's super fascinating.
This is Talk Python to Me, episode 164, recorded May 4th, 2018.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
This is your host, Michael Kennedy.
Follow me on Twitter, where I'm @mkennedy.
Keep up with the show and listen to past episodes at talkpython.fm.
And follow the show on Twitter via at talkpython.
This episode is brought to you by Cox Automotive and Rollbar.
That's right.
Cox Automotive has joined the show as a sponsor.
They're looking for new developers.
So check out what they're offering during their segment or the link in the show notes.
Justin, Corinne, Nick, welcome to the show.
Yeah, thank you for having us.
Yeah, hello, hello.
It's super exciting to have you here on the podcast.
I'm very, very interested in learning about how you're applying Python and data science type things to brain science.
It's going to be really, really fun.
Great.
Yeah, for sure.
But before we get into all the details, let's start with your story.
I guess, Justin, go first.
How did you get into programming in Python?
Yeah, so I think I started programming mostly in kind of college, working in research labs, you know, part of engineering classes.
And that was largely kind of MATLAB and LabVIEW.
MATLAB is kind of the dominant language in most neuroscience research environments.
And what was your degree?
What were you studying at the time?
I was studying bioengineering, biomedical engineering.
And then I went and started a PhD in neuroscience.
And it was during my PhD that I decided that there was this old C code, like raw C, that my advisor had written for some of our experiments.
And I was chasing pointers and trying to figure out how to do memory buffers with audio.
And I was like, this is brutal.
I don't want to do this.
And I basically cold turkey switched everything that I was doing over to Python.
So rewrote a bunch of that code, taught myself Python by kind of rewriting that, implementing it in Python, starting to use some of the scientific Python stuff for my analysis, building out a Django database to maintain my, to keep track of my research that I was working on.
It was kind of a cold turkey switch for me about 2012.
While I was working on my PhD.
And it was a good switch.
You're happy with it?
Yeah.
I mean, I think that it's done me well.
And the rest of the field, I think, is starting to catch up.
And it's only become more powerful since then.
Yeah.
If you look at the popularity of Python, it's been going upward.
But there was a major inflection point where it became the rate of popularity growth increased around 2012.
And I think there's just a lot of that is due to the data science tool improvements, that whole space.
Yeah.
Absolutely.
And I think that I really just caught the edge of that wave.
Yeah.
You're part of that wave, for sure.
For sure.
Nice.
And Corinne, how about yourself?
Yeah.
So I started coding after my undergraduate degree.
I had an undergraduate degree in physics and psychology.
And afterwards, went to Los Alamos National Lab.
And so my first coding language there, I was doing very physics-y, dominated stuff.
So it was Fortran, actually.
And then after that, I went back to grad school in computational neuroscience.
And there, the main coding language we used was MATLAB, as Justin mentioned.
And then after that, I had a couple positions at, for example, Qualcomm and Sandia National Labs.
And there, I was still using mostly MATLAB.
So we'd have to buy licenses.
And then I came to the Allen Institute.
And here, Nick and I were both here during the very beginning of kind of our latest 10-year plan.
And we wanted to make sure that everything we use, like one of the goals of the Allen Institute is to be able to make standardized data that the community can use.
And part of that is wanting it to be open source.
So a lot of us on the ground were thinking about this.
And we had the option at the time to use whatever coding language we wanted to for the projects that we were pursuing.
But we really all got together and was like, you know what?
We want everyone to be able to look at our code.
We want each other to look at our code.
And we're going to go with Python.
So I learned Python on the fly when I came to the Allen.
What was the transition like coming from, say, MATLAB to Python?
It was a learning curve.
I'd like to say I was kind of floundering around for probably about three months.
And there was a lot of, like, indexing in MATLAB.
And Python is different.
And we do a lot of time series analysis data.
So just the indexing and things like that was a transition.
But, you know, at the end of the day, I'm very glad that we chose to do that.
That's cool.
Yeah, it's different, but it's not that different, right?
It does still have a similar feel, at least, I think.
So we could have gone to, like, different.
I mean, we could have gone to C or some other language like that.
But really, it was a great transition for people on the outside.
We knew a lot of them would be very MATLAB savvy since that was kind of the main code at the time.
I think people are transitioning now, but it's still a high-level code.
Right.
And I think the ecosystem for Python aligns very well with your mission of trying to have everything open source and stuff, right?
It's of all the different languages, Python embraces the sort of zen of open source more than average, I would say.
Nick, how about yourself?
Yeah, so just like Corinne and Justin, I started programming in MATLAB as an undergraduate.
When I went to graduate school at the University of Washington for my Ph.D., I was in an applied math department, and my advisor encouraged me to learn Fortran.
So I wrote my first project in Fortran, and just like Justin was saying, I was chasing all sorts of things that I didn't really understand and having a difficult time,
and decided I would try out this language that some of my colleagues were telling me about,
and started rewriting all my algorithms in Python and using that as sort of my learning case.
And then as I got more into computational neuroscientists, or as I got into computational neuroscience,
there's actually a lot of packages that are written in low-level languages, packages like Nest or Neuron,
that have developed really good Python bindings.
So I realized that I didn't have to sacrifice efficiency or engagement with these other theoretical and computational neuroscience communities,
but I could still program in a language with a ton of flexibility and a ton of tools.
So it was a really natural transition over.
So then when I came to the Allen Institute, brought that knowledge in, and to be honest, really haven't looked back.
I've been using Python for most of my day-to-day work.
That's really a cool story.
And because of the bindings, right, because there's underlying libraries,
people can still use those libraries.
It's just you happen to be able to program in a higher-level language,
and if they want to go write in C or Fortran, that's all well and good for them, right?
Yeah, and you can use the expertise of really core developers working on highly technical material
in really efficient multiprocessing libraries,
but then be able to define, at a high level, define simulations and define models in a much user-friendly syntax,
but really not sacrifice efficiency.
Yeah, that's really, really cool.
So I kind of want to go through the projects that you're each working on
and give people a sense of what is it you do day-to-day at the Allen Institute
because it's not like, well, I work at this e-commerce site, or I work at a bank,
and we all know what that looks like.
But you work at a pretty special place, so I'm going to keep the same order, I guess.
Justin, what kind of stuff do you do day-to-day?
I'm a scientist in the visual behavior team.
So in general, I'm in a chunk of the institute that is very interested in neural coding.
So we can think a little bit about sometimes,
one way of thinking about what the brain does and what neurons in the brain do
is that they have some representation, some way of encoding what is out in the environment.
So if I'm looking at something,
there's a particular pattern of activity that that's going to elicit in the cells in my brain.
And so in general, this is understanding how this happens
and how these types of representations emerge, what they are,
and then how other parts of the brain use those representations to make decisions,
to do whatever the other parts of the brain need to do with those kind of intermediates.
In general, that's the kind of stuff that we do.
So we have a large experimental pipeline.
One of the interesting things about the Allen Institute is we kind of take an industrial
approach to generating data for these types of experiments.
We have these very large pipelines that generate very large data sets on standard experimental rigs.
So are these experiments, are this like you're bringing folks in and you have them,
do you hook them up with an EEG?
Yeah, no.
So most of the work that we do here in my group is dealing with mice.
So we can actually present images on the screen for the mouse and then record individual neurons in the mouse's brain.
And it's very hard to do this in humans, but it's a little bit easier to do it in mice.
That's wild.
How do you get them to pay attention to the screen?
This is part of what my project deals with.
So there's an experimental setup.
So at the end of the day, we basically need to fit a very large microscope over them in order to record from the individual neurons.
And a very small glass window is implanted in order to be able to see into their brain.
They are basically trained to be comfortable with getting their head attached up against the microscope.
And they've got a little running wheel they can run on.
And then we have the screen next to them that's presenting images.
I see.
So they're kind of fixed, like looking straight at it.
They're kind of stuck, but they've got a wheel in front of them.
So we are controlling the visual environment, but they're kind of free to move otherwise.
So it's almost like a little virtual reality type.
Yeah, yeah, yeah.
We just need a miniature Oculus Rift type thing you can put on them.
Yeah, exactly.
I mean, that's basically...
So then, I mean, that's an interesting segue because then your question, you know, how do we actually get them to pay attention,
is that we put a lick spout in front of them.
And they can lick the lick spout.
And if they lick at the right times, then we make sure that they get a little bit of water.
And so they basically, through trial and error, start realizing what we're trying to get them to pay attention to on the screen.
They're basically in a little video game.
I mean, they basically are, you know, we're controlling what's on the screen,
and they have to lick when the game rewards them for licking.
Yeah, that's really wild.
That's quite interesting.
So then you capture all this data and sort of analyze it afterwards, huh?
Yeah, yeah.
So we generate data.
I mean, it's a little bit of...
So we've got some...
So some of the data gets streamed and analyzed in real time to give the trainers feedback on what the mice are doing and their well-being.
We have a...
In order to train them and to do this at scale, we have to standardize these training procedures.
The game has to go from easy to hard.
So we have an entire system that Nick and I actually have coordinated on where at the end of each training session, the data gets uploaded.
Some automatic analysis happens that determines what the next stage is that the mouse is going to have the next time they come in for training.
And so that requires pushing data back and forth between servers, sending it off to a microservice that Nick is running, and then the next day the mouse is on that next stage.
So we train them up.
Then when they're ready, then we put them under the microscope.
And so they're in a similar situation.
But now we've got a microscope that is recording the activity of individual neurons in their brains.
This gets acquired over a few days.
All that data...
I mean, we're talking very large data files that are literally movies of neurons in their brain.
That all gets pushed up.
That was going to be one of my questions.
Like, how big are one of these files?
Like, how much data are we talking about?
Yeah.
How big is one of these files, Nick?
Do you even know?
Terra scale.
I think it's less than a terabyte, but it's, you know, many, many hundreds of gigs.
Wow.
Okay.
So this gets pushed up to the server, and then we've got a whole other team that's developed algorithms for basically extracting these signals out.
So you've got a bunch of kind of ML that has to happen in order to basically do segmentation, a bunch of image recognition stuff.
You know, where are the cells in this movie?
And then extracting the activity of those cells.
And then basically kind of at the end of a bunch of that pipeline, of that kind of processing ML pipeline, a bunch of this data then comes back to me,
where now I have signals and, you know, I know I have the record of the images that were presented on the screen.
I've got other data about when the mouse licked, when it didn't.
And so basically then I take this data and try to make sense of it.
So to what extent can I, you know, if I'm just looking at the activity, can I decode what was on the screen from that activity?
If I'm looking at the activity, can I predict what the mouse's choices were at any given time, whether it chose to lick or whether it chose not to lick in the context of its performance on the game?
That's just fascinating.
Yeah, this is really wild.
I had no idea that you could do these kinds of things.
Yeah, and at the end of the day, I mean, basically to do this, it's all largely like scikit-learn and pandas, right?
Like reducing this stuff into a feature matrix where your feature vectors or the identity is the activity of any given cell.
So if I've got 100 cells that we recorded from, each cell becomes one dimension in my vector,
and I've got a bunch of categorical or continuous information about what was on the screen,
and then it's just a regression or a classification problem at that point.
Yeah.
And this basically is what lets us kind of, you know, by approaching it in this way,
we can build the inferences and say, well, you know, this area over here did really good at decoding images.
This area over here didn't.
But that area was very good at predicting what the mouse's decision was.
So we can kind of start to build out inferences about kind of what different parts of the brain are doing
and how they're doing that through this type of approach.
This portion of Talk Python to Me is brought to you by Cox Automotive.
They're leading the way in cutting-edge, industry-changing technology
that is transforming the way the world buys, sells, and owns cars.
And they're looking for software engineers and technical leaders to help them do just that.
Do you hate being stuck in one tech stack?
Well, that's not a problem at Cox Automotive.
Their developers work across multiple tech stacks and platforms.
They give you the room you need to grow your career.
Bring your technical skills and coding know-how to Cox Automotive.
You'll create real-world solutions to today's business problems alongside some of the best and brightest minds.
Are you ready to challenge today and transform tomorrow with Cox Automotive?
Go to talkpython.fm/cox, C-O-X,
and check out all the exciting positions they have open right now.
A couple of thoughts.
One, who would have thought that a library coming out of the financial industry, pandas,
would be helping us understand the brain?
And also, who knew mice could generate so much data?
Yeah.
Well, I mean, the amount of data that we can generate, I mean, I think it's probably obvious.
And we're not even getting all of the data that we could generate out of these guys.
We have, this is, I mean, and this data that we're talking about, I mean, we're literally talking,
zooming in on an area of the mouse's brain that is maybe a few, what, like hundreds of microns, micrometers wide,
and maybe like, and a really thin, thin piece.
So we're talking, I mean, we're talking about a couple, you know, many dozens to hundreds of neurons
out of the thousands and thousands of neurons in the mouse's brain, right?
We're not, I mean, this is just the tip of the iceberg in what we could be potentially recording as technologies improve.
Yeah.
And someday we probably will be, right?
Yeah.
I mean, there's tons of initiatives.
I mean, the Allen Institute is leading on a bunch of efforts.
The recording modality I just described to you is that what we have currently released
and the kind of stuff that is currently on our website, not with all the behavior, but that recording modality.
And there's a new effort of Neuropixels probes that the Allen Institute has been involved in that will get us kind of up into the thousands range of simultaneously recorded cells.
And there are even more forward-thinking efforts to be much more comprehensive in what we can record from with this level of detail.
Yeah.
It's amazing.
All right.
Corinne, how about yourself?
Yeah.
So Justin works on kind of a higher-level project where, you know, you have actual behaving mice.
I'd say I work at one scale downwards.
So a large part of this institute is trying to really define what the components are in the brain.
So you have a bunch of neurons, and theoretically those are differentiated into different cell types.
So researchers in the field have been trying to figure out what sorts of types of neurons there are in the brain for probably 100 years.
And this is something that people haven't really solidified their ideas on.
Is it still an open question?
Like people don't know all the types?
Yeah.
It's an open question.
So we're really devoting a lot of resources to try to get to some sort of ground truth.
It's not clear that there's going to be specific types of neurons.
There's probably a continuum, but how well can we define it?
And then after we've had some definitions, can we figure out what those different types are doing,
what function they're performing in the brain?
So Justin didn't mention that.
There's the reason we use mice.
And the reason we use mice is that we have a lot of genetic controls.
So we specifically breed different types of mice to fluoresce looking under a microscope for different types of genes that are expressed in the neurons.
The mice don't fluoresce, but the individual neurons.
The neurons fluoresce.
So when you're looking under a microscope, you see a bunch of different neurons.
And depending on what type of neuron we're marking, that neuron will fluoresce under a microscope.
So we have a lot of genetic control over recording from neurons that we kind of know what kind of transgenic type they are.
In my group or the group that I work on and the project I work on, we are looking at electrophysiology data.
So what that means is you stick an electrode into a neuron.
So these mice are sacrificed and you have slices of the brain tissue.
And we also do this in human.
We have a lot of agreements with the hospitals within the area where if they're excising part of the brain during a surgery,
we will get that tissue and we'll record from those neurons also.
So this is a nice project to kind of try to relate mice to humans.
How similar are they?
My first position, as I mentioned, I came from a physics background, was basically building a modeling pipeline.
So you stick an electrode into a neuron, you inject current, and you record the voltage output.
And then you try to come up with mathematical equations that will recreate the behavior of a neuron based on current injection, just like a circuit.
And so we recently wrapped up this project where we were looking at, you know, how much specific mathematical equations are needed to reproduce the behavior of these neurons.
And so this is all available on our website now.
And the idea here is that when people are building larger scale networks, you want to use realistic spiking behavior of individual neurons.
So now depending on the level of abstraction someone might want to use in a network that they're building, they can choose from this different range of abstraction that we have on our website.
So first project was that, working and building a whole pipeline to do this all automated.
So data is taken.
It goes into our storage facility.
I take the data.
Well, then there's some QC algorithms that we built up to, you know, QC the data.
And then I pull that data out, come up with algorithms, test them in a very machine learning type way.
You know, you basically have a test set and a training set.
And then the project I work on now is trying to figure out those components.
So you inject current into one neuron and you measure the voltage that's happening on another neuron it's connected to.
How complicated does that get?
Is it kind of simple to some degree, like Newtonian mechanics?
Is it crazy, like complex, dynamical, chaotic systems?
Like, what are you working with here?
So it depends on, so Nick will talk about this a little bit because he spent a lot of time building actual network models.
But so what I do is, I would say it's relatively simple mathematical equations.
There is also a level of models that are made that are what we call biologically realistic, where you try to model all of the ion channels in a neuron.
So you have lots of different ion channels in a neuron.
Calcium, sodium, potassium, lots of them.
25 different, you know, many.
25 to 100 different channels.
And you actually try to model, like, the gates opening and closing and current flowing into the neuron.
But we abstract away from that because we have found that that's not necessarily necessary to predict the spiking behavior of a neuron.
But we also have those high level, or sorry, those very complex models, too.
So it depends.
Okay.
Yeah.
So you can look at it at different levels depending on how, while you're trying to ask questions.
And, yeah, Nick, how about COVID?
Well, I just wanted to jump in there and sort of highlight one of our Python packages that the Institute has been building over the past year.
It's a package we call the BMTK, the Brain Modeling Toolkit.
It's available on our website, and it's gone through sort of a soft release.
It's a Python package, a Python wrapper around several neural simulators, like I was mentioning earlier, that allow researchers to construct and simulate neural circuits, like Corinne was saying, at a bunch of these different levels of biological realism.
So, you know, Corinne was highlighting some of her work at the sort of one differential equation per neuron type scale.
But you can go much deeper and simulate individual compartment models that can resolve the complicated morphologies of the dendritic trees and how those interact with each other.
Or even all the way down to the synapse with these stochastic models of ion channels, that's at the sort of extreme end of biological realism.
My first project at the Institute was actually on the other extreme, the so-called population density modeling, where we use partial differential equations to simulate entire populations as sort of one homogenous group.
And there's different biological questions that you'd want to pose at different sort of points on this continuum.
I'll give you an example.
Is it important to simulate the exquisite, complicated nature of the trees of these neurons to understand their input-output properties?
Well, if the answer is yes, then you're going to have to use a simulation tool like Neuron.
Although it might be sufficient to just look at the spiking behavior down near the soma of the cell, in which case a simulation tool like Nest, which also has a Python API, would be more appropriate.
If you just are interested in the sort of mean field dynamics, the population-to-population contributions to circuit dynamics, then the neural simulator that I wrote called DIP-D, which is actually in pure Python, would be the tool that would be the most appropriate.
So we have a Python package that actually wraps all of these different levels of detail, so you can move sort of in between each of the different scales as your work is sort of demanding.
Yeah, that sounds really interesting, because you might start a research project thinking, I'm going to look at one level, but realize, no, actually, we need to try to think about it differently.
But you have the same API or something like that, right?
Exactly.
And there's a big switching cost associated with having to learn a whole set of tool chains.
It was originally written that the simulator Nest had its own custom language for describing the network topologies.
I think it was called SLI.
I know Neuron has its own language called a Hawk file, right, Corinne?
Yes.
Yeah.
But it also has a Python interpreter now.
So if you're having to switch based on your biological question to a different type of simulation, and now you've got to learn yet another custom description language or modeling language, it really is taxing on the individual scientist.
So that's why unified Python APIs that you can just sort of learn one language but still get the power of all of these simulation tools is really helpful.
Yeah, that sounds great.
So are these tools and libraries being taught in academia these days?
That's a great question.
Are they used for research projects?
So there are some examples where they're taught to undergraduates, although it's a pretty specific topic.
And in graduate school, that's where I learned about all of these tools.
But that's when you're doing your PhD and you have a neuroscience or an applied math question in mind, and then you go to find the tool that's most appropriate.
So most of the time, I'd say, it's learning on your own.
We do have several examples of training courses that we provide.
They're actually not just at the Allen Institute but all over the world for sort of specialized computational neuroscience and also experimental neuroscience.
And I know that at our summer training course last year, using these Python APIs was one of the main focuses of the course.
Or it was a focus of the course.
Are these courses taught online?
Are they taught in Seattle?
That's where you guys are?
Yeah.
So we're all in Seattle, just down here on Lake Union.
But I was referring to our Friday Harbor summer course, which is actually, I think, in its fifth year now, where there's an application process really geared towards graduate students and postdocs, maybe early faculty.
And it's a two-week in residence up in San Juan Islands at the Friday Harbor Labs, which is run by UW.
That's the Friday Harbor tie-in.
Yeah.
I've stayed up there on San Juan Island.
Oh, yeah.
It's wonderful up there.
Yeah.
It's a combined effort between the University of Washington and Allen Institute.
There's also funding from the Cavalier Institute that helps make sure that it is a success.
And it's not only just computational neuroscience, but actually, I think it's kind of morphed into a combination of big data and experimental neuroscience.
And there's also an introductory period where it's all taught in Python.
So if the students are coming into the course without a strong Python background, there's a sort of a Python boot camp for the first couple days to help train students to use our data APIs and some of the tools that they might find useful on their projects.
All of the course material from this from the last few years is on the Allen Institute GitHub repository.
So there's Jupyter Notebooks.
You know, one thing we also haven't – yeah, so there's Jupyter Notebooks that cover a lot of the course material that those students use.
And that's freely available for folks to go and download and start poking around.
This also – one thing that this also offers is, you know, I mentioned that we release a bunch of this data online.
So currently we have what we call our brain observatory, which is observatory.brain-map.org.
That is the website for the web version of it.
And you can go there and you go to the website and you can kind of poke around and see a little bit of what is in this data set of, I want to say, 40,000 or so neurons from my work.
Corinne's data is somewhere in a parallel.
It's also on brain-map.org.
I don't remember exactly where it is.
But the stuff that she's been working on is also freely released.
And Nick's team manages the API and Python wrapper for the API to access this.
So you can basically do a pip install Allen SDK.
That will install a Python package locally.
You spin that up and in like three or four lines of Python code, you'll start downloading almost all the data that we've released in this.
It might take a while, but you've got access to it at your fingertips.
One of my thoughts around this is you talked about how much data that you're gathering for all of these projects and stuff.
And I know the folks at CERN, instead of running their, downloading the data and running analysis on it, they push their analysis to where the data is.
Because there's so much data, they've got like a cloud computing infrastructure that like send your algorithm to the data and run it locally.
So with yours, what is it like?
Do you actually download all the data and process it?
Or do you download all segments that you ask for?
Or how does it work?
Yeah.
So this specific tool is basically downloading after a lot of the pre-processing.
And we've gotten it to a point that it's condensed to the level that your average postdoc or graduate student who would want to explore this data would want to play with it.
That's about at the point that we release it for download.
There is, I mean, we have our own compute internally for a lot of our own data that relies on our cluster and where we keep everything very close to the compute.
It really depends on the types of questions.
We have an entirely different chunk of the institute that is not represented here that is taking, doing very dense microscopy.
So trying to build out, it's going to take them months to acquire the data set alone.
This is an electron microscopy.
So it's in every single neuron within some area in incredible detail.
And the size of that data is just, you know, it would be largely impossible not to do the analyses that need to be done on that without staying close to the data.
That's really wild.
What kind of questions are they trying to answer, Corinne, on that one?
You know?
Oh, I was just going to mention that.
I mean, we're trying to answer all sorts of questions.
We have been at Friday Harbor using Docker, too.
And AWS have donated time, you know, just like they did at CERN.
So last year at Friday Harbor.
So we used to just give out a terabyte disk to everybody that showed up with the data that we were going to be talking about.
It's the most efficient way to transmit the data sometimes.
Well, you're joking, but I mean, Amazon has their, like, ship us a bunch of disks is the fastest way to upload large quantities of data to, like, S3 and stuff.
It's wild.
Sometimes that's what you need.
So Amazon, yeah.
So last year, Amazon generously donated a bunch of space and credits for us for this course.
And so we, yeah, for all these students.
And we, yeah, we had a snowball here that they sent us.
And we put a bunch of data on it and sent it off to Amazon.
Yeah, so one thing that's interesting about that data, when you download data from the Allen SDK, the Python API,
what you're getting is a bunch of actually preprocessed data that has had a lot of computational algorithms already applied to it.
For example, neuropil subtraction, segmentation of regions of interest for the cells.
That basically gives time series for the activity of each cell.
All of that is there's an entire algorithms team at the Institute that works on the packages and the algorithms to do that.
When you access that data with the Python API, you're just getting that post-process data, not the raw imaging stacks.
Those are the sort of multi-hundred gigabyte or terascale data.
And that's what we need the snowball for.
Because we actually brought that to, made that data available actually through Amazon at Friday Harbor last year for students to sort of poke at that raw imaging data.
But there's really, really significant volume.
And also, if anybody requests it, they do send us a disk and we put the data on it and send it back to them.
That's another way that we handle our large data sets.
Oh, wow.
Okay.
Yeah, that's really interesting.
Because downloading a terabyte, like that's going to cause all kinds of problems.
I mean, even just paying for that much bandwidth, that's like $90 of bandwidth at AWS.
And it also begs the question what you're going to do with that data when you get it.
I mean, I'm not saying that a researcher wouldn't know what to do with it, but it takes a lot of time and a lot of effort to extract signal out of that data.
And that's sort of, I wouldn't call it a service we provide, but it's part of our institutional work to develop the algorithms to do that so that people don't have to retread that wheel constantly.
Right.
Just pay the computational cost of trying to compute.
That's got to be pretty high.
A computational cost, I also think it's the human cost.
It takes a very specialized set of skills to be able to computationally extract the meaningful data in those raw imaging stacks.
But we have a really world-class algorithms team that does a lot of that pre-processing for you so you can jump straight into the sort of the data that you might think of as the really relevant class of data.
What is the activity of the cell, not what was seen by the microscope?
Those are two different data dimensionalities.
Thanks, man.
This portion of Talk Python to Me has been brought to you by Rollbar.
One of the frustrating things about being a developer is dealing with errors.
Relying on users to report errors, digging through log files, trying to debug issues, or getting millions of alerts just flooding your inbox and ruining your day.
With Rollbar's full-stack error monitoring, you get the context, insight, and control you need to find and fix bugs faster.
Adding Rollbar to your Python app is as easy as pip install Rollbar.
You can start tracking production errors and deployments in eight minutes or less.
Are you considering self-hosting tools for security or compliance reasons?
Then you should really check out Rollbar's compliant SaaS option.
Get advanced security features and meet compliance without the hassle of self-hosting, including HIPAA, ISO 27001, Privacy Shield, and more.
They'd love to give you a demo.
Give Rollbar a try today.
Go to talkpython.fm/Rollbar and check them out.
How many people work there at the Allen Brain Institute?
I think we're pushing 400 or so totally in brain science, which is our kind of corner of the Allen Institute as a whole.
We're the largest chunk, and I think we're closer to 300, 250, or 300, somewhere in that fall.
Yeah, so a lot of expertise packaged in that area, right?
So, Corinne, you talked about people shipping you disks and sharing that data in some really interesting ways.
And I think that leads into one of the missions at the Institute, which I thought was really powerful.
It says you guys are committed to the open science model within your institutes.
Do you want to speak to that a little?
Absolutely.
Yeah, so in academia, things are generally done in smaller labs, and oftentimes you have a lot of difficulty reproducing individual experiments that happen there.
And I believe a lot of brain science is really hard.
It's really hard to figure out what's going on in the brain.
And I believe that when this project was started, it was like, what space is really not being covered by the neuroscience community, academia, and pharmaceuticals combined?
And that was being able to reproduce large sets of data, making them standardized, and making everybody be able to reproduce the results that you get so that you could kind of come to an agreement on ground truth and not be trying to reproduce other people's experiments.
And so we are one of the only institutions in that space that has done this.
And now other institutions are also trying to kind of follow suit because we've all recognized that we're really trying to solve this reproducibility problem and also deal with just the huge amounts of data in the brain.
Yeah.
How many different data centers have to be set up to do basically the same processing, right?
Like, if you guys could do that processing, share that data, and not have every university set up their own equivalent computing structure to do the same thing, that would be good, right?
Exactly.
And I know that the next step in a process now is that we have projects where you can apply to have your scientific study done in our platforms.
So we might be heading more towards that.
You know, we've set up this huge infrastructure.
People will apply to have what they think is interesting done here.
Nice.
It's a little bit of the computing close to the data type of thing.
Yeah.
You know, there's a lot of different dimensions to open science, right?
We've been talking a lot about open data, and we've talked a little about open software, which is open source software, which is another aspect nowadays of open science, as science has really kind of come to depend upon the software that implements the science.
And then there's also, of course, open access, right?
That's what we traditionally think of as the final work product of science is the paper that you publish.
And there's free preprint archives and free access on journals.
There's a lot of different – so my point is there's a lot of different dimensions that you can talk about open science.
But open source software is something that myself and the technology team really think about a lot.
You know, we've talked about the Allen SDK, and I also mentioned the Brain Modeling Toolkit.
I don't think I necessarily mentioned that both of these are open source packages, and we accept pull requests onto them, and we respond to GitHub issues.
And there's a large backlog because there's a lot of work to do, and we support a lot of different scientific projects at a very large scale.
But open source software development is really something that the Institute has really come to embrace.
I think the community has started to recognize just how critical it is to share our algorithms, share our processing code, share our analysis tools.
Yeah, I think that's such a great mission.
And I think partly you folks have a slight advantage over, say, Stanford, Rutgers, the other universities because you don't depend on the publish or peril model, right?
At least that's my understanding from the outside, right?
It's not like –
No, that's exactly –
Yeah.
Yeah, I mean, it is very important for us still to publish our data and to still communicate to the broader scientific public in that realm.
But yeah, our incentives are a little bit different.
I mean, I think a good example of this is our brain observatory.
We started releasing data in the brain observatory in May 2016, and we've had two or three more releases for this.
This is the data set that I was talking about.
It's 40,000-some-odd neurons.
We haven't published a paper on this yet.
So whereas, like, the rest of – even in the open science community and open data community, the debates right now are, okay, well, how soon after publishing the paper should we release the data?
Do we release it immediately on publication?
Do we wait six months or a year to give the primary author time to write a second publication before they move forward?
And these are important to base because that's the way that the incentive structures are in academia.
Nobel Prizes are handed out on this basis, things like that, right?
Exactly.
We've released this data, and there are already 12 preprints that external people have written and posted.
I think two of them are peer-reviewed and published also on the data already.
And we haven't even written our own paper analyzing this yet.
It's in the process.
We have not yet published our own paper dealing with this data.
So, yeah, so we have a very strong kind of data-first, publish-later model that you just can't do in the current academic infrastructure.
I mean, there are communities that have sort of demonstrated that this is possible.
The machine learning community is the one that I always think of as really jumping out there early with the latest developments of the algorithms and the approaches.
And they are starting to make it.
But I think it's a real big culture change for sort of more, I don't want to say entrenched, but, you know, the biological sciences have been around for a long time.
And the publication methods are the way they are for a reason.
But there's a cultural change that the three of us have only been out of our PhDs now for less than a decade.
And we are definitely sort of seeing this enormous change.
And it's fun to be at a place that really sort of embraces that cultural change.
Yeah, you guys seem to be at sort of the leading edge of that.
Yeah, and I'd like to say just quickly that we should acknowledge that this is all possible because of Paul Allen's generous donation to us.
I mean, he basically makes all of this possible.
And it's really the only place in the world that you can do this.
So kudos to him and his vision.
Yeah, absolutely.
He's got the Brain Institute.
And there's a couple of other ones as well, right?
Now you also have the Allen Institute for Cellular Science and the Allen Frontiers Group.
And the Allen Institute for AI.
Oh, really?
Okay.
Yeah, they're not hosted in our building.
They're in a separate building.
But yeah, there's an artificial intelligence group.
Yeah, so that's, yeah, absolutely.
It's great to acknowledge what he's doing because it sounds really unique and special.
And like we were just talking, it lets a lot of you work in a way that is sort of a better fit for the larger goal, not sort of career goals necessarily, right?
Yeah.
And just to follow back on that too is that we do want to make sure that we publish and we do have external advisory boards and we do apply for grants because we want to make sure that what we're doing in our space is relevant to the community.
We don't want to be in this one-off ball where we somehow discover something that's not relevant.
Or you know what I mean?
Like we want to make sure that what we're doing is valid.
Yeah, so the whole peer review process is still pretty interesting.
Yeah, still very valid for us.
Yeah.
Right, exactly.
So in 2013, President Obama came out with the BRAIN initiative, or BRAIN stands for actually an acronym as well.
Like how did that affect you guys?
Did it make any difference or the community?
Yeah, I think that I'm pretty sure that up in our cafe there's a little, I think I'm pretty sure that we've got a little letter signed by President Obama hanging on the wall up there.
That's pretty cool.
Related to these efforts.
Yeah.
So in effect, I mean, it's just great to see that more and more people are seeing how important this is, especially from a government point of view that, you know, a president has realized that, you know, this is one of the biggest frontiers that we really have left to solve.
I mean, we just, we know so little.
Yeah.
And so it's really great to see that the community as a whole is investing in this sort of research.
Yeah, from my perspective, I feel like that was one of the most important things was a recognition at the federal, nation-state level that BRAIN science is maturing into the type of thing that needs large data centers.
It needs large sharing and collaboration tools.
It needs large investigations to really start to make a difference in people's lives.
And we've, the science, the community has matured to the point where we can really start taking that standard forward and making a big impact.
Yeah, that's awesome.
And with the more open science and open source projects, it seems like that'll just amplify as people can work better together.
To be honest, we couldn't do it without the open source software community.
I was reflecting on this just the other day.
I don't have the name of the tweet.
I know a researcher with a first name, Jesse, tweeted a picture emphasizing that Matplotlib, Numpy, and Pandas collectively are supported by 12 full-time developers.
And when I think about the amount of science, both my own science, our institute's science, neuro, and then, you know, the rest of science generally, it's a huge edifice of work that's so critical to our national interest and to our interest as humans.
And to see that much work supported by so few people, but such a dedicated core group of people, it really struck a chord with me.
It's amazing to think of how just these small initiatives became such a foundation for what everyone is doing.
I was happy to see that the NSF recently gave like a $3 million grant or something like that to the SciPy group and NumPy and that.
So it's starting to get a lot more support.
NumFocus?
Yeah, I might have the exact details a little bit off like the number or whatever, but there was basically a big NSF grant to those groups to like keep that going stronger.
Because I think they realize exactly what you're saying.
Like all of these researchers, all these data scientists are day to day to day going, yeah, we have a terabyte of mouse video and we're going to give it to Scikit-learn.
Or we're going to, you know, and then like, well, we need to make sure that Scikit-learn keeps working or the foundations, right?
I saw, I remember seeing the, it was a call for some funding from Ken Reitz for requests, you know, the Python request module.
Just, it was like, it was like a month ago.
And it was like, oh, our goal is $3,000.
And I was like, $3,000 to support requests?
Like the number one most used Python module in the entire ecosystem?
Man, that's like pennies.
Think about the return on that.
That is pennies on the dollar.
It's unbelievable.
Yeah.
I mean, I don't know the exact numbers.
He had it on his website.
It's probably still there, but it's like downloaded like 7 million times a month or something.
I mean, it's really useful.
It's not just a little bit.
It's also very nice to see that funding organizations as a whole are starting to recognize too how much, I mean, one of the things that we've struggled with is just how much infrastructure goes into doing large data analysis.
And from 10 years ago, this wasn't a thing.
You know, and now, like Nick was saying, that we're all in our, you know, within a decade of our PhDs and we're all really working really hard to figure out how to process large sets of data, how to make that work, how to, you know, transfer our research code over to more production-like code and just how much infrastructure that takes.
Whereas people don't, a lot of times don't understand that actually.
So it's really nice to see that, you know, government funding organizations are starting to realize because the people on the ground doing this work are really like shouting, you know, we need the resources for this.
This takes a lot of time.
And this is so fundamental for, you know, the mission of this science.
Do you think people are being taught those skills in grad school these days?
Your question is so appropriate.
I don't have my finger firmly on the pulse.
I can only speak to my sort of small window into the University of Washington where I still maintain some contacts with my former advisor and his research group.
And I know it's definitely on the minds.
And I know at the graduate level, like the University of Washington's e-science group, they talk about these types of things.
Yeah, Jake Fenderplast and the group over there doing the e-science institute, that's something special as well.
That's a really cool place.
Exactly.
But I think UW is really forward thinking in that respect.
As far as its adoption, I'll maybe give a personal anecdote to drive it home.
When I came to the Allen Institute in 2012, I just finished my PhD and I took a research science position.
And I quickly realized the incredible amount that I can learn from some of my colleagues in the technology team.
I'd never heard of a unit test.
Like, we're going to test code?
What?
Why did you test code?
It works.
I just did my script in the works.
Yeah, I did that myself.
Exactly.
And then I sort of got my eyes open to the way that they approached their work.
And then I sort of fell into the well and have joined the group eventually.
But I definitely want to see the same sort of epiphany happen to scientists, not only in the graduate level, also the undergraduates.
You know, especially what I've seen in the talent of some of these undergraduate scientists that are coming out,
that are getting trained in the disciplines that didn't exist when I was an undergraduate.
And to see them start to take the tools that have been developed, you know, really for industry,
and of course, we have visibility in open source software, and take those and apply those to their research and build it into the DNA of how they work and think.
That's only going to amplify how open source software contributes to science for the next generation.
Yeah, it's exciting.
My lab that I came out of, I finished on my PhD about two years ago.
And we signed up for, the lab signed up for a GitHub account and started doing version control, you know, shortly after I switched over to Python.
It was sort of myself and another student who had done an internship at Google between undergrad and grad school that sort of,
between the two of us, you know, he kind of brought some best practices.
He's like, well, this is the way, you know, they did things.
And started getting stuff under version control.
And I still get pings on, like, changes to that repo.
And we kind of laid a foundation in that lab that has continued.
I mean, that group, you know, it's a whole new, I think he's still there, but, you know,
there's a whole new kind of cohort of students in that lab that I didn't know.
And they're doing research code development there in a very different way than when I entered that exact same lab.
And to them, that must be how you do it.
That's how we do it.
Yeah, exactly.
Yeah.
Yeah, that's cool.
All right.
Well, I want to be cognizant of your time, but I could keep talking for a long time because there's so many things to explore.
Well, let's do it again.
Yeah, yeah.
We could do a follow-up sometime.
Absolutely.
But this is super fascinating.
I think we'll leave it there for the brain science aspect.
So let me just ask you all the two questions at the end of the show.
And since there's three of you, I'll go kind of quick.
First of all, if you're going to write some code on Python, Justin, what editor do you use?
I'm loving Atom right now.
I kind of prototype in Jupyter, in JupyterLab actually now.
Yeah, yeah, that's starting to take off.
Yeah.
And then, but yeah, then I'm, most of my actual packages are in Atom.
Nice.
Corinne?
I'll either do some old school writing it in Emacs and then running it on the command line,
or if I'm using an editor with a debugger, I'll use Eclipse with PyDev.
Oh, yeah.
Nice.
Right on.
Nick?
Emacs when I'm remote and VS Code when I'm Visual Studio, when I'm local.
Yeah.
Visual Studio Code's really taken off.
I've just been tremendously impressed, especially as it's matured as an open source project.
And when the updates come in, they are timely and they are squashing bugs that people report.
It's been awesome to watch that project.
It's got a lot of momentum for sure.
Yeah.
All right.
That's good.
And then, notable PyPI package.
Maybe there's some package that people, you know, not necessarily request because it's the most popular,
but something you're like, oh, I saw this thing the other day and it's really amazing.
You should know about it.
Nick?
Go reverse order.
Oh, man.
Let me take a pass and I'll come back at the end.
I want to think for you in a second.
You want to get a good one.
All right.
Corinne?
Well, I really use very standardized packages just because I want to stay away from people having to install and use unmature code.
And the things I use the most are numpy, scipy, stats package, stuff like that.
Chester?
One of the things I've been impressed with recently is cookie cutter.
It's kind of speaking of, you know, we work with a lot of, speaking of onboarding kind of newer Python folks into good research,
good practices of testing, tooling, documentation, helping folks who have a little bit less knowledge of what a full-fledged package should look like
with a nice template has been absolutely invaluable.
Yeah, that's a great idea.
It's very, very helpful to just run a single command and poof, you got all the structure you're supposed to have.
Nick, you thought of one?
I got one, yeah.
Bokeh.
Oh, yeah.
It's the continuum visualization package.
I've been using it to build dashboards and widgets for doing analysis tooling and I just can't say enough about it.
The community that has grown up around it has just been so responsive and the power of that tool is it matures into the 1.0 release.
I'm just so excited to see where it goes because I use it daily and I love it.
Yeah, that's awesome.
All right.
Well, thank you so much.
Those are all great choices.
I guess I'll give you all, whoever wants to jump in and add something here, a chance for a final call to action.
People want to work with the Paul Allen Brain Institute or get involved with some of the tools or things you've talked about.
What do they do?
Where do they go?
Yeah, so we've got, so I mean, I think definitely for your users, I would, or for your users.
Listeners.
So definitely for your listeners, I think that our GitHub page, so we've got a, we've got a github.com/Allen Institute and we've got a bunch of different packages.
Everything from our, our production things like the Allen SDK to smaller packages that the individual people are releasing like Neuroglia, Arc Schema.
We've got a couple of kind of things in the, in the Python world as well as, you know, research code and packages that are affiliated with research projects.
So there's a bunch of stuff there that's a whole lot of Python.
Nice.
So our GitHub page will have lots of great examples of how to actually utilize the data that you can download too, which if you want to browse around on the data, go to our website and you can see the massive plethora of data that we have there that's available for everybody.
Yeah, excellent.
And one particular package, because it's so close to my heart, the Allen SDK, it's really the sort of one-stop shop to get your hands dirty digging into our data and it should work.
Just pip install.
And if it doesn't check out an issue and assign it to me, I'll, I'll tackle it as soon as I can.
Yeah.
And we've got any of our research that we've got going on here, Twitter, we're on Instagram.
We've got a bunch of job openings too, I think for some software developers, AllenSuit.com and there's a button somewhere for careers.
So yeah, there's a, there's a lot of fun stuff happening.
Awesome.
Yeah.
It sounds super exciting.
Thank you for sharing this view into what you're all up to.
Yeah.
Thank you so much for having us.
Thank you so much.
Thank you for having us.
Bye.
This has been another episode of Talk Python to Me.
Our guests on this episode have been Justin Kiggins, Corinne Teeter, and Nicholas Kane.
And this episode has been brought to you by Cox Automotive and Rollbar.
Join Cox Automotive and use your technical skills to transform the way the world buys,
sells, and owns cars.
Find an exciting technical position that's right for you at talkpython.fm/cox, C-O-X.
Rollbar takes the pain out of errors.
They give you the context and insight you need to quickly locate and fix errors that might have
gone unnoticed until your users complain, of course.
As Talk Python to Me listeners, track a ridiculous number of errors for free at rollbar.com slash
Talk Python to Me.
Want to level up your Python?
If you're just getting started, try my Python jumpstart by building 10 apps or our brand new
100 days of code in Python.
And if you're interested in more than one course, be sure to check out the Everything Bundle.
It's like a subscription that never expires.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct
RSS feed at /rss on talkpython.fm.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.
Thank you.