Abstract
In optogenetics, light signals are used to control genetically engineered photoreceptors, and in turn manipulate biological pathways with unmatched precision. Recently, evolved photoreceptors with diverse in vitro-measured wavelength and intensity-dependent photoswitching properties have been repurposed for synthetic control of gene expression, proteolysis, and numerous other cellular processes. However, the relationship between the input light spectrum and in vivo photoreceptor response dynamics is poorly understood, restricting the utility of these optogenetic tools. Here, we advance a classic in vitro two-state photoreceptor model to reflect the in vivo environment, and combine it with simplified mathematical descriptions of signal transduction and output gene expression through our previously engineered green/red and red/far red photoreversible bacterial two-component systems (TCSs). Additionally, we leverage our recent open-source optical instrument to develop a workflow of spectral and dynamical characterization experiments to parameterize the model for both TCSs. To validate our approach, we challenge the model to predict experimental responses to a series of complex light signals very different from those used during parameterization. We find that the model generalizes remarkably well, predicting the results of all categories of experiments with high quantitative accuracy for both systems. Finally, we exploit this predictive power to program two simultaneous and independent dynamical gene expression signals in bacteria expressing both TCSs. This multiplexed gene expression programming approach will enable entirely new studies of how metabolic, signaling, and decision-making pathways integrate multiple gene expression signals. Additionally, our approach should be compatible with a wide range of optogenetic tools and model organisms.
Significance statement Light-switchable signaling pathways (optogenetic tools) enable precision studies of how biochemical networks underlie cellular behaviors. We have developed a versatile mathematical model based on a two-state photoconversion mechanism that we have applied to the E. coli CcaSR and Cph8-OmpR optogenetic tools. This model enables accurate prediction of the gene expression response to virtually any light source or mixture of light sources. We express both optogenetic tools in the same cell and apply our model to program two simultaneous and independent gene expression signals in the same cell. This method can be used to study how biological pathways integrate multiple inputs and should be extensible to other optogenetic tools and host organisms.
Introduction
Most optogenetic tools are based on a photoreceptor protein with a light-sensing domain that regulates an effector domain, which in turn generates a biological signal such as gene expression. One can consider a simplified model wherein a photoreceptor is produced in a ‘ground’ state and switched to an ‘active’ state by activating wavelengths (i.e. forward photoconversion)1. Active state photoreceptors thermally revert to the ground state with a characteristic timescale that ranges from milliseconds2 to more than a month3. Certain photoreceptors, exemplified by the linear tetrapyrrole (bilin)-binding phytochrome (Phy) and cyanobacteriochrome (CBCR) families are also photoreversible where reversion from the active to ground state is driven by deactivating wavelengths4–6.
Two-component systems (TCSs) are signal transduction pathways that control gene expression and other processes in response to chemical or physical stimuli (inputs). Canonical TCSs comprise two proteins; a sensor histidine kinase (SK) and a response regulator (RR). The SK is produced in a ground state, which often has low kinase activity toward the RR. When it detects an input via a N-terminal sensing domain, the SK uses ATP to autophosphorylate on a histidine residue within a C-terminal kinase domain. This phosphoryl group is then transferred to an aspartate on the RR. In most cases the phosphorylated RR (RR~P) binds to a target promoter, activating transcription. Many SKs are bi-functional and the kinase domain dephosphorylates the RR~P in the absence of the input or presence of a different, de-activating input.
We have previously engineered two spectrally distinct photoreversible E. coli TCSs, CcaSR and Cph8-OmpR7–9. CcaS is a SK with a CBCR sensing domain that absorbs light via a covalently ligated phycocyanobilin (PCB) chromophore produced by an engineered metabolic pathway. Holo-CcaS is produced in an inactive, green light sensitive ground state, termed Pg, with low kinase activity. Upon green light exposure, CcaS Pg switches to a red light sensitive active state (Pr) with high kinase activity toward the RR CcaR. CcaR~P binds to the promoter PcpcG2−172, activating transcription. Red light drives CcaS Pr to revert to Pg. Cph8 is a chimeric SK containing the PCB-binding Phy light-sensing domain of Synechocystis PCC6803 Cph1 and the signaling domain of E. coli EnvZ. In contrast to CcaS, Cph8 has high kinase activity toward the E. coli RR OmpR in the ground state (Pr) and low kinase (high phosphatase) activity in a far-red absorbing activated state (Pfr). OmpR~P binds and activates transcription from the PompF146 promoter. Data from our group and others suggest that CcaS Pr is stable for hours or more10,11 while Cph8 Pfr is far less stable11.
Recently, we developed predictive phenomenological models of the responses of CcaSR and Cph8-OmpR to green and red light intensity signals, respectively11. These models describe a three step dynamical response comprising a pure delay, an intensity-dependent first-order transition in output gene expression rate, and a first-order transition in the concentration of the output gene set by cell growth rate. By measuring the expression of a reporter gene over time in response to a series of light step-changes of different initial and final intensities, we parameterized these three timescales for both light sensors.
Next, we used these models to program tailor-made gene expression signals with an unrivaled degree of control and predictability11. In particular, we combined the models with a custom ‘light program generator’ algorithm that accepts a reference (desired) gene expression signal as an input and produces a green or red light signal that drives CcaSR or Cph8-OmpR to produce that gene expression output experimentally. We utilized this ‘biological function generator’ method to create linear ramps and sine waves of a transcriptional repressor in order to characterize the input/output dynamics of a synthetic gene circuit11.
Despite their utility, our previous models have several key limitations. First, they can only predict the responses of the optogenetic tools to the specific light sources used during parameterization. Second, they cannot account for perturbations introduced by secondary light sources such as those that might be used for simultaneous measurement of fluorescent reporter proteins or multiplexed control of both tools in the same cell. Third, the models yield few insights into the mechanistic origin of the observed response dynamics. For example, the models captured, but could not elucidate the origin of, our observation that the rate of the gene expression transition depends upon the direction and final intensity of the light step change.
An in vitro two-state model1,12,13 describing the intensity and wavelength dependence of switching between ground and active states has previously been used to describe photoswitching of Phys1, CBCRs3, bacteriophytochromes13, LOV domains14, and Cryptochromes15 among others. In this model, the sensors are characterized by their ground- and active-state photoconversion cross sections (PCSs), σg(λ) and σa(λ), which enable direct calculation of the forward and reverse photoconversion rates, k1 and k2, in response to photons of wavelength λ. The PCS, expressed as the photoconversion rate per unit light intensity (min−1 [µmol m−2 s−1]−1), is proportional to the product of ε(λ), the molar extinction coefficient (m2 mol−1), which is related to the probability of the photoreceptor absorbing a photon, and the ϕ(λ), the quantum yield (unitless), which describes the probability of photoconversion upon photon absorption. Given knowledge of both PCSs (σi(λ)), one can compute both photoconversion rates (ki) for a light source with a known spectral flux density nlight(λ) (µmol m−2 s−1 nm−1) by calculating the spectral overlap integral ki = ∫ σi · nlight dλ. The photoconversion rates can then be used to calculate the populations of ground and active state photoreceptor.
Despite its potential for predicting photoreceptor responses to virtually any light condition, the two-state model has not been explored for optogenetics. In particular, the complete σi(λ) has not been determined for any photoreceptor used in optogenetics. Even if σi(λ) were to be determined, the two-state model would need to be extended to capture photoreceptor production and decay dynamics in the in vivo environment. Finally, an additional model would be needed to capture the biological events that occur downstream of the photoreceptor.
Here, we extend the two-state model for the in vivo environment, develop a new strategy for estimating σi(λ) in vivo, and combine these efforts with simplified descriptions of TCS signaling and gene expression for CcaSR and Cph8-OmpR. We then develop a standard set of spectral and dynamic characterization experiments to parameterize the overall TCS photoswitching model. We validate the models by predicting and measuring the gene expression response of both systems to spectrally and dynamically diverse light programs. Finally, we express CcaSR and Cph8-OmpR in the same cell and combine the models with our biological function generator approach to achieve the first multiplexed programming of gene expression dynamics.
Results
TCS photoconversion model
We constructed a TCS ‘sensing model’ (Methods) by adding terms for production of new ground state photoreceptors (Sg) at rate kS and dilution of Sg and active state photoreceptors (Sa) at rate kdil to the two-state model (Fig. 1a). The sensing model accepts any nlight(λ) input and produces Sg and Sa populations as an output (Fig. 1b,c). The ratio Sa/Sg feeds into an ‘output model’ comprising a phenomenological description of TCS signaling and a standard model of output gene expression (Fig. 1c). The TCS signaling model (Methods) describes a pure time delay (τ) and Hill-function mapping between Sa/Sg and output gene production rate (kG). In our initial experiments, we utilize superfolder GFP (G) as the output and quantify its expression level in Molecules of Equivalent Fluorescein (MEFL). is the range of possible kG values, is the minimum value of kG, n is the Hill parameter, and k is Sa/Sg ratio resulting in 50% maximal system response. Together, these terms capture SK autophosphorylation, phosphotransfer, RR dimerization, DNA binding, promoter activation, and G production. G is degraded in a first-order process with rate kdil (Methods), and has a minimum concentration and concentration range given a constant cell growth rate.
Light source model
Most light sources have a fixed spectral flux density (i.e. output spectrum) that scales with light intensity (I, µmol m−2 s−1). For such light sources, we can write where is the output spectrum at 1 µmol m−2 s−1. To quantify the overlap between nlight and σi for a given photoreceptor, we introduce as the photoconversion rate per unit light intensity (min−1 [µmol m−2 s−1]−1). Then, for a given light source, . That is, k1 and k2 take on values proportional to light intensity.
Dynamical and spectral characterization of CcaSR
We designed a set of four gene expression characterization experiments (File S1-2, Note S1-2) to train the TCS photoconversion model for CcaSR (Fig. 2a). First, we quantify activation dynamics by preconditioning E. coli expressing CcaSR (Fig. S1) in the dark, introducing step increases in green light (centroid wavelength λc = 526 nm, Table S1–3, File S3-4, Note S3) to different intensities, and measuring sfGFP levels over time by flow cytometry (Methods, Fig. 2b, S2). Second, we measure de-activation dynamics by preconditioning the cells in different intensities of green light and measuring the response to step decreases to dark (Fig. 2c, S2). Third, we measure the ground state spectral response by exposing the bacteria to 23 LEDs with λc spanning 369 to 958 nm at over three orders of magnitude intensity (Methods, Fig. 2d, S3, Table S1–3, File S3-4, Note S3) and measuring sfGFP at steady state. Finally, we measure the activated state spectral response by repeating the previous experiment in the presence of a constant intensity of activating light (Fig. 2e, S3).
CcaSR model parameterization
We used nonlinear regression (Methods, Table S4) to fit the model to these data. While the resulting parameters recapitulate the known properties of the system (Fig. 2f-g, S4), the value of the Hill parameter k is weakly determined (Table S4). In particular, alterations in k from the best-fit value can be compensated for by changes in and (Fig. S5). Thus, we cannot confidently determine the absolute rates of forward and reverse photoconversion. Nonetheless, fixing k at its best fit value results in model predictions that quantitatively agree with the experimental measurements (Fig. 2b-e). However, the ultimate validation of this approach involves predicting the response of CcaSR to a wide range of spectral and dynamical light inputs different from those used in parameterization.
Spectral validation of the CcaSR photoconversion model
To predict the response of an optogenetic tool to a given light source, knowledge of σi is required. To estimate σi for CcaSR, we used non-linear regression to fit a cubic spline to the previously determined photoconversion rates for each of the 23 LEDs (Methods Fig. 3a, Fig. S6–7). Importantly, our regression procedure considers the response of CcaSR to the full spectral output of each LED, not just its centroid wavelength. To validate the resulting σi estimate, we measured for a previously untested set of eight color-filtered white light LEDs designed to have complex spectral characteristics (Table S1–3, File S3-4, Note S3) and calculated an expected for each (Fig. 3b). In combination with the remaining model parameters (Fig. 2f), we used these to predict the steady state intensity dose-response to these eight LEDs in the presence and absence of activating light (λc = 526 nm). These predictions are remarkably accurate for LEDs 1-5 (root-mean-square errors (RMSEs) from 0.11 to 0.18, Methods), which drive sfGFP to high levels, and 7 and 8, which drive low expression (RMSE = 0.14 and 0.18, respectively), but slightly less so for LED 6 (RMSE = 0.26), which drives sfGFP to an intermediate expression level (Fig. 3c).
Dynamic validation of the CcaSR photoconversion model
Our biological function generator method constitutes a rigorous validation of the predictive power of a model because the light inputs and gene expression outputs are temporally complex and cover a wide range of levels. To validate our CcaSR photoconversion model, we first designed a challenging reference gene expression signal (Fig. 4, File S5). The signal starts at b and then increases linearly (on a logarithmic scale) over 90% of the total CcaSR response range over 210 min. After a 60 min. hold, the signal decreases linearly to an intermediate expression level over another 210 min. Using this reference, we then used the model to computationally design four light time courses each with different LEDs or LED mixtures (Methods, File S6). “UV mono” utilizes a single UV LED (λc = 389 nm) (Fig. 4a) to demonstrate control of CcaSR with an atypical light source. “Green mono” uses the λc = 526 nm LED (Fig. 4b) to demonstrate predictive control with a typical light source. “Red perturbation” combines “Green mono” with a strong red (λc = 657 nm) sinusoidal signal (Fig. 4c) designed to demonstrate the perturbative effects of alternative light sources. Finally, in “Red compensation”, the “Green mono” time course is re-optimized to compensate for the impact of “Red perturbation” (Fig. 4d, Methods).
The model accurately predicts the response of CcaSR to all four light signals (Fig. 4). “Mono UV” presents the greatest challenge, resulting in an RMSE of 0.15 (Fig. 4a). We suspect that prediction errors in this program are due to PCB photodegradation, as we observed no significant toxicity via bacterial growth rate, and the prediction remains accurate until UV reaches maximum intensity (20 µmol m−2 s−1). “Green mono” (Fig. 4b) results in the lowest error (RMSE = 0.038), which is expected because this LED was used to perform the dynamic calibrations (Fig. 2b,c). As intended, “Red perturbation” results in an enormous deviation from the reference signal (Fig. 4c), and the model accurately predicts this effect (RMSE = 0.081). Finally, “Red compensation” demonstrates that the effect of the perturbation can be eliminated using our model (Fig. 4d, RMSE = 0.078).
Cph8-OmpR photoconversion model
To evaluate the generality of our approach, we repeated the entire workflow for Cph8-OmpR (Fig. S8–13, Table S5, File S6-7). Though CcaSR and Cph8-OmpR are both photoreversible TCSs, they have different photosensory domains, ground state activities, and dynamics. To account for the fact that Cph8-OmpR is produced in an active ground state, we used a repressing Hill function (Methods). The model again fits exceptionally well to the experimental data (Fig S8–11). Unlike CcaSR, which exhibited no detectable dark reversion (Fig. 2f), Cph8-OmpR appears to revert in (Fig. S8f). As before, k is underdetermined, and we chose the best-fit value (Table S5). The Cph8-OmpR model performs similarly to its CcaSR counterpart in the spectral validation experiments (Fig. S12), and demonstrates greater predictive control in the dynamical validation experiments (Fig. S13).
Development of a CcaSR, Cph8-OmpR dual-system model
We engineered a three-plasmid system (Fig. S1) to express CcaSR and Cph8-OmpR in the same cell with sfGFP and mCherry outputs, respectively (Fig. 5a). Because the photoconversion parameters are a property of the photoreceptors themselves, we left them unchanged. To recalibrate for mCherry (quantified in Molecules of Equivalent Cy5 (MECY)) and any changes due to the new cellular context, we measured the steady state levels of the sfGFP and mCherry at different combinations of green (λc = 526) and red (λc = 657) light (Fig. 5b, S14, File S8) and refit the Hill function parameters (Table S6). The dual-system model accurately captures the experimental observations from the characterization dataset (Fig. 5b).
To validate the dual-system model, we again used the biological function generator approach (Fig. 6). We designed a series of four dual sfGFP/mCherry expression programs to increasingly challenge the model: “Green mono” using only green light and intended only to control CcaSR (Fig. 6a), “Red mono” using only red light and intended to control only Cph8-OmpR (Fig. 6b), “Sum”, a simple combination of the first two programs (Fig. 6c), and “Compensated sum” where the green light time course is re-optimized to account for the presence of the red signal (Fig. 6d) as before (Methods). Due to the minimal response of dual-system Cph8-OmpR to green light (Fig. 5b), there was no need to adjust the red program to compensate for the presence of green light. The validation experimental results (Fig. 6) show that our dual-system model accurately captures both the sfGFP and mCherry expression dynamics. The CcaSR predictions are nearly as accurate as the single-system experiments (Fig. 4), and the Cph8-OmpR results match single-system accuracy (Fig. S12–13), demonstrating the extensibility of our approach to multiple optogenetic tools.
Multiplexed biological function generation
Finally, we designed and experimentally implemented four multiplexed sfGFP/mCherry expression functions representing classes of signals useful for gene circuit characterization (File S5-6). “Dual sines” illustrates that two gene expression sinusoids with different offsets, amplitudes, and periods can be composed without interference (Fig. 7a). Variations of this combination of signals could be used to perform frequency analysis of multiple nodes in a gene network. “Sine and stairs” demonstrates that our approach can generate two completely different gene expression signals at the same time (Fig. 7b). “Dual stairs” demonstrates that the ratio of two proteins can be varied over a remarkably wide range (Fig. 7c). Finally, “Time-shifted waveform” (Fig. 7d) demonstrates that our approach can be used to characterize genetic circuits where time-delays are critical, such as those involved in cellular decision-making.
Discussion
In this study, we demonstrate the first use of a mechanistic model of wavelength-dependent photoconversion to characterize and control light responsive signaling pathways in vivo. Additionally, we develop a standard set of characterization and validation experiments to parameterize the model and demonstrate that it accurately predicts the spectral and dynamical performance of these optogenetic tools. We demonstrate that the models can be used with virtually any light source or mixture of light sources as long as their emission spectra are known. Finally, we exploit this unique predictive power to demonstrate the first programming of two independent gene expression signals by accounting for inherent cross-talk in the action spectra of the two optogenetic tools that would otherwise impede such efforts.
Our TCS photoconversion model is superior to current alternatives by several key criteria. First, like our previous model11, it is quantitatively predictive and requires no parameter recalibrations from day-to-day. However, while our previous model is restricted to a single light source, our current model generalizes to virtually any light source or mixture of light sources. Second, our TCS photoconversion model is compatible with photoreceptors with very different action spectra, opposite ground versus active state signaling logic, and dramatically different dark reversion timescales. Third, our current model modularly decouples the processes of sensing (photoconversion) and output (signal transduction and gene expression). The sensing model component (Fig. 1a) should be compatible with a wide range of photoreceptors, including those in other organisms, because the core two-state photoswitching mechanism is used to describe their performance in vitro. Then, to describe optogenetic tools based upon those photoreceptors, our TCS output model can be replaced with alternatives appropriate to other pathways, as needed.
A major current problem in optogenetics is that tools developed in different studies are characterized using different culturing conditions, experiments, light sources, reporters, metrics, and so on. This lack of standardization makes it challenging to compare the performance features of different optogenetic tools on even a qualitative basis. The modeling and characterization approach we develop here could be used to make data sheets that describe the behavior of diverse optogenetic tools in standard units. This would enable researchers to choose the most appropriate tool for different applications. Additionally, shortcomings of specific tools could be identified, informing efforts to optimize performance by rational approaches such as protein design16–18.
Our approach should enable better control of optogenetic tools with alternative or highly constrained optical hardware used in many research laboratories. For example, many groups perform single cell optogenetic studies using fluorescence microscopes with severely restricted optical configurations. Alternatively, consumer projectors or tablet displays are potentially powerful, low cost hardware options for optogenetics19,20. The output spectrum of the light source can be measured and integrated into our workflow. After a simple recalibration (e.g. Fig. 5) to account for any changes due to the new growth environment, one should be able to predict and control the optogenetic tool using the new light source.
Oftentimes, it is desirable to simultaneously control an optogenetic tool while imaging a cell of interest using white light sources and excitation light for fluorescent reporters. Such alternative sources of illumination can have deleterious effects on the ability to control the optogenetic tool. However, if the nature of the alternative light signal is known, our approach can compensate for such perturbations (e.g. Fig. 6, 7). In silico feedback control has also been used to drive desired gene expression dynamics in optogenetic experiments21–23. The major benefit of this approach is that perturbations of unknown origin can be compensated by monitoring deviations in the output of an optogenetic tool relative to a reference. Our model is compatible with in silico feedback control.
While basic multichromatic control of optogenetic tools has been previously demonstrated8,24, the multiplexed biological function generation approach demonstrated here dramatically extends the capabilities of these systems, enabling implementation of several classes of experiments. First, the two-dimensional response of a genetic circuit or signaling pathway could be rapidly evaluated with high reproducibility and precision. For example, one could map the response of 2-input transcriptional logic gates25, which integrate the expression levels of two different transcription factors by systematically and independently varying their expression levels while measuring the gate output with a reporter gene. The dynamics of such gates are otherwise difficult to evaluate and seldom characterized26. Second, the input/output dynamics of a transcriptional circuit could be characterized as a function of the state of the circuit itself. For example, one could evaluate how well a synthetic transcriptional oscillator can be entrained27,28 as a function of the strength of a feedback node. In this case, one optogenetic tool could be used for the entrainment, while the second was used to alter expression level of a circuit transcription factor regulating feedback strength. Third, transcription and proteolysis29 could be independently controlled with two different optogenetic tools to alternatively program rapid increases or decreases in expression level. Such an approach could accelerate the gene expression signals that we have generated in this and our previous study11, enabling characterization of gene circuit dynamics on faster timescales. Finally, multiplexed biological function generation could be used to evaluate how the timing of expression of two genes impacts cellular decision making30–32. For example, in B. subtilis, the gene circuits that regulate sporulation and competence compete via a ‘molecular race’ in the levels of the corresponding master regulators30. By placing them under independent optogenetic control, the means by which their dynamics impact these cellular decisions could be evaluated more easily and rigorously.
Materials and Methods
Bacterial strains
All systems utilize the E. coli BW29655 host strain33. The CcaSR system strain carries the pSR43.6 and pSR58.6 plasmids, which confer spectinomycin and chloramphenicol resistance, respectively9. The Cph8-OmpR system strain carries the pSR33.4 (spectinomycin) and pSR59.4 (ampicillin) plasmids9. The dual-system strain carries pSR58.6, pSR78 (spectinomycin), and pSR83 (ampicillin).
Bacterial growth and light exposure
Cell culturing and harvesting protocols were developed to ensure a high degree of precision and reproducibility in experiments both from well-to-well and from day-to-day (Note S1). Cells were grown at 37°C and shaken at 250 rpm throughout the experiment (Sheldon Manufacturing Inc. SI9R) with temperature calibrated and logged by placing a thermometer probe in a sealed 125 mL water-filled flask (Traceable Excursion-Trac 6433). Cultures were grown in M9 media supplemented with 0.2% casamino acids, 0.4% glucose, and appropriate antibiotics. Precultures were prepared in advance by freezing 100 µL aliquots of early exponential phase cultures (OD600 = 0.1−0.2) grown in the same media conditions at −80°C (Note S2). Cultures were inoculated at low densities (typically OD600 = 1 × 10−5) to ensure that final densities did not reach stationary phase (OD600 < 0.2). For each experiment, 192 cultures were grown in 500 µL volumes within 24-well plates (ArcticWhite AWLS−303008), sealed with adhesive foil (VWR 60941–126).
Experiments were performed using eight 24-well Light Plate Apparatus (LPA) instruments34, enabling precise control of two LEDs to define the optical environment of 192 cultures at a time. LPA program files were generated using Iris34 and Python scripts.
LED measurement
All LEDs were measured and calibrated (Note S3) using a spectrometer (StellarNet UVN-SR-25 LT16) with NIST-traceable factory calibrations performed on both its wavelength and intensity axes immediately prior to use for this study. A six-inch integrating sphere (StellarNet IS6) was used, enabling measurement of the total power output of each LED (in µmol s−1). The spectrophotometer was blanked by a measurement of a dark sample before each LED measurement. Measurements were saved as .IRR files, which contain the complete LED spectral power density Plight(λ) (µmol s−1 nm−1) in 0.5 nm increments as well as all setup parameters for the measurement (i.e. integration time and number of scans to average). These files were processed by Python scripts to calculate the LED characteristics, including the peak, centroid, FWHM, and total power. For spectral validation experiments, cinematic lighting filters (Roscolux) were cut, formed into LED-shaped caps, and fitted atop white LEDs (Table S1).
Calculation of nlight
Because the LEDs we utilize have fixed spectral characteristics, the spectral flux density (µmol m−2 s−1 nm−1) incident on the photoreceptors can be parameterized by the LED intensity (µmol m−2 s−1). The cultures are shaken throughout the experiment, and we assume that the cells are well mixed within the culture volume. Thus, the mean light intensity within the culture volume, nlight (λ), can be calculated by integrating the intensity throughout the volume of the well. Under the assumption of negligible light absorption by the culture sample (the M9 media is transparent, and the cultures are harvested at low density), this integral simplifies to become the total power of the LED (µmol s−1) divided by the cross-sectional area of the well. Given a well radius of 7.5 mm, we calculate .
LED calibration
Each of the approximately 700 individual LEDs used in the study were measured (Note S3), enabling compensation for variation in LED and LPA manufacturing (Table S1–3). Each LED was calibrated while powered from the same LPA socket used in experiments. First, a sample of LEDs were measured to identify the electrical current required to achieve an appropriate level of total flux, ∫ nlight(λ)dλ. The amount of current required varied depending on the wavelength and manufacturer. The current was adjusted using the LPA ‘dot-correction (DC)’ to achieve a total flux approximately 20% above 20 µmol m−2 s−1 when the LED was fully illuminated. The appropriate DC level was determined for each LED model. Using these DC levels, the complete set of LEDs were measured. LEDs that produced a total flux below 20 µmol m−2 s−1 were re-measured at a higher DC level. This set of LED measurements was used to convert the desired intensity time course of each LED into a series of 12-bit grayscale values (i.e. 0–4095) used by the LPA. The LPA reads the grayscale values to produce the appropriate pulse-width-modulated (PWM) signal to achieve the desired intensities.
Bacterial sample harvesting
Cultures were harvested for measurement (Note S1) after precisely 8 h growth by placing the 24-well plates into ice-water baths. Each culture was then subjected to both an absorbance measurement to ensure consistent well-to-well and day-to-day growth, and flow cytometry for quantification of sfGFP or mCherry expression. Absorbance measurements were performed in black-walled, clear-bottomed 96-well plates (VWR 82050-748) in a plate reader (Tecan Infinite M200 Pro). Before fluorescence measurements were performed, culture samples were processed via a fluorescence maturation protocol to ensure measurements were representative of the total amount of produced fluorescent reporter11. Rifampicin (Tokyo Chemical Industry R0079), was dissolved in Phosphate-buffered saline (PBS, VWR 72060-035) at 500 µg/mL and used to inhibit sfGFP production during maturation.
Flow cytometry
Population distributions of fluorescence were measured for each culture on a flow cytometer as previously described11. A calibration bead sample (Spherotech RCP-30-5A) in PBS was measured immediately prior to the culture samples from each experimental trial. At least 5,000 events were collected for the calibration bead sample, and at least 20,000 events were collected for each culture sample.
Flow cytometry data analysis
Single-cell distributions of sfGFP fluorescence were gated, analyzed, and calibrated into MEFL and MECY units using FlowCal35. Measurements were gated on the FSC and SSC channels using a gate fraction of 0.3 for calibration beads and 0.8 for cellular samples35. Reported culture fluorescence values are the arithmetic means of the cellular populations.
Sensing model
The light sensing model can be described by the following system of ODEs: where the variables and rates have been described in the text and figures. Note that k1 and k2 are implicitly dependent upon time, as they are functions of the time-varying light environment of the sensors.
If we substitute for the fraction of active sensors, , the system reduces to: where ktot ≡ k1 + k2 + kdil + kdr.
This ODE can be solved analytically for a step-change in light from one environment to another. If the step-change occurs at time t = 0, then k1,k2, and ktot are all fixed for t > 0. Given an initial sensor fraction y(0) = y0, we find.
This solution represents an exponential transition from an initial sensor fraction of y0 to a final fraction given by with a time constant set by ktot. As a result, we anticipate that the transition dynamics of y(t) will be slowest under zero illumination when ktot = kdil + kdr. We also expect that the transition rates will be unbounded as intensity increases.
Finally, for multiple light sources, we simply linearly combine the photoconversion rates from each source: .
TCS signaling model
We utilize a highly simplified model of TCS signaling and gene regulation. This model relates the production rate of the output gene kG(t) to the active ratio of light sensors . We model TCS signaling as a pure time delay τ and a sigmoidal Hill function. For CcaSR, the Hill function is activated by increasing sensor ratios, while for Cph8-OmpR the inverted TCS signaling activity results in a repressing Hill function. Thus, we write for CcaSR and for Cph8-OmpR.
Output gene expression model
We model output gene expression by first-order production and dilution dynamics:
Generation of model simulations
Simulations were produced by numerically integrating the system of ODEs using Python’s scipy.integrate.ode method using the ‘zvode’ integrator with a maximum of 3000 steps.
Model parameterization
The CcaSR and Cph8-OmpR models were parameterized using global fits of the model parameters to the complete training data sets (Fig. 2b-e, Fig. S8b-e). The ‘lmfit’ Python package, which is based on the Levenberg-Marquardt minimization algorithm, was used to perform the fits and analyze the resulting parameter sets36. The fits were performed by minimizing the sum of the square of the relative error between each measured data point and the same point in a corresponding model simulation. Thus the form of the error metric utilized was error across the complete set of data points .
Estimation of PCSs
PCS estimates were constructed by linearly regressing a cubic spline to the experimentally determined photoconversion rates in order to produce a continuous PCS (Fig. S6). The were produced by minimizing the error between unit experimental photoconversion rates (Fig. 2f, Fig. S8f) and spline-derived estimates . The splines were constructed by establishing a series of integral constraints for the photoconversion rates, continuity constraints for the spline knots, and boundary constraints. As this problem contains more constraints than parameters, optimization is required. We used weighted least-squares with Lagrange multipliers to optimize each spline. To avoid over-parameterization of the , we used “Leave-one-out cross-validation (LOOCV)” to evaluate the performance of optimal splines with between 5 and 20 knots in order to determine the ideal number required for each (Fig. S7).
Calculation of prediction error (RMSEs)
For model validation we use a relative error metric that reports the root-mean-square (RMS) of the log10 error between the predicted and measured responses.
Light program generator (LPG) algorithm
The light program generator was used as previously described11. The only modification was to use simulations generated by the model described herein rather than the previous model. Compensated light programs were generated by incorporating the presence of the external light signal into the model simulations.
Author contributions
EJO and JJT conceived of the project. EJO designed and performed experiments and analyzed data. CNT assisted with the photoconversion cross-section estimates and design/performance of spectral validation trials. EJO and JJT wrote the manuscript.
Conflict of interest
The authors declare no conflict of interest.
Acknowledgements
We thank Sebastian Schmidl for providing the dual-system strain, Prabha Ramakrishnan and Karl Gerhardt for helpful discussions on the design of the characterization experiments, Sebastian Castillo-Hair for helpful ideas on constructing the photoconversion cross-section estimates, and Keshav Rao for assistance with data collection. This work was supported by the Office of Naval Research (MURI N000141310074) and an NSF CAREER award (1553317).