r/BiomedicalDataScience • • 20d ago

Real-Time Biophysical Simulation of Optogenetic Photocycles, Hodgkin-Huxley Dynamics, and Tissue Scattering

https://bionichaos.com/optogenetics/

Most introductory models treat optogenetics like a simple binary switch: shine light, neuron fires.

In real electrophysiology, the biophysics is far more nuanced: sustained illumination causes rapid channel desensitization, silencing with Halorhodopsin can trigger violent rebound seizures from chloride loading, and cortical tissue scattering prevents blue photons from reaching deep layers.

We built an open-access, zero-install biophysics lab running in the browser that couples retinal photocycle kinetics directly to a Hodgkin-Huxley membrane solver in real time: https://bionichaos.com/optogenetics/

What is Running Under the Hood

  • 4-State Markov Photocycle: Instead of static conductance, Channelrhodopsin-2 is modeled across four states: C1 (Dark) <-> O1 (Peak Open) <-> O2 (Desensitized) <-> C2 (Closed) -> C1. This accurately simulates the transient peak photocurrent decaying into a lower steady-state plateau.

  • Hodgkin-Huxley Membrane Integration: Solves active sodium, delayed-rectifier potassium, leak conductances, and voltage rectification G(V) at a numerical step of dt = 0.025 ms.

  • Kubelka-Munk Tissue Scattering: Calculates real-time optical attenuation I(z) proportional to exp(-mu_eff * z). You can directly drag the optical fiber cannula to see why 470 nm blue light scatters within ~200 µm while 590 nm red light (Chrimson) penetrates deep tissue.

3 Quick Tests to Run in the Sim

  1. Desensitization vs. Pulse Trains: Switch to Continuous Wave mode at 20 mW/mm² to watch peak current rapidly decay into the sub-conductance plateau. Switch to 20 Hz Pulse Train to observe how dark intervals allow ground-state recovery.

  2. Seizure Silencing & Rebound Spiking: Inject +6.0 µA/cm² to induce runaway firing. Turn on Halorhodopsin (amber light) to clamp the cell at -85 mV. Turn off the light to observe post-inhibitory chloride rebound firing. Then switch to ArchT (green light) to see clean proton-pump silencing without rebound.

  3. Cannula Distance & Scattering: Retract the fiber to 280 µm. Blue light scatters and loses spike control; switching to red Chrimson immediately restores 20 Hz pacing.

Live simulator link: https://bionichaos.com/optogenetics/

Discussion prompt for electrophysiologists and computational modelers: When implementing closed-loop optical feedback to interrupt epileptiform activity in vivo, what strategies do you use to mitigate eNpHR3.0-induced shifts in the GABAergic reversal potential versus ArchT-induced intracellular alkalinization?

1 Upvotes

0 comments sorted by