An experiment simulator with electrode and optogenetics modules

Hello! I’m Kyle, a PhD student under Chris Rozell at Georgia Tech, working on closed-loop control methods for neuroscience. I thought I’d share what I’m doing here in case anyone is interested or knows of existing code to save some effort.

I’m building a closed-loop experiment simulation platform on top of Brian. The goal is to allow for quicker iteration in method development and experiment design in silico before moving to animals. The different components could be useful in isolation, though:

  • An optogenetics module designed to be adaptable to an existing Brian model with as little change to the model as possible. So as long as your NeuronGroup has a v and an Iopto term in the model, for example, you can connect the optic fiber like this: sim.inject_stimulator(opto, neuron_group)
  • An electrode recording module which calculates the signal at each contact through a sum of transmembrane currents weighted by distance. In principle, this will not require any modification of neuron models: sim.inject_recorder(electrode, neuron_group1, neuron_group2, ...)

I ran into some tools such as LFPy or NetPyNE which already do electrode recording, but they have a NEURON backend. If anyone knows of existing code to simplify electrode recording for Brian, let me know. I also know PyRhO does optogenetic simulation in Brian, but not in a modular way like I’ve done (this part is mostly finished).

Then there’s the closed-loop component of the project. The simulator runs Brian and sends output (e.g., spikes, LFP) to the processing loop and gets a control signal (e.g., light intensity if it’s optogenetics) at every timestep. This also can take into latency: you get a signal back 5 ms later if in real life you think the computation will take 5 ms.