Engineering Success
Measurement
Reliable ratio measurement is the readout foundation of the entire project: all downstream modules ultimately need to answer whether the ratio of two cell states can be quantified. To this end, we built and characterised three complementary measurement platforms—solution phase, single colony, and single cell —along with confocal microscopy for spatial confirmation and a pair of single-reporter positive control plasmids for method validation.
Microplate reader
Cycle 1 · Design
Objective: Establish a measurement method based on GFP and mCherry dual-channel fluorescence from a plate reader to convert fluorescence readings from mixed bacterial suspensions into the fraction of GFP-positive bacteria, providing population proportion inputs for the subsequent application model.
Design Approach and Parameters:
- Standardisation of bacterial suspensions: Use a NanoDrop to adjust the OD600 of both GFP-positive and mCherry-positive bacterial suspensions to approximately 1, then mix them by volume ratio to control the total bacterial population as closely as possible and reduce the effects of differences in cell density on fluorescence readings.
- Ratio series: Decrease the volume fraction of GFP-positive bacteria from 1.00 to 0 in increments of 0.05, giving 21 ratio levels, with 3 replicate wells per ratio and 63 measurement points in total.
- Independent validation points: Include three additional ratios outside the main grid: 0.075, 0.275, and 0.575. Use 3 replicate wells for each of the first two ratios and 2 replicate wells for 0.575, giving 8 measurement points in total that are excluded from model fitting.
- Measurement settings: Use Ex460/Em512 for the GFP channel and Ex560/Em620 for the mCherry channel, and also measure OD600.
- Controls: Include medium blank wells, PBS controls, and single-positive bacterial controls to check background signals and interference between channels.
- Overall strategy: First examine the relationship between fluorescence signals and mixing ratios, as well as the effects of background signals and cell density; then compare candidate models and evaluate predictive performance using independent test points.
The mixing series prepared by volume ratio serves as the calibration standard. For it to approximate cell proportions, the two strains must have similar numbers of cells per unit volume. OD600 standardisation supports this approximation but does not directly establish that the cell numbers of the two strains are exactly equal.
Cycle 1 · Build & Test
-
Turn 1 · Preparing the Ratio Series and Performing Dual-Channel Measurements
- bAdjust the OD600 of the two single-positive bacterial suspensions to approximately 1. Then prepare the 21 main ratio levels and 3 independent validation ratios as designed. Measure both fluorescence channels and OD600 in each well, using NanoDrop readings as a reference when preparing the suspensions.
- tExamine whether the fluorescence responses in the two channels change with the GFP fraction, and check the relationship between OD600 and the mixing ratio.
- lThe GFP channel signal increases approximately linearly with the GFP fraction, while the mCherry channel signal decreases. The independent validation points generally lie near the trend of the main ratio series, supporting further development of a calibration relationship between fluorescence signals and mixing ratios. The OD600 values of the 71 ratio samples range from 0.4155–0.6746, with a Pearson correlation coefficient of −0.112 against the GFP fraction and p=0.355; no significant linear correlation was observed.
Figure 1. Dual-channel fluorescence across the ratio series. The GFP channel signal increases with the GFP fraction and the mCherry channel signal decreases; the independent validation points sit near the trend of the main series. -
Turn 2 · Checking Background Signals and Channel Interference
- dRetain both fluorescence channels in subsequent analyses and continue recording OD600 to check whether cell density may affect predictions. Use the main ratio series for fitting and the independent validation points to evaluate the model's predictive performance.
- bInclude medium blank wells (n=6), PBS controls (n=3), and pure mCherry bacterial samples (n=3), and compare their GFP channel readings.
- tUse Welch's t-test to compare GFP channel signals from pure mCherry bacteria with those from the two types of bacteria-free controls, and assess potential interference together with the OD600 check results.
- lGFP channel readings are similar for the blank and PBS controls, while those from pure mCherry bacteria are higher. Comparisons of pure mCherry bacteria with the blank and PBS controls yield p=0.0009 and p=0.0027, respectively, indicating that bacterial samples without GFP still contribute additional signals in the GFP channel, consistent with the channel interference observed in preliminary experiments. Medium blank subtraction can correct the background but cannot simultaneously eliminate cell-associated background or channel crosstalk.
Figure 2. Background signals and cell density. GFP channel readings for the medium blank, PBS and mCherry-only samples, alongside OD600 against the GFP fraction across the ratio series. -
Turn 3 · Testing the Usability of a Simple Fluorescence Ratio
- dInclude blanks and single-positive controls on the same plate in the same measurement run. Correct each channel separately using medium blanks from the same batch, then establish an empirical calibration model using known mixing ratios so that the predictive relationship incorporates channel responses under the current measurement conditions. After measurement conditions change, background signals and calibration applicability should be reassessed.
- bTry using the GFP signal as a fraction of the total dual-channel signal as a ratio metric, and examine whether it can directly represent the fraction of GFP-positive bacteria.
- tFirst examine the signal ratio without background subtraction, then evaluate the background-corrected ratio variable and its linear and quadratic fitted forms in the model comparison.
- lWithout background subtraction, the ratios for pure mCherry samples show anomalous values of approximately −247.9, 9.0, and 347.1. The two channel readings in these samples nearly cancel when summed, making the division sensitive to signal fluctuations and indicating that raw fluorescence ratios cannot be directly interpreted as cell fractions. After these three points are excluded, the remaining 68 ratio samples have a Pearson correlation coefficient of 0.736 and a Spearman correlation coefficient of 0.996, indicating a strong monotonic relationship between the signal ratio and mixing ratio, but not a simple linear correspondence. The background-corrected signal ratio also cannot be directly equated with the cell fraction.
Figure 3. The ratio of the GFP signal to the summed dual-channel signal, with the y = x line for reference, and the corresponding summed denominator in the same samples. -
Turn 4 · Comparing Models and Selecting a Calibration Method
- dUse the fluorescence ratio as an input to candidate models rather than directly as a fraction estimate, and evaluate it alongside single-channel and dual-channel models. Compare predictive performance through cross-validation and independent testing.
- bEstablish seven candidate models using background-corrected GFP and mCherry signals, including single-channel linear, dual-channel linear, ratio-based linear, ratio-based quadratic, GFP quadratic, and dual-channel random forest models.
- tPerform leave-one-fraction-level-out cross-validation (LOGO-CV) on the 63 main ratio measurement points and evaluate model performance using the 8 reserved test points, examining prediction errors with R², RMSE, and MAE.
- lThe M3 dual-channel linear model has the highest cross-validation R², at 0.9956; its held-out test R² is 0.9098 and RMSE is 0.0582. The M7 random forest performs better on the held-out test, but M3 combines good cross-validation performance with a linear form that is easy to inspect. The ratio-based models perform poorly, indicating that a strong monotonic correlation does not guarantee reliable fraction predictions. M3 shows relatively pronounced underestimation at independent test points near 0.575, indicating that estimates for individual samples still contain errors.
- dSelect M3 as the calibration model under the current measurement conditions and retain M7 as a performance benchmark. Integrate blank correction and M3 predictions into the fluorescence unmixing workbench to support sample data import, fraction calculation, and result export. Further validation across independent batches and different cell densities should be added to better assess the model's range of applicability.
Figure 4. R² and RMSE for the seven candidate models under leave-one-fraction-level-out cross-validation and on the external test set.
Figure 5. Diagnostics for the M3 dual-channel linear model. Predicted against true GFP fraction, and the residuals with the cross-validation ±1 SD band.
Cycle 1 · Learn
Through the experiments and modelling described above, we established a calibration workflow for estimating the fraction of GFP-positive bacteria from dual-channel fluorescence readings. GFP and mCherry signals change in opposite directions as the mixing ratio changes, providing a basis for estimating population proportions using both channels together.
The experiments also show that fluorescence signal ratios cannot be directly equated with cell fractions. Pure mCherry bacteria still contribute additional signals in the GFP channel, and simple ratios are unstable in some samples. Measurements therefore need to combine blank correction from the same batch, single-positive controls, and calibration against known ratios, rather than relying solely on direct division of the two channel signals.
Considering both cross-validation performance and model interpretability, we selected the M3 dual-channel linear model as the current calibration method and integrated it into the fluorescence unmixing workbench. Independent test results support its use for fraction estimation under similar measurement conditions, but underestimation near 0.575 indicates that prediction errors remain. Further validation across independent batches, different cell densities, and additional ratio points will be added to better define the model's range of applicability; the calibration relationship should be reassessed when instrument settings or detection conditions change.
Solid-Culture Fluorescence Ratio Detection Method
Cycle 2 · Design
Goal: To establish a detection method that uses solid medium plating combined with a gel documentation system to distinguish GFP and mCherry fluorescence at the single-colony level, and to reflect the species ratio of the bacterial suspension at the time of plating.
Design rationale and parameters:
- Medium: 40 g/L LB solid medium, 6 cm diameter plates, poured to a thickness of approximately 0.5 cm.
- Imaging instrument: Gel documentation system, allowing direct observation of colony background colour and fluorescence.
- Overall strategy: First, perform gradient dilutions of the single-positive control to identify the concentration and culture time that yield observable single colonies with suitable sizes for counting. Then, perform mixed plating at different GFP:mCherry ratios to test whether the method can strictly reflect the species ratio of the bacterial suspension at the time of plating.
Cycle 2 · Build & Test
-
Turn 1 · High-OD Gradient Preliminary Screening
- dBacterial suspension OD controlled at 0.1–0.5, cultured for 18 h; single-positive control suspension OD controlled at 0.00001–0.0001, cultured for 13.5 h.
- bBacterial suspension OD was set to 0.1, 0.05, 0.01, and 0.001. For each gradient, GFP single-strain plating and GFP+mCherry dual-strain plating at a 1:1 ratio were performed.
- tObservations were made at 8 h, 9 h, and 10 h for colony background colour and fluorescence development.
- lFluorescence was visible, indicating the method is feasible.
Figures 6–8. Plates imaged under the gel documentation system during the first screening round, with green fluorescence visible in the GFP plates and an orange lawn in the mCherry plate. Dual-strain (G+M) and GFP single-strain plates from the high-OD gradient, imaged under the gel documentation system. The same high-OD gradient series, with the GFP single-strain plates in the upper row and the dual-strain plates below them. -
Turn 2 · Low-OD Gradient Fine Screening
- dContinue dilution in the next round to find the appropriate concentration for observable single-colony formation and a suitable culture time for countable colony sizes.
- bBacterial suspension OD was set to 0.001, 0.0001, and 0.00001. For each gradient, GFP single-strain plating and GFP+mCherry dual-strain plating at a 1:1 ratio were performed.
- tObservations were made at 10 h, 11 h, and 12 h for colony background colour and fluorescence development.
The single-positive control at OD 0.00001–0.0001 with 13.5 h culturing yielded suitable results. - lThe single-positive control at OD 0.00001–0.0001 with 13.5 h culturing yielded suitable results. The standard condition was locked in as OD 0.00001–0.0001 with 13.5 h culturing.
Figures 9–11. Plates from the low-OD gradient series at OD 10⁻³, 10⁻⁴ and 10⁻⁵, in which the highest concentration gives the densest growth. The low-OD gradient plates imaged again later in the incubation, when the more dilute plates carry countable colonies. The most dilute plates of the low-OD series, where individual green colonies are resolved well enough to be counted. -
Turn 3 · Ratio Validation
- dNext, perform plating tests at different ratios to verify whether the method can strictly reflect the species ratio of the bacterial suspension at the time of plating.
- bBacterial suspension OD was set to 0.00001. GFP:mCherry ratios of all-GFP, 4:1, 2:1, 1:1, 1:2, 1:4, and all-mCherry were plated.
- tObservations were made at 13.5 h. Ratios were clearly distinguishable, indicating the method is feasible.
- lThe solid-culture fluorescence detection method can strictly reflect the species ratio of the bacterial suspension at the time of plating.
Figure 12. Mixed plating at the GFP:mCherry ratios used for validation, with each plate labelled with the ratio it received.
Cycle 2 · Learn
- Solid plating combined with gel documentation system imaging can reflect the ratio of GFP to mCherry.
- The single-positive control at OD 0.00001 and 13.5 h culturing yields colonies with suitable sizes for counting, and all 7 ratio gradients are clearly distinguishable.
- This condition can serve as a reference for the subsequent standard protocol.
Confocal microscope
Confocal Sample-Preparation Optimisation
Cycle 3 · Design
Develop a sample-preparation method that reduces the effective flow of E. coli during confocal imaging while keeping the objective working distance and fluorescence quality suitable for observation.
Cycle 3 · Build
We first attempted to immobilize or slow the movement of E. coli using agarose pads. However, after adding the agarose pad, the sample thickness changed, resulting in an inappropriate distance between the objective lens and the sample and preventing us from obtaining an ideal imaging plane. Therefore, we further attempted to use a mounting medium for sample fixation and preparation. (https://biotium.com/tech-tips-protocols/tech-tip-imaging-bacteria-using-agarose-pads/)
Cycle 3 · Test
- Compare cell movement and image stability without immobilization.
- Evaluate whether the agarose pad keeps cells in the imaging plane.
- Check whether the added agarose changes the objective-to-sample distance or prevents correct focusing.
- Test the mounting-medium preparation for focus, cell retention, fluorescence background, and image stability.
Cycle 3 · Learn
The agarose pad reduced cell movement but introduced an unsuitable objective distance, making it difficult to obtain the expected imaging plane. The mounting-medium-based preparation provided better imaging performance and was selected as the preferred preparation for subsequent confocal observations.
Flow Cytometry
Cycle 4 · Design
We aimed to use a BD FACSFortessa flow cytometer to analyse amilGFP and mCherry expression in engineered E. coli and to estimate the proportions of green single-positive, red single-positive, apparent double-positive, and double-negative events.
The experiment included a non-fluorescent negative control, an amilGFP-single-positive control, an mCherry-single-positive control, and dual-transformant samples. The negative control was used to define the bacterial population and the background fluorescence range. The single-positive controls were used to identify the positions of the GFP-A and PE-Texas Red-A signals and to assist with setting the gates and quadrants. The dual-transformant samples were analysed to determine whether the two fluorescent populations could be separated and whether flow cytometry could be used for downstream cell-ratio analysis.
Because the two fluorescent reporters were part of the same experimental system, we aimed to determine whether the fluorescence distribution could be resolved into distinguishable bacterial populations and whether the resulting data were sufficiently reliable for quantitative interpretation.
Cycle 4 · Build
After induction, the bacterial samples were washed and resuspended in PBS. All samples were analysed on the BD FACSFortessa using the same acquisition channels. FSC-A and SSC-A were used to identify the bacterial population, amilGFP fluorescence was detected in the GFP-A channel, and mCherry fluorescence was detected in the PE-Texas Red-A channel.
The bacterial population was first identified using the FSC-A versus SSC-A plot. The GFP-A versus PE-Texas Red-A plot, single-parameter fluorescence histograms, and gating statistics were then analysed within the bacterial gate. P1, P2, P3, and Q1-Q4 regions were defined using the negative and single-positive controls.
In the initial experiment, we compared FSC/SSC distributions, single-parameter fluorescence histograms, two-parameter fluorescence plots, and gating statistics across the samples and controls. Because the samples differed in bacterial concentration and fluorescence intensity, the detector settings and gating boundaries required repeated adjustment.
We subsequently performed a dilution series using the amilGFP/mCherry dual-transformant sample. The undiluted sample had an OD600 of approximately 15.5, while the 10-fold and 100-fold dilutions had approximate OD600 values of 1.5 and 0.2, respectively. The mCherry- and amilGFP-single-positive controls were analysed in parallel at the corresponding fluorescence channels.
Cycle 4 · Test
Figure 17 shows representative results from the initial flow-cytometry analysis, including FSC-A/SSC-A plots, GFP-A versus PE-Texas Red-A plots, single-parameter fluorescence histograms, and gating statistics.
The negative and single-positive controls showed relatively clear bacterial populations and reporter-specific fluorescence signals, indicating that the bacterial gate and both fluorescence channels were functional. However, several experimental and mixed samples exhibited substantial overlap between the fluorescence populations. A considerable number of events appeared in the apparent double-positive region. The distribution of the P1, P2, P3, and Q-gated populations also differed between samples, indicating that the initial gating results were sensitive to sample concentration, fluorescence intensity, and cell condition.
Figure 18 shows the flow-cytometry results for the dual-transformant sample, the mCherry-single-positive control, and the amilGFP-single-positive control at different bacterial concentrations.
In the undiluted sample, the OD600 was approximately 15.5. The red and green signals in the dual-transformant sample overlapped substantially, and the two-parameter plot contained many events distributed between the two fluorescence regions, including an apparent double-positive fraction. The bacterial event density was high, and the boundary between the fluorescent populations was not clearly defined.
After tenfold dilution, the OD600 was approximately 1.5. The event density decreased and the fluorescence distribution improved to some extent, although overlap between the two populations remained. The mCherry- and amilGFP-single-positive controls still showed their corresponding fluorescence peaks, indicating that the reporter signals remained detectable after dilution.
After one-hundredfold dilution, the OD600 was approximately 0.2. The red and green populations in the dual-transformant sample became more clearly separated, and the apparent double-positive fraction was markedly reduced. The corresponding mCherry and amilGFP signals also remained detectable in the single-positive controls.
Cycle 4 · Learn
Together, the two figures demonstrate that the flow-cytometry results were affected not only by fluorescence-channel settings and detector voltages, but also by bacterial concentration and event density.
Figure 17 shows that although the negative and single-positive controls could be used to define the bacterial gate and fluorescence ranges, the fluorescence populations in the experimental samples could not always be separated consistently using a single gating strategy. The variation in population overlap and gating statistics indicated that one fixed gate was insufficient to produce reliable ratio estimates across all samples.
Figure 18 further showed that higher bacterial concentrations were associated with increased overlap between the red and green populations and a larger apparent double-positive fraction. As the samples were diluted, the event density decreased, the two fluorescence populations became more distinguishable, and the apparent double-positive fraction was reduced. This pattern suggests that event coincidence, cell aggregation, or the simultaneous passage of multiple cells through the interrogation point may contribute substantially to the apparent double-positive population in highly concentrated samples.
However, although the one-hundredfold dilution improved population separation, the reporters in the experimental samples were carried on a single-copy BAC backbone, whereas the single-positive controls were carried on multi-copy plasmids. Consequently, the experimental samples and controls differed substantially in fluorescence intensity. The relatively weak amilGFP signal further increased uncertainty in gate placement and population assignment.
Therefore, flow cytometry could distinguish the red and green populations under an appropriate bacterial concentration, but the results remained sensitive to sample concentration, cell aggregation, fluorescence intensity, and gate placement. Subsequent measurements should begin with lower-OD600 samples and include a serial dilution series to confirm whether the population separation is reproducible. Because flow cytometry did not provide sufficiently stable and comparable cell-ratio measurements across samples, we did not retain it as the primary quantitative method. Instead, plate-reader measurements, colony counting, and confocal microscopy were used as complementary methods.
Conclusion
We ultimately selected the microplate reader, solid-culture colony counting, and confocal microscopy as our detection methods, and used them to cross-validate the experimental results.
Binary Differentiation System
S001 Assembly
Cycle 1 · Design
S-001 is a single-copy binary differentiation plasmid obtained from the research team that published the original study. It contains Bxb1-related attB/attP sites, together with sfGFP and mCherry reporter modules. Recombination-mediated changes in DNA state allow cells to enter distinct fluorescent states. We use this plasmid as a foundational binary differentiation system to evaluate the feasibility of cellular-state generation, state identification, and subsequent proportion measurement under our experimental conditions.
Cycle 1 · Build
We received E. coli carrying S-001 and performed recovery, selective cultivation, single-colony isolation, and glycerol-stock preservation. Based on the existing plasmid map, we designed a segmented PCR strategy to confirm that the core state-switching system was retained in the received strain.
Cycle 1 · Test
We compared the sizes of the PCR bands corresponding to different S-001 regions and purified the relevant PCR products for sequencing.
Cycle 1 · Learn
Based on the PCR and sequencing results, we confirmed that this system can serve as the foundational plasmid architecture for subsequent experiments.
Bxb1-simple Assembly
Cycle 2 · Design
To establish a basal Bxb1 expression system, we cloned the Bxb1 gene into the pBAD24 backbone via EcoRI/HindIII restriction cloning. Since the Bxb1 gene in the source plasmid lacks its own start codon, we added an ATG start codon via the forward primer and a TAA stop codon via the reverse primer. The resulting Shine-Dalgarno–ATG spacing is 7 nt, the optimal distance for E. coli translation initiation. This first version, Bxb1-simple, contains no anti-leakage design and serves as the foundation for subsequent optimisation.
Cycle 2 · Build
We performed PCR amplification of Bxb1 from the 97-atc-ubiy-bxb1 template, followed by EcoRI/HindIII digestion of both the PCR product and the pBAD24 vector. The 1,517 bp insert and ~4,493 bp backbone were gel-purified and ligated at a 1:3 molar ratio. The ligation product was transformed into E. coli, and positive clones were screened by colony PCR and confirmed by sequencing.
Cycle 2 · Test
1、We performed induction expression and preliminary combination validation. Positive clones were verified by colony PCR and sequencing.
Cycle 2 · Learn
PCR validation with the verification primers yielded bands at 1517 bp and 750 bp. As shown in the figure above, the bands from all three bacterial groups were correct, confirming the successful construction of Bxb1-simple.
Bxb1-simple-his
Cycle 3 · Design
The Bxb1_simple plasmid has been successfully constructed and verified by sequencing, confirming that the recombinase expression cassette is correct and functional. To determine whether the recombinase can be effectively expressed under inducing conditions, we plan to perform a protein expression experiment: a His tag will be introduced at the C-terminus of Bxb1 via primer design to generate a tagged recombinase expression vector. After transformation into the host strain, protein expression will be induced with arabinose, and the cells will be harvested and lysed; the Bxb1 protein will then be purified and detected through the His tag (e.g., by Ni-NTA affinity purification and Western blot). Detection of a band at the expected molecular weight would confirm that the recombinase is successfully expressed upon arabinose induction, providing direct evidence to explain the weak fluorescence signals observed in the previous dual-transformation experiments.
Cycle 3 · Build
The Bxb1-simple-his fragment was amplified by Q5 or Phanta high-fidelity PCR, and the plasmid was reconstructed via HiFi assembly.
The Bxb1-simple-his plasmid was constructed, transformed, and positive clones were screened. Positive clones were verified by colony PCR and sequencing, confirming that the his-tag was correctly inserted at the C-terminus of Bxb1.
Cycle 3 · Test
After transformation, the bacteria were cultured for 4 h, induced with 5% ara, and then cultured for another 8 h overnight. Four groups were set up:
- One tube of bacteria without plasmid transformation (negative control)
- One tube of bacteria transformed with plasmid but without induction (negative control)
- Two tubes of bacteria transformed with plasmid and induced (replicate experiments)
Small-scale protein extraction was performed using a His-tag protein purification kit, and protein concentrations were measured on a Nanodrop, yielding OD values of 0.024, 0.028, 0.816, and 0.677. Although bands were detected by SDS-PAGE, the yield was low; this was preliminarily attributed to the weak expression capacity of the DH10B chassis and substantial losses during extraction.
Cycle 3 · Learn
Bxb1_simple in bacteria does express Bxb1, as verified by both the protein purification results and the SDS-PAGE bands. Combined with the weak fluorescence signal from the previous dual-transformation experiment, we speculate that the first induction experiment may have failed to activate the fluorescence signal because ara induction was not added, resulting in insufficient Bxb1 expression to flip the switch.
S-001 basal binary differentiation
Cycle 4 · Design
After confirming the sequence and baseline state of the S-001 strain, we sought to determine whether the published system could generate two distinguishable cellular states under our experimental conditions and serve as the basis for subsequent branching circuits and proportion-control systems.
Cycle 4 · Build
We cultured and induced S-001 single colonies verified by PCR and sequencing. Samples collected before and after induction, together with the necessary control groups, were prepared for fluorescence observation under identical conditions.
Cycle 4 · Test
Fluorescence microscopy was used to observe cellular fluorescence signals and determine whether S-001 could generate two distinguishable fluorescent states.
Cycle 4 · Learn
The fluorescence images showed the emergence of fluorescence signals after induction, demonstrating the feasibility of using S-001 for basic binary differentiation. This system can serve as the foundation for subsequent Bxb1-mediated recombination, Aspire-based state identification, state switching, and cellular proportion measurement.
Bxb1_Plus
Golden Gate Assembly Attempt
Cycle 1 · Design
To address the leakage or expression issues exposed by Bxb1-simple, we designed the Bxb1-plus circuit and planned a Golden Gate assembly strategy, including fragment boundaries, Type IIS sites, and ligation orientation.
This design incorporates a two-phase logic of aTc-inducible Bxb1 expression coupled with SspB-inducible degradation: in the first phase, arabinose is added to clear the background; in the second phase, aTc is added to induce Bxb1 accumulation, thereby achieving strict switch control with a clean OFF state and a retained ON state.
Cycle 1 · Build & Test
-
Turn 1 · Plasmid Construction and Verification
- dThe entire plasmid was divided into 5 transcription unit fragments, all assembled via BsaI, with junctions taking the natural 4 nt sequences at each connection to achieve seamless assembly without introducing any mutations at the scars. All junctions are located in non-coding regions and are mutually orthogonal. The 5 fragments can be directionally circularized into the target plasmid in a single BsaI Golden Gate reaction. After assembly, the plasmid contains zero internal BsaI sites.
- bFragment preparation, Golden Gate assembly, transformation, and positive colony screening were completed, with negative controls set up to confirm the absence of nonspecific circularization or residual uncut plasmid.
- tColony PCR, restriction digestion, and sequencing were used to check whether Bxb1-plus was correctly assembled.
Colony PCR: Five junction verification reactions were run for each candidate clone. All five bands appearing at the correct sizes indicates correct junction assembly.
Diagnostic restriction fingerprinting: SalI, BamHI, or PvuII were used to confirm plasmid identity.
Sanger full sequencing: Eleven forward sequencing primers were used to cover the full length, with key checks on the Bxb1-DAS+4 fusion boundary, DAS+4 tag sequence, Ptet promoter and 2× tetO operator, PBAD/araC regulatory region, and SspB CDS. - lMultiple assembly attempts failed to yield correct clones, with very few or completely absent positive clones, and sequencing revealed incorrect ligation or missing fragments at the junctions.
-
Turn 2 · Problem Localization — Single-Fragment Digestion Efficiency Check
- dFollowing the failed Golden Gate assembly, each step was revisited and checked systematically, focusing on the digestion efficiency of the five fragments and evaluating whether extending digestion time could improve it.
- bThe five fragments were individually digested with BsaI and run on a gel; BsaI digestion was extended to 37°C for 1 hour; reassembly was repeatedly attempted (one-pot Golden Gate, pairwise T4 ligation).
- tF2 showed markedly low digestion efficiency, retaining a large amount of uncut template that could not enter ligation in sync with the other fragments. After extended digestion, digestion efficiency improved significantly, though F2 remained poor. Reassembly still failed to yield correctly validated clones: on August 16, stored ligation products were found to have degraded; on August 13, negative control plates grew colonies, pointing to a medium preparation issue.
- lThe problem lay neither in fragment design nor in colony screening, but in the digestion step of F2 itself; digestion efficiency could be partially restored, but the bottleneck of the Golden Gate/T4 route lay in ligation product stability and operational steps rather than digestion itself. The accumulated failures pointed the bottleneck toward the assembly chemistry itself.
Cycle 1 · Overall Learn
The construction failed. Multiple Golden Gate assembly attempts failed to yield correct clones, with very few or completely absent positive clones, and sequencing revealed incorrect ligation or missing fragments at the junctions. Accordingly, we switched to Gibson Assembly, redesigning the fragment junction regions and homology arms as the subsequent assembly strategy.
Gibson Assembly Optimisation and Bxb1-plus Validation
Cycle 2 · Design
We designed Gibson primers for each of the 5 fragments, introducing approximately 20–25 nt homology arms at both ends so that adjacent fragments could anneal in vitro and be seamlessly joined by the Gibson reaction. The original 5-fragment transcription unit division and overall plasmid architecture were retained.
Cycle 2 · Build & Test
-
Turn 1 · Gibson Assembly and Plasmid Verification
- dGibson primers with ~20–25 nt homology arms were designed for all 5 fragments, enabling seamless in vitro joining while retaining the original transcription unit division and plasmid architecture.
- bFragment amplification, purification, Gibson assembly, transformation, and positive colony screening were completed. Colony PCR, restriction digestion, and sequencing were used to confirm the Bxb1-plus plasmid structure.
- tThe structure of the Bxb1-plus plasmid was confirmed by colony PCR, restriction digestion, and sequencing.
- lGibson assembly successfully yielded the Bxb1-plus plasmid. The construction efficiency and product quality of Gibson and Golden Gate were compared to determine the assembly method to be used going forward.
Figure 27. Colony PCR of the Gibson-assembled Bxb1-plus adapter. The structure of the Bxb1-plus plasmid was confirmed by colony PCR, restriction digestion and sequencing. -
Turn 2 · Construction of Bxb1-plus-his
- dIntroduce a his-tag into Bxb1-plus to further validate the optimised system's protein expression and leakage control.
- bA sequence-verified Bxb1-plus plasmid was selected, and a his-tag was introduced at the C-terminus of Bxb1 via primer design. The corresponding chassis and combination system were established.
- t1、Colony PCR, restriction digestion, and sequencing were used to confirm whether the his-tag was correctly inserted and whether positive clones were successfully constructed.
2、Bxb1 expression was detected by Western blot (WB), which is more sensitive and therefore requires no large-scale protein extraction.
As can be seen from the WB results, the induced expression of Bxb1 protein was relatively low at 100 ng/ml and 200 ng/ml aTc, and relatively high at 50 ng/ml aTc. - lThe Bxb1-plus-his plasmid was successfully constructed and can be used for subsequent protein expression detection.
Figure 28. Verification of the Bxb1-plus His tag plasmid ligation. Colony PCR, restriction digestion and sequencing confirmed that the his-tag was correctly inserted and that positive clones had been constructed.
Figure 29. Western blot of Bxb1-plus-his. At 55 kDa the induced expression of Bxb1 protein was relatively low at 100 ng/ml and 200 ng/ml aTc, and relatively high at 50 ng/ml aTc.
Cycle 2 · Overall Learn
Gibson assembly successfully yielded the Bxb1-plus plasmid, with construction efficiency and product quality superior to Golden Gate.
Bxb1-plus-his shows higher protein expression, lower uninduced leakage, and stronger recombination function, the optimisation is effective and can proceed to subsequent ratio measurement and screening. This lays the foundation for subsequent stepwise transformation, state switching, and ratio measurement.
Aspire
Aspire-simple Visible Pigment Expression
Cycle 1 · Design
We designed Aspire-simple as a state identification system composed of two pigment proteins, amilGFP and amilCP. The core idea was that two cell states would express different visible pigments, and when the two states were mixed at different ratios, the population would display different colours — allowing ratio information to be read directly by eye or by visible-light instruments.
Visible pigments were initially chosen over fluorescent proteins to match the downstream detection equipment. We aimed to use a plate reader and the Dry Lab's visible-light instrumentation to detect different cell states and their ratios. Compared with fluorescence detection, visible-light signals require less sophisticated equipment and are more convenient for preliminary naked-eye judgment, making this a reasonable first-version state identification scheme.
Cycle 1 · Build
Aspire-simple plasmid construction, transformation, and positive colony screening were completed, yielding strains for subsequent expression validation.
Cycle 1 · Test
For the Aspire-simple + Bxb1-simple double-transformed strains, the PBS-washed cultures were first examined visually in a microplate. The colour differences among the wells are not significant enough, so we cannot visually determine whether the Aspire-simple plasmid has completed differentiation.
To quantitatively estimate the relative pigment signals, absorbance was measured at 588 nm for amilCP and 503 nm for amilGFP using a microplate reader. The absorbance signals were first background-corrected using the PBS control and then normalised to the corresponding corrected OD600 values, yielding ΔA588/OD600 and ΔA503/OD600, respectively.
Aspire-s-1, Aspire-s-2, and Aspire-s-3 represent three different colonies picked from the same induced Aspire plate. Each colony was separately used to prepare competent cells, followed by transformation with the Bxb1-simple plasmid. For each Aspire-derived competent-cell preparation, six parallel double-transformation samples were generated. Bxb1-simple was included as the positive control. All results are presented as mean ± SEM.
In the Bxb1-simple negative control, ΔA588/OD600 and ΔA503/OD600 showed no obvious difference and were both substantially lower than the values observed in the experimental groups. In all three experimental groups, the absorbance signal at 503 nm was higher than that at 588 nm. This result is consistent with the overall theoretical expectation that the amilGFP fraction would exceed the amilCP fraction, because the Aspire-simple plasmid contains the Spacer design only on the amilCP side.
However, the differences among the three Aspire-derived experimental groups were relatively small, making it difficult to reliably distinguish the specific population ratios between the groups under the tested conditions.
Cycle 1 · Learn
The two visible pigments were found to be insufficient in colour distinguishability, background, and quantification capability, making it difficult to stably support subsequent cell ratio measurement. Therefore, Aspire-simple was not adopted as the final state detection scheme, and we turned to fluorescent reporter design.
Specific problems included:
- Single-copy limitation: The original expression validation system used pigment proteins, aiming to obtain blocks of different colours from different ratios. However, because our system uses the single-copy pBeloBAC plasmid, pigment protein expression was limited and colour signals were weak, making this validation method impossible to continue.
- Limited detection methods: Due to the choice of pigment proteins, amilCP cannot be observed under a fluorescence microscope, making imaging difficult and preventing clear visualization of the distribution and ratios of different states at the single-colony level.
- Insufficient quantification: Visible pigments are inferior to fluorescent reporters in terms of background interference and signal linearity, making it difficult to stably support subsequent ratio measurement and screening.
For these reasons, we abandoned the visible pigment scheme of Aspire-simple and turned to fluorescent reporter design, aiming to obtain stronger signals and better quantification capability under the single-copy background.
Aspire-plus Fluorescence Expression Optimisation
Cycle 2 · Design
Based on the detection limitations of Aspire-simple, we changed the state identification system to two fluorescent proteins, amilGFP and mCherry. Switching to fluorescent proteins fundamentally improves detection performance: on one hand, amilGFP and mCherry have better-separated excitation and emission spectra, giving better channel distinguishability; on the other hand, fluorescence signals have higher sensitivity and a wider dynamic range than visible pigments, making them more suitable for subsequent quantitative analysis and ratio measurement. This change also provides a more reliable reporter basis for subsequent combination validation with Bxb1-plus.
Cycle 2 · Build
The second version of Aspire-plus was constructed, transformed, and sequence-confirmed. A combination scheme with Bxb1-simple and Bxb1-plus was also established.
- We replaced fragment A2, which originally contained amilCP, with the mCherry gene by PCR. We named it A2-plus.
- A2_plus was assembled with A1, A3, A4, and AB via CE/HiFi assembly to obtain the Aspire_plus version.
The structure of the Aspire-plus plasmid was confirmed by colony PCR, restriction digestion, and sequencing.
Cycle 2 · Test
We first examined the fluorescence phenotypes of the Aspire-plus + Bxb1-plus double-transformants using confocal microscopy. In the second round of transformation, a large proportion of cells simultaneously exhibited amilGFP and mCherry fluorescence and were therefore classified as double-positive. This confirmed that both fluorescence channels could be detected, although the two cellular states were not yet clearly separated.
Aspire-plus + Bxb1-plus II · uninduced
Aspire-plus + Bxb1-plus II · 100 ng/mL aTc
Aspire-plus + Bxb1-plus II · 50 ng/mL aTc
Aspire-plus + Bxb1-plus II · 200 ng/mL aTc
After the third round of transformation, different colonies exhibited partially differentiated fluorescence phenotypes. Some colonies predominantly showed a single-positive phenotype, whereas others remained double-positive. To evaluate samples with a clearer state preference, only representative single-positive results from the third round are presented here; the double-positive results observed in the same round are not shown repeatedly.
Three independent colonies displaying predominantly single-positive phenotypes were selected and designated Aspire-p-1, Aspire-p-2, and Aspire-p-3. Their amilGFP and mCherry fluorescence responses were measured using a microplate reader across a range of aTc concentrations. After background subtraction and normalisation to OD600, the fluorescence signals were expressed as RFU/OD600. At 50 ng/mL aTc, all three Aspire-plus colonies exhibited relatively high fluorescence outputs, suggesting that this concentration effectively induced fluorescence expression under the tested conditions.
The mCherry-positive cell fraction was further estimated using the M3 dual-channel model. Across the tested conditions, the estimated mCherry-positive fraction remained approximately 10%–20%, indicating that the populations were predominantly biased toward the mCherry state. This directional bias was broadly consistent with the Aspire-plus design, in which the spacer was introduced only on the mCherry expression arm. At 50, 75, and 100 ng/mL aTc, clear differences in the estimated mCherry-positive fraction were observed among Aspire-p-1, Aspire-p-2, and Aspire-p-3, indicating that independently isolated single-positive colonies could generate distinguishable population-state distributions.
Together, the confocal microscopy and microplate-reader results provide preliminary evidence that the Aspire-plus + Bxb1-plus system can produce detectable dual-channel fluorescence and a degree of population-ratio differentiation in colonies derived from single-positive samples.
Cycle 2 · Learn
We confirmed Aspire-plus is more suitable as the reporter system for subsequent dual transformation, state switching, and ratio measurement, and adopted the fluorescence channel as the primary scheme for subsequent quantitative detection.
However, the results showed that many bacteria still exhibited both red and green fluorescence, suggesting possible expression leakage. The next step is to investigate the cause of this problem and find a solution.
Insulation Test
Cycle 3 · Design
In the previous round of testing, an unexpected double-positive result appeared — bacteria that should only express fluorescence at the final step already showed fluorescent signals before recombination was complete. This led us to suspect that the terminator designed for insulated expression might not actually be functioning, allowing read-through from upstream and causing premature expression of the fluorescent proteins.
A key observation supported this hypothesis: we found that S001 itself already showed fluorescence. S001 is a configuration that should be in the OFF state in the system. If it can already emit fluorescence, the problem most likely lies in the terminator's insulation capability rather than in the recombination logic itself. To verify this, we decided to cut out the two expression arms of the Aspire system separately and express them individually in a multi-copy plasmid, directly testing whether the fluorescence originates from leakage of the expression arms themselves.
Cycle 3 · Build
The two expression arms of the Aspire system were cut out separately and expressed individually in a multi-copy plasmid. A multi-copy plasmid was chosen because its high expression level would amplify any leakage signal, making it easier to observe.
Taking the GFP construct as an example: the two GFP fragments were amplified using the amilGFP single-staining plasmid as template, and the ECK fragment was amplified using A2 as template. The amilGFP single-staining plasmid was digested with EcoRI/HindIII, each fragment was digested with the corresponding enzymes, and the fragments were ligated with Quick Ligase and transformed for later use. The mCherry construct was built similarly.
After PCR verification, the inhi-GFP plasmid was successfully constructed.
Cycle 3 · Test
Control experiments were set up to observe whether the terminator could insulate the fluorescence expression signal. The successfully constructed plasmids were tested using the solid-culture method, with the original single-staining GFP plasmid as a positive control, to determine whether the individually expressed GFP or mCherry expression arm would produce fluorescence.
Cycle 3 · Learn
Fluorescence is observed, it confirms that the double-positive result is indeed caused by poor terminator insulation, and the fluorescence expression of S001 is also explained. This result will directly determine whether we need to redesign the terminator or insulation elements.
Establishment of the two-plasmid transformation workflow
Synchronous Transformation and Induction
Cycle 1 · Design
The two-plasmid workflow was divided into sequential steps to evaluate the function of each module independently. The Aspire-plus and Bxb1_plus plasmids were co-introduced into the DH10B chassis by double transformation, and induction was performed in two stages: arabinose was first used to clear Bxb1 while activating Cre, and aTc was then used to induce Bxb1 expression.
Cycle 1 · Build
The Aspire-series and Bxb1_plus plasmids were co-transformed into DH10B and plated under chloramphenicol and kanamycin double selection. Approximately 0.3 µg of the Aspire-plus plasmid was used per transformation, and the concentration was measured before each experiment to recalculate the required volume; the amount of Bxb1_plus plasmid had not yet been standardised and remained to be determined by subsequent experiments.
In the first stage, single colonies were picked and cultured for 5 hours, then induced with arabinose (5% w/v; prepared as a concentrated stock and added in a small volume) to clear Bxb1 while activating Cre. Two tubes without arabinose induction were kept as controls and labelled (-1) and (-2). The culture was then streaked onto plates, and single colonies were picked and shaken for 5 hours.
In the second stage, aTc was used to induce Bxb1 expression, with the concentration to be finalized in subsequent experiments. Tube (-1) was induced with aTc and labelled (- +); tube (-2) was left uninduced and labelled (- -); an additional tube derived from the arabinose-induced culture was left without aTc and labelled (+ -). After a further 5 hours of cultivation, the cultures were ready for downstream observation (flow cytometry, microscopy, or microplate reader).
Cycle 1 · Test
Colony numbers on double-selection plates, double-selection positive rates, and plasmid coexistence were compared.
Cycle 1 · Learn
Synchronous transformation produced too few colonies on double-selection plates, and colony growth was slow, often requiring more than 16 hours. It was therefore difficult to obtain stable target double-transformants, and the workflow could not meet the requirements of downstream state-switching and proportion-detection experiments. We therefore switched to stepwise transformation to reduce the complexity of introducing multiple plasmids simultaneously.
Stepwise Transformation and Induction
Cycle 2 · Design
The two-plasmid workflow was divided into two sequential steps. First, a DH10B chassis carrying the Aspire-simple plasmid was established and confirmed. The Bxb1-series plasmid was then introduced into the confirmed intermediate strain. Induction was also performed stepwise to evaluate the function of each module independently.
Cycle 2 · Build
The Aspire-simple plasmid was first transformed into DH10B and selected on chloramphenicol plates. A single Aspire colony was then cultured for approximately 12 hours, followed by induction with 5% arabinose. An uninduced negative-control tube was maintained in parallel. After approximately 5 hours of induction, the culture was plated again to allow completion of the Cre-loxP system switching process and to obtain single colonies representing different states.
Single Aspire colonies were then cultured for approximately 8 hours for further strain confirmation or sequencing. Confirmed Aspire colonies were used to prepare competent cells for the second transformation with either Bxb1-simple or Bxb1-plus.
For the Aspire-series and Bxb1-simple double transformation, chloramphenicol and ampicillin were used for double selection. After the second transformation, colonies were cultured for approximately 12 hours. Once the culture became turbid, 5% arabinose was added to induce Bxb1 expression. An uninduced negative control was maintained in parallel. Samples were collected after an additional 5 hours of cultivation for downstream proportion detection.
For the Aspire-series and Bxb1-plus double transformation, chloramphenicol and kanamycin were used for double selection. After the second transformation, colonies were cultured for approximately 12 hours. Once the culture became turbid, the culture was divided into separate portions and induced with aTc at final concentrations of 50 ng/mL, 100 ng/mL, and 200 ng/mL. An aTc-free negative control was maintained in parallel. Samples were collected after an additional 5 hours of cultivation for downstream proportion detection.
Cycle 2 · Test
Colony formation, double-selection positive rates, plasmid coexistence, induction expression, and downstream state readouts were compared.
Cycle 2 · Learn
Stepwise transformation made the identity and construction history of each intermediate strain clearer and helped distinguish transformation failure, plasmid-maintenance failure, and induction failure. This workflow was therefore selected as the standard transformation route for subsequent state-switching and proportion-detection experiments.
State switching
MOSAIC uses fluorescent reporters to distinguish different cellular states and measure their proportions within a population. Once the desired population ratio has been determined, continued reporter expression is no longer required for the system's primary function. We therefore designed an artificial sRNA regulatory module that reduces GFP output while preserving functional protein expression, allowing the system to transition from a ratio calibration mode to a functional operation mode.
The key questions addressed in this engineering cycle were whether the artificial sRNA could effectively repress GFP, whether different antisense seeds produced different repression efficiencies, and whether an independently expressed functional protein could be maintained while GFP expression was reduced.
Open-loop pRSwitch validation
Cycle 1 · Design
Directly integrating the sRNA module into the complete Cre/Bxb1 differentiation circuit would introduce several variables simultaneously, including DNA recombination, population composition, reporter repression, and functional output. To shorten the initial validation cycle and simplify troubleshooting, we first separated the state-switching module from the main MOSAIC circuit and established an open-loop pRSwitch validation system.
In this system, sfGFP-LVA represents the reporter to be switched off, while TrxA-3xFLAG-6xHis represents the functional protein that should remain expressed. Artificial sRNA expression is controlled by the araC/PBAD regulatory system. Because sRNA efficiency can be affected by target position and RNA accessibility, we designed four candidate antisense seeds and one Empty control for comparison in an otherwise identical genetic background.
Cycle 1 · Build & Test
-
Turn 1 · Establishing an Open-Loop Validation System
- dWe first separated the module from the main MOSAIC circuit to validate sRNA-mediated regulation independently, preventing recombination states and multi-plasmid combinations from complicating the interpretation of the results.
- bThree relatively independent expression cassettes were placed on a shared pUC57-AmpR backbone: an arabinose-inducible artificial sRNA cassette, a constitutively expressed sfGFP-LVA reporter cassette, and an independently expressed TrxA-3xFLAG-6xHis protein proxy cassette.
- tSequence verification was performed to confirm the three expression cassettes and their key junctions, ensuring that the system could be used to compare GFP output and TrxA expression.
- lThe open-loop design reduced the problem to two measurable outputs: reporter repression and functional protein retention. It therefore provided a standardised platform for comparing different sRNA candidates.
-
Turn 2 · Multi-Window pRSwitch Design and Screening
- dFour candidate variants, pRSwitch-A, pRSwitch-B, pRSwitch-C, and pRSwitch-D, were designed to target different regions around the translation initiation region of GFP mRNA. A seedless pRSwitch-Empty construct was included as the control. All five variants shared the same backbone, sRNA scaffold, sfGFP-LVA cassette, and TrxA expression cassette, differing only in their antisense seed sequences.
pRSwitch-Empty: Contains none of the candidate A-D seeds and is used to evaluate background effects caused by induction and the shared sRNA components.
pRSwitch-A: Targets the translation initiation region surrounding B0034, the junction sequence, and the ATG start codon.
pRSwitch-B: Extends the related core sequence and shifts the target window toward the upstream 5′ UTR.
pRSwitch-C: Uses a candidate window centred around the GFP start codon.
pRSwitch-D: Shifts the candidate window further into the early coding sequence of GFP. - bThe five pRSwitch variants were constructed, and their antisense seeds and adjacent junction regions were sequence-verified to enable comparison under consistent experimental conditions.
- tEach pRSwitch variant was cultured under matched conditions and tested both before and after L-arabinose induction. GFP fluorescence was normalised to OD600 to reduce the influence of differences in cell density.
L-arabinose induction reduced the normalised GFP signal in all five variants. pRSwitch-A, B, C, and D showed greater fluorescence reductions than the seedless pRSwitch-Empty control, with pRSwitch-C exhibiting the lowest residual fluorescence after induction. A decrease was also observed in pRSwitch-Empty, indicating that arabinose induction or the shared sRNA expression architecture may contribute to the background change in fluorescence. Candidate seed performance was therefore evaluated relative to pRSwitch-Empty rather than solely from the difference between the induced and uninduced groups.
Figure 46. Normalised GFP fluorescence of the pRSwitch variants before and after L-arabinose induction. GFP fluorescence was normalised to OD600. pRSwitch-A, B, C, and D contain different antisense seeds targeting regions around the GFP translation initiation site, whereas pRSwitch-Empty contains no candidate seed and serves as the background control. Following induction, all four candidate variants showed greater reductions in GFP output than pRSwitch-Empty, with pRSwitch-C exhibiting the lowest residual fluorescence.
To determine whether independent protein expression was retained during GFP repression, TrxA-3xFLAG-6xHis was further examined by Western blotting. A TrxA band near 16 kDa remained detectable in all induced samples. Together with the fluorescence results, these observations support the intended operation of the state-switching module: the GFP reporter output was reduced while the independently expressed protein proxy remained present. Because no loading control was included, the Western blot provides qualitative evidence that TrxA remained detectable after induction, rather than demonstrating that its expression level remained unchanged.
Figure 47. TrxA expression in the pRSwitch variants before and after L-arabinose induction. TrxA-3xFLAG-6xHis was detected by Western blotting at approximately 16 kDa. The minus and plus symbols indicate the absence and presence of L-arabinose, respectively. TrxA remained detectable in all induced samples, providing qualitative evidence that independent protein expression was retained during sRNA-mediated GFP repression.
- lAll four antisense-seed variants showed a greater reduction in GFP fluorescence than pRSwitch-Empty, with pRSwitch-C producing the lowest residual signal after induction. Meanwhile, TrxA remained detectable in every induced sample, indicating that activation of the sRNA system did not abolish independent protein expression. These results identify pRSwitch-C as the leading candidate for subsequent integration into MOSAIC. However, because pRSwitch-Empty also showed decreased fluorescence and the Western blot lacked a loading control, the background effect of induction and the quantitative retention of TrxA require further validation.
- dFour candidate variants, pRSwitch-A, pRSwitch-B, pRSwitch-C, and pRSwitch-D, were designed to target different regions around the translation initiation region of GFP mRNA. A seedless pRSwitch-Empty construct was included as the control. All five variants shared the same backbone, sRNA scaffold, sfGFP-LVA cassette, and TrxA expression cassette, differing only in their antisense seed sequences.
Cycle 1 · Learn
Through open-loop validation and multi-window screening, we established a state-switching evaluation method based on GFP fluorescence and TrxA Western blot detection.
When the selected module is subsequently integrated into the complete MOSAIC circuit, Cre/Bxb1 will remain responsible for generating and maintaining cellular states, while the artificial sRNA will only reduce GFP translation after the desired population ratio has been determined. The sRNA does not reverse DNA recombination or alter the established population composition. Population-ratio readout, GFP clearance, and functional output will therefore require further validation in the complete system.
Application Extensions
Crest: An Orthogonal System for Multistate Cell Populations
Cycle 1 · Design
To extend binary differentiation to three or more cell states, we initially considered placing the first-layer branching module and the second-layer A118 and TP901 recombination modules on separate plasmids. This arrangement would simplify the construction and testing of individual modules. However, when designing the combined system, we recognised that plasmids sharing the pBeloBAC11 backbone would also share F-type replication control and partitioning systems, creating a risk of plasmid incompatibility. They might therefore fail to coexist stably during continued growth and serial passage, causing some daughter cells to lose a plasmid and its associated modules.
Cycle 1 · Build
We therefore revised the design to place the complete differentiation circuit on a single BAC. While retaining the first-layer Cre/lox regulatory architecture, we connected the two first-layer outputs to TP901 and A118 integrases, respectively, and incorporated their corresponding second-layer recombination islands into the same BAC. No additional Cre/lox inversion arrays were introduced into the second layer; instead, each module uses its own att sites for branching recombination.
Cycle 1 · Test
We verified the integrated construct using junction PCR and whole-plasmid sequencing, followed by checks of module retention after serial passage.
Cycle 1 · Learn
Recombinase orthogonality and plasmid compatibility are distinct considerations. Even when each recombinase recognises its own target sites, the complete differentiation circuit may still be lost if the plasmids carrying its modules cannot coexist stably. We therefore chose to integrate the differentiation modules into a single BAC, shifting our engineering focus from maintaining multiple plasmids with the same backbone to verifying the structure and function of one larger construct.
Modelling Population Composition in the Cre–Bxb1 Circuit
In this major cycle, we aimed to develop a mathematical model linking “Cre site selection → changes in DNA arm length → Bxb1 branch selection” to inform the design of cell-fraction control for the two functional cell types in the project. We first developed a Cre selection model, then analysed Bxb1 differentiation, and incorporated single-colony isolation and independent-well culture workflows to refine ratio-library predictions, colony-picking budgets, and candidate circuit screening methods. All tests below are computational simulations and numerical checks; the biological predictions still require experimental validation.
Developing the Cre Site-Selection Model
Cycle 1 · Design
We first needed to determine which circuit architectures could result from Cre rearrangement and their expected fractions in the population. Under the current rearrangement assumptions, recombination between a fixed lox66 site and different candidate lox71 sites leaves the left-arm length unchanged, while the right-arm length increases with the site index.
Cycle 1 · Build
We used Python to develop a distance-weighted site-selection model, approximating the distance for synapsis as the sum of the Cre base segment, the corresponding NS lengths, and the intervening lox71 lengths. Site-selection probabilities were calculated using an inverse power of distance and then normalised.
The reference design contains 5 candidate lox71 sites. The NS length and the two independent base lengths for Cre and Bxb1 are each assigned the reference value of 773 bp, with a single lox length of 34 bp and a distance-weighting exponent of 1.
Cycle 1 · Test
The calculated selection probabilities for the five sites are 34.97%, 22.97%, 17.11%, 13.63%, and 11.32%, respectively, with corresponding Bxb1 right-arm lengths of 1,580–4,808 bp. The visualization shows higher predicted selection probabilities for proximal sites.
Cycle 1 · Learn
This result indicates that subsequent Bxb1 predictions must be calculated separately for different circuit architectures rather than summarized by a single architecture. We therefore used the arm lengths and selection probabilities of the Cre outcomes as inputs to the next stage to further analyse how architectural differences affect differentiation.
Analysing the Effects of Arm Length on Bxb1 Differentiation
Cycle 2 · Design
We aimed to predict the fractions of cells entering the A-type and B-type terminal states at different DNA arm lengths. To align with the anticipated experimental observation window, we selected 24 h after Bxb1 induction as the main comparison time point and also examined whether finite-time predictions agreed with the limiting results.
Cycle 2 · Build
We developed a five-state model comprising an initial state, two terminal states, and two intermediate states, using arm-length-dependent effective rates to describe branch selection. Venus and mScarlet served as example reporter signals for A-type and B-type cells, respectively.
With the right-arm length fixed, we varied the left-arm length to calculate differentiation time courses and left:right arm-length ratio scans, separately reporting the composition among differentiated cells and the differentiated fraction of the total population.
Cycle 2 · Test
Simulations showed that shortening the left arm increased the A-type fraction, whereas lengthening it decreased the A-type fraction. For example, with the right arm fixed at 773 bp, changing the left:right arm-length ratio from 1:1 to 1:10 increased the A-type fraction at 24 h from 21.4% to 84.4%; changing the ratio to 10:1 reduced the fraction to 1.3%.
Numerical checks confirmed conservation of the total state fraction, and the solutions were compared with an independent calculation method. Under the current parameters, the fractions at 24 h differ substantially from the limiting fractions, so the results cannot be considered steady-state values solely on the basis of a predefined observation time.
Cycle 2 · Learn
DNA arm length can serve as a design variable for tuning the composition of the two functional cell types, but asymmetric kinetic parameters mean that equal arm lengths do not yield equal differentiation fractions. Composition and differentiated fraction also answer different questions: the former describes the makeup of differentiated cells, while the latter indicates how many differentiated cells have actually been produced. Subsequent independent-well predictions and design screening must consider both metrics.
Mapping Cre–Bxb1 Predictions to the Independent-Well Experimental Workflow
Cycle 3 · Design
Building on the preceding two modelling rounds, we needed to connect different Cre architectures with the actual culture workflow. In MOSAIC, single colonies are isolated first, then used to establish separate culture wells in which Bxb1 is induced. Our objective in this round was therefore to predict separately the within-well composition for each fixed architecture and the distribution across wells resulting from random colony picking.
Cycle 3 · Build
We assumed that each picked colony carries one stable Cre-rearranged architecture, that one colony establishes one well, and that Bxb1 is induced in all wells from the same normalised initial state. The program calculates the A/B-type fractions and differentiated fraction separately for each architecture, then uses the Cre selection probability to describe the chance of randomly picking that architecture.
We further used multinomial sampling to describe well counts for each architecture, calculated expected well counts, standard deviations, and marginal prediction intervals, and generated an example plate using a fixed random seed.
Cycle 3 · Test
At 24 h, the default circuit gives five expected A-type fractions: 40.76%, 54.05%, 63.20%, 69.72%, and 74.51%. The expected fraction in a randomly selected well is 55.42%, but individual wells are not required to have this composition.
When 96 colonies are picked, the expected well counts for architectures 1 and 5 are 33.57 and 10.87, respectively. Expected counts may be fractional, whereas actual sampling outcomes are integers and fluctuate randomly. Well-count prediction intervals apply to individual architectures and do not jointly guarantee that all categories fall within their respective intervals.
Cycle 3 · Learn
A ratio library must describe both “the composition of each well type” and “how often each well type occurs.” Having 96 wells does not mean having 96 distinct expected fractions, as the same architecture may occur in multiple wells. We therefore expanded the model outputs from a single mean to architecture-level predictions, ratio types, and well-count distributions, aligning them with MOSAIC's single-colony culture workflow.
Estimating Colony-Picking Budgets for Ratio Coverage and Target Hits
Cycle 4 · Design
After identifying the expected fractions available, we aimed to answer a further question: how many colonies must be picked to cover all usable ratio types? If only one well close to a target fraction is needed, can fewer picks suffice?
Because different architectures may produce similar fractions, we also needed to distinguish architecture coverage from ratio-type coverage.
Cycle 4 · Build
We first retained architectures meeting the minimum differentiated-fraction requirement, then classified them into fixed fraction bins. The reference settings use a minimum differentiated fraction of 0.01% and a bin width of 5 percentage points. Multiple architectures in the same bin are combined into one ratio type; unusable architectures still consume colony picks, and the remaining probabilities are not renormalized.
The program calculates the probability that each type appears at least once and uses the inclusion–exclusion principle to calculate the joint probability of covering all specified events. For a single target, architectures meeting the tolerance and differentiated-fraction requirements are combined to calculate the probability of at least one hit. The minimum number of picks is determined by integer search; when no matching architecture exists, the program explicitly reports the target as unreachable.
Cycle 4 · Test
Under the default circuit and the reference condition of 24 h, achieving a 95% probability of covering all five usable ratio types requires 29 colony picks. With 96 picks, this coverage probability is approximately 99.9989%.
For a target of 50% ±5 percentage points, architecture 2 meets the requirement with a fraction of 54.05%, giving a single-pick hit probability of 22.97% and requiring 12 colonies to achieve a 95% hit probability. For a target of 20% ±5 percentage points, none of the five default architectures matches, and the program returns unreachable rather than falsely indicating success by increasing the number of picks.
Cycle 4 · Learn
The first step is to confirm whether the circuit encodes the required fraction, then allocate the colony-picking budget. Increasing the number of picks can reduce the risk of missing a type but cannot generate fractions absent from the circuit. Obtaining at least one well of every type and obtaining at least one well matching a particular target are different tasks; requirements for multiple replicate wells per type must be calculated separately.
Comparing Candidate Circuits According to Experimental Needs
Cycle 5 · Design
The preceding round addressed colony-picking requirements for a given circuit. In this round, we further compared different NS lengths and site numbers. We distinguished three experimental objectives: broadly exploring multiple fractions, simultaneously covering a specified set of fractions, and finding a well close to a single target.
Cycle 5 · Build
We scanned 1–10 candidate lox71 sites and NS lengths of 200–2,000 bp in 200 bp increments, comparing 100 designs in total while keeping other parameters at their reference settings. The program ranks designs separately for three objectives: diversity prioritizes the expected number of usable types, library prioritizes the joint probability of covering specified targets, and target prioritizes the probability of at least one hit for a single target.
We organised the analysis into design_model.py, allowing users to specify the current circuit, number of colony picks, observation time, targets, and scan range. The script simulation.py generates the basic figures and independent-well analysis figures. Predictions for the current circuit and recommendations from the scan are output separately to avoid mistaking candidate design results for the performance of the current construct.
Cycle 5 · Test
Under the reference conditions of 96 picks and 24 h, the candidate with 6 sites and 600 bp NS spacers ranks first when wells near four targets, 40%, 50%, 60%, and 70%, are required simultaneously, each with a tolerance of ±5 percentage points. This design requires 17 picks to cover the four targets with a 95% joint probability; this requirement is not equivalent to obtaining all six architectures.
Under the diversity objective, the candidate with 10 sites and 600 bp NS spacers produces 8 usable ratio types, with predicted A-type fractions spanning 37.18%–82.95%. With 96 colony picks, the expected number of types obtained is 7.9989; achieving a 95% probability of covering all 8 types requires 50 picks.
Cycle 5 · Learn
There is no universally optimal circuit independent of the experimental objective. More ratio types, a higher target hit probability, and a shorter array may favour different candidates, so selection must account for construction constraints. In particular, when success probabilities for multiple designs are already close to 100%, extremely small numerical differences should not be taken as evidence of experimental superiority.
The model thus developed from a demonstration of differentiation trends into a tool for designing candidate ratio libraries and colony-picking plans. Actual use still requires measurement of the resulting compositions and application performance.
Exploring Initial C:R:S Ratios and Transient Coexistence Through Mathematical Modelling
In this major cycle, we aimed to understand how the initial fractions of colicin-producing (C), resistant (R), and sensitive (S) bacteria affect competition outcomes under well-mixed culture conditions and to inform ratio-library sampling design. Through successive Design–Build–Test–Learn (D–B–T–L) rounds, we started from three-strain competitive interactions, progressively incorporated explicit toxin dynamics, variations in initial composition, and serial passage, and finally examined how toxin potency affects candidate composition regions.
Developing a Three-Strain Cyclic Competition Model
Cycle 1 · Design
Initially, we aimed to determine whether cyclic competition among the three strains could produce coexistence. We set S to grow fastest, giving it a resource-competition advantage over R; R was resistant to the toxin and grew faster than C; C grew slowest but produced colicin E2 to kill S. This formed a rock–paper–scissors-like cyclic competition relationship among S, R, and C.
Cycle 1 · Build
We used SimBiology in MATLAB to develop the initial model, representing the growth of the three strains as logistic growth under a shared carrying capacity and describing cyclic competition through pairwise interaction terms. The initial illustrative growth rates were \mu_S=1.5, \mu_R=1.0, and \mu_C=0.5.
This version primarily represented the competition topology and did not separately calculate toxin production, degradation, or concentration changes.
Cycle 1 · Test
According to the early simulation records, the abundances of all three strains exhibited sustained oscillations under the parameter settings used. This showed that the initial topology-based model could generate cyclic population trajectories.
##### Learn
This result showed that cyclic competition can produce oscillations, but it did not establish that the same coexistence behaviour would persist under actual toxin action. Because the effect of C on S depends on toxin accumulation and degradation, we decided to include toxin as a separate variable in the next model round.
Incorporating Explicit Toxin Dynamics
Cycle 2 · Design
We aimed to test whether the oscillatory coexistence in the initial model could persist when the inhibition of S by C was described through changes in toxin concentration.
Cycle 2 · Build
We added the toxin concentration variable T, using \kappa C-\delta T to describe toxin production and degradation and k_{\mathrm{kill}}TS to describe toxin-mediated killing of S. The three strains continued to share resources, and neither R nor C was directly affected by this toxin-killing term.
The model assumes a well-mixed culture, with toxin acting throughout the culture and no spatial neighborhoods or local protection of nearby S cells by R cells. This mechanism was subsequently used in the Python mean-field model and further parameter scans.
Cycle 2 · Test
According to the early results records, introducing explicit toxin dynamics meant that the original oscillatory coexistence was not necessarily maintained. Identical competitive relationships do not imply population trajectories identical to those of the initial topology-based model.
Cycle 2 · Learn
Competition topology alone is insufficient to predict coexistence outcomes in well-mixed cultures. Both toxin dynamics and initial composition must be considered. In the next round, we therefore varied inoculation ratios, compared the finite-time trajectories of the three strains, and defined “coexistence” by an observable duration rather than assuming permanent stable coexistence in advance.
Comparing Single-Batch Trajectories at Different Initial Ratios
Cycle 3 · Design
With growth and toxin parameters held constant, we aimed to determine whether changing only the initial C:R:S ratio could alter short-term competition and extend the observable persistence of S.
Cycle 3 · Build
We used Python and SciPy's solve_ivp to solve the mean-field equations for C, S, R, and T, comparing four initial C:R:S ratios: 1:1:1, 5:1:1, 0.1:1:1, and 0.02:1:1. The initial total bacterial abundance was 1% of the carrying capacity in every case. Simulations ran for 30 model time units, and the relative abundances of the three strains were plotted.
This version used normalised growth rates of \mu_S\approx1.29, \mu_R=1.00, and \mu_C\approx0.90. The hour labels in the figure correspond to an interpretation based on an illustrative reference growth rate; actual experimental time still requires calibration using measured growth rates.
Cycle 3 · Test
Under the same model parameters, different initial compositions produced different trajectories. A higher initial C fraction led to a faster decline in S, while reducing the initial C fraction allowed S to persist longer within the simulation window. In particular, at very low initial C fractions, S retained a relatively high relative abundance at the observation endpoint.
Cycle 3 · Learn
Initial composition is an important design variable affecting population behaviour, and equal-ratio inoculation should not be the only condition tested. However, single-batch results cover only a finite period and cannot determine how long coexistence persists over repeated culture rounds. We therefore introduced serial passage to scan the composition space more comprehensively.
Screening Coexistence Composition Regions Through Serial Passage
Cycle 4 · Design
We aimed to compare the performance of different initial compositions over repeated culture rounds, identify ratios that extend three-strain coexistence, and record which strain first falls below the relative-abundance threshold.
Cycle 4 · Build
We sampled 435 initial C:R:S compositions in ternary composition space and simulated 60 passages for each. After 12 model time units of growth in each round, all three strains were diluted 1:100 and the toxin concentration was reset to zero.
At the end of each round, a relative abundance of 10^{-6} was used as the threshold for classifying strain loss. The duration of three-strain coexistence was defined as the number of passages completed before the first threshold crossing. Ternary plots were used to display this duration and the first strain lost.
Cycle 4 · Test
The scan showed substantial differences in coexistence duration across initial compositions. Of the 435 compositions, 276 had a coexistence metric of zero; this count includes boundary compositions in which a strain was absent initially. The longest three-strain coexistence in this scan was 20 passages.
Longer coexistence occurred mainly in the low-C region. At higher initial C fractions, S often fell below the threshold first; in some low-C regions, C was the first to fall below it.
Cycle 4 · Learn
Different regions of composition space have different value for testing. Ratio-library sampling can be concentrated in the low-C region, beginning with compositions having similar R and S fractions.
At the same time, “loss” in the model is a threshold-based classification rather than actual biological extinction, and the figure does not separately quantify the coexistence duration of the remaining two strains. Because toxin parameters were fixed in this round, we also needed to determine whether candidate composition regions change with toxin potency.
Jointly Scanning Initial C Fraction and Toxin Potency
Cycle 5 · Design
We aimed to test whether the initial C fraction needed to extend coexistence must be adjusted as toxin production and killing capacity increase.
Cycle 5 · Build
We constructed a 22 × 18 parameter grid comprising 396 conditions. The initial C fraction varied from 0.01–0.5, with R and S equally sharing the remaining fraction. Toxin potency was represented by jointly setting \kappa=k_{\mathrm{kill}}=p, with p varying from 0.5–10. Each condition was simulated for 40 passages.
We plotted the number of three-strain coexistence passages as a two-dimensional heatmap and used contours for 5 and 15 passages of coexistence to indicate changes in candidate regions.
Cycle 5 · Test
Toxin potency changed the initial composition regions supporting longer coexistence. Near the high-C boundary of the coexistence region, increasing toxin potency reduced the initial C fraction compatible with a given coexistence duration.
This result does not mean that lower C fractions are always better; it indicates that the initial fraction of toxin-producing cells must be considered together with toxin dynamics. The band of candidate compositions associated with longer coexistence shifts across toxin settings.
Cycle 5 · Learn
Candidate compositions cannot be determined independently of growth and toxin conditions. The toxin parameter scan suggests that composition regions supporting longer coexistence change with functional strength, so multiple neighboring compositions should be compared rather than testing only one fixed ratio.
This round still used fixed growth rates, culture durations, and coexistence criteria. We next aimed to determine whether lower C fractions would still warrant priority when these conditions changed. The next round therefore examined the sensitivity of composition recommendations to model conditions.
Testing the Sensitivity of Composition Recommendations to Changes in Conditions
Cycle 6 · Design
The preceding simulations suggested that a lower initial C fraction might extend three-strain coexistence. However, the ratio library needs to accommodate different growth and culture conditions. We aimed to determine whether this screening direction depends on a particular parameter set and whether a fixed candidate fraction range could be specified.
To this end, we separately varied growth rates, culture duration per passage, and the coexistence threshold to compare the performance of initial compositions under different conditions.
Cycle 6 · Build
We retained the original model equations, fixed the initial R:S ratio at 1:1, selected 36 compositions with C fractions ranging from 1–50%, and included an exact C:R:S=1:1:1 inoculation as the comparison baseline.
We varied one factor at a time:
- Adjusting the growth rate of C or S to 90% or 110% of its baseline value;
- Changing the culture duration per passage from 12 to 9 or 15 model time units;
- Changing the relative-abundance threshold from 10^{-6} to 10^{-7} or 10^{-5}.
All other conditions were held fixed, with 60 passages simulated per condition, yielding 252 population trajectories in total. Results for different thresholds were reclassified from the same set of baseline trajectories, giving nine comparison scenarios in total. These variations were used to examine sensitivity to conditions and do not represent experimentally measured error ranges.
Cycle 6 · Test
Under baseline conditions, equal-ratio inoculation resulted in a strain falling below the threshold by the end of the first round, giving a coexistence count of 0. In contrast, a C fraction of approximately 12.4% gave the longest coexistence in this scan, reaching 19 passages.
Changes in growth rate substantially shifted the more favourable compositions: when the growth rate of C was reduced by 10%, the C fraction associated with the longest coexistence was approximately 25.5%; when it was increased by 10%, that fraction was approximately 2.6%. Both results lie outside the previously considered 5–20% interval, indicating that this interval cannot be treated as a fixed optimal range.
Culture schedules and classification criteria also affected the results. At culture durations of 9 and 15 model time units per passage, the sampled C fractions associated with the longest coexistence were approximately 22.2% and 9.2%, respectively. Merely lowering the threshold from 10^{-5} to 10^{-7} increased the maximum coexistence count in the scan from 16 to 23 passages.
Cycle 6 · Learn
Across the nine conditions examined, the sampled C fraction associated with the longest coexistence was always below the 1/3 used in equal-ratio inoculation. Lower C fractions can therefore remain a priority for ratio-library screening, but the specific range must be adjusted according to growth differences and culture conditions.
This shifted our design recommendation from “selecting a fixed ratio” to “retaining multiple neighboring compositions within a candidate region and comparing their performance under consistent conditions.” This also illustrates the value of generating multiple compositions in MOSAIC: a ratio library can help identify population compositions suited to specific application conditions.
At the same time, comparisons must use consistent classification criteria and consider both passage number and cumulative culture time. These recommendations still require validation through subsequent construction and coculture experiments with the three strains.
Code Availability
The model code and running instructions are available in the GitHub repository for other teams to inspect, reproduce, and reuse.
Overview
Only a few attainable cell ratios are scored. ML4OCRP recommends the next ratio from the ratios already measured, and estimates when each cell group reaches it. CalcRatio turns the phone colour readings from two pigment-mixing experiments into one blue-volume-fraction curve that a later batch can reuse.
| Cycle | Change | Evidence | Decision |
|---|---|---|---|
| ML4OCRP 1 | One network learns the time course and the ratio–score map | The optimal ratio was predicted poorly, and the time course was not learned either | Split the two jobs |
| ML4OCRP 2 | The time query becomes a per-group Gaussian process from time to ratio | The score model still saw the trajectory, and the optimal-ratio prediction stayed poor | The score model reads the ratio only |
| ML4OCRP 3 | A ratio encoder and a deep-kernel Gaussian process predict score | Single-peak and monotonic scores stay within 0.02; the two-peak absolute error is 0.279 and the regret is 0.207 | Keep this score model; measure the two-peak UCB ratio next |
| ML4OCRP 4 | The time query fits a BxB1 ODE and a residual | The score results stay those of cycle 3; arrival time comes from the ODE and the residual | Keep the two jobs separate; replace the synthetic tables with measured ones |
| CalcRatio 1 | One Hue–Saturation plane for each batch | Within-batch R² of 0.805 and 0.856; one shared plane falls to R² 0.638 | Stop sharing one set of plane coefficients across batches |
| CalcRatio 2 | Rescale by that batch's pure yellow and pure blue, then share one logistic | On 63 rows, R² = 0.801 and RMSE = 0.118, against 0.638 for the pooled plane | Keep the curve; a new batch supplies its own pure yellow and pure blue |
Table 1-1. What changed in each cycle of both algorithms, with the evidence behind it.
ML4OCRP
The attainable cell ratios are ten values, spaced logarithmically from 0.5 to 6. Each cell group is a short, noisy trajectory of ratio against time, and the score is measured at only a few ratios. The model names the ratio with the highest predicted score, and the ratio to measure next so that the uncertainty goes down. Given a target ratio, it also says whether each group has already reached it, is predicted to reach it later, or does not reach it inside the search horizon.
The inputs are two tables, (id, time, ratio) and (id, time, score). Score is the objective being maximised. Its shape may be a single peak, a skewed peak, two peaks, a rising sigmoid, or a straight ramp.
Cycle 1: one network for time and score
Cycle 1 · Design
Time, ratio, and score on one trajectory go through one model. An encoder compresses the trajectory, a Gaussian process predicts score from the current ratio, and upper confidence bound (UCB) names the next ratio to sample.
Cycle 1 · Build
The ratio and score tables were inner-joined on (id, time), grouped by cell group, and packed into a padded tensor of (time, ratio, score). TimeAttentionEncoder summarized each variable-length trajectory with a learnable token. That feature was repeated at every time point, concatenated with the current ratio, and passed to DeepKernelGP. UCB on the posterior recommended the next ratio.
Cycle 1 · Test
The optimal ratio was predicted poorly. Asking the same model to account for how the ratio changes with time performed poorly as well.
Cycle 1 · Learn
Time and score are separate jobs. The next cycle keeps a score model and adds a per-group predictor for the time course.
Cycle 2: a separate time query
Cycle 2 · Design
The score network stays in place. The time query fits a Gaussian process from time to ratio for each cell group. A query first looks for a historical time close to the target ratio. If none exists, it follows the predicted mean forward and returns the earliest crossing, or reports that the ratio is not reached.
Cycle 2 · Build
The program was split into preprocessing, the model, training, ratio recommendation, and a per-group query. RatioTimePredictor fit a scikit-learn Gaussian process for each cell group. The score network was still TimeAttentionEncoder plus DeepKernelGP.
Cycle 2 · Test
The optimal-ratio prediction was still poor. Leaving the trajectory inside the attention model did not improve the score task.
Cycle 2 · Learn
The main task is the map from ratio to score. The next cycle removes the trajectory from the score model and keeps a scalar ratio. The time course stays in RatioTimePredictor.
Cycle 3: score as a function of ratio
Cycle 3 · Design
OCRP learns score as a function of ratio only. The model returns a predicted score and an uncertainty, so one posterior names both a predicted optimum and the next experiment. Success means that, across several score shapes, the predicted optimum lies near the maximum of that shape on the search interval. The check includes a two-peak score, so the model has to do more than fit a symmetric peak.
Cycle 3 · Build
RatioFeatureEncoder maps the scalar ratio to 16 dimensions through a linear layer (1 to 32), a ReLU, and a linear layer (32 to 16). An auxiliary score head pretrains the encoder. After pretraining, the encoder is frozen and the head is unused. Each training pair is the 17-dimensional vector [ratio | embedding]. DeepKernelGP maps that vector through a network (17 to 32 to 8) into a feature space. An exact Gaussian process with a zero mean, an automatic-relevance-determination RBF kernel, and Gaussian observation noise lives in that space. Training maximizes the exact marginal likelihood.
Both readings use the same posterior. The predicted optimum maximizes the posterior mean on the ratio interval. The next experiment maximizes UCB, the mean plus β times the standard deviation, with β = 2.
The check data come from InSilicoValidation/fitting_ratio.py. The script integrates the modelling group's BxB1 recombination ODE and writes one trajectory per cell group. The default kinetic constants are k_{A0}=0.38\,\mathrm{h}^{-1}, k_{B0}=0.14\,\mathrm{h}^{-1}, \beta=1.3, r_A=0.56\,\mathrm{h}^{-1}, r_B=0.01\,\mathrm{h}^{-1}, and \alpha=0.01. The modelling subgroup attributes that equation and that parameter set to Zhong et al. 2026, Nature. Forty groups are used, their ratios at 24 h lie near ten targets, and the seed is 0.
fitting_score.py labels the same ratios with five functions. The default is the symmetric Gaussian.
--score_fn |
Shape |
|---|---|
gaussian | Symmetric peak |
log_gaussian | Skewed peak on log ratio |
bimodal | Weighted sum of two peaks |
sigmoid | Increasing sigmoid |
linear | Straight ramp |
Table 2-1. The five scoring-function shapes fitting_score.py can label a set of ratios with.
Cycle 3 · Test
InSilicoValidation/test_score_shapes.py trains on CPU with seed 0, 100 pretraining epochs, and 200 Gaussian-process epochs, and searches on [0.5, 6]. The true optimum is the maximum of the scoring function on a 401-point grid over that interval. The grid sits slightly off the analytic peaks at 2.50 and 4.00, so the Gaussian regret in score_shape_summary.csv is a value just below zero and is reported here as 0. Regret is the true score at the true optimum minus the true score at the predicted ratio. Score RMSE compares the posterior mean with the true scoring function.
Unrounded rows are in ML4OCRP/InSilicoValidation/results/score_shape_summary.csv.
| Scoring function | Grid optimum | Predicted | Abs. error | Regret | Score RMSE | UCB |
|---|---|---|---|---|---|---|
| Gaussian | 2.494 | 2.506 | 0.012 | 0 | 0.010 | 2.500 |
| Log-Gaussian | 2.494 | 2.475 | 0.018 | 0.0004 | 0.010 | 2.444 |
| Bimodal | 4.006 | 3.727 | 0.279 | 0.207 | 0.077 | 3.722 |
| Sigmoid | 6.000 | 6.000 | 0 | 0 | 0.004 | 6.000 |
| Linear | 6.000 | 6.000 | 0 | 0 | 0.031 | 6.000 |
Table 2-2. In-silico recovery of each scoring function: the grid optimum against what the model predicts.
Single-peak and monotonic scores stay within 0.02 of the grid optimum. On the two-peak score the predicted ratio is 3.727, the grid peak is 4.006, and the regret is 0.207. UCB on that fit recommends 3.722.
The command-line optimum search defaults to [0.01, 5], and the UCB grid defaults to [0.1, 10]. The table above searches [0.5, 6], the same interval as the ten targets. The trajectories come from the ODE, and the scores come from analytic functions.
Cycle 3 · Learn
The score model stays a RatioFeatureEncoder plus a deep-kernel Gaussian process. On single-peak and monotonic objectives, the ratio it names already lies near the grid optimum. The two-peak regret of 0.207 means the two peaks are not yet separated. The next measurement is near the UCB ratio 3.72.
The time query still lacks the mechanistic equation. The next cycle changes only that query and leaves this score model in place.
Cycle 4: the BxB1 equation in the time query
Cycle 4 · Design
The time query uses the modelling group's BxB1 recombination ODE. The cycle-2 Gaussian process described a smooth curve from time to ratio. This cycle fits that ODE for each cell group, then fits the residual between the ODE and the observed ratios with a Gaussian process or a polynomial. The query still checks history first, then searches the predicted trajectory for the target ratio.
Cycle 4 · Build
Model/ratio_time_predictor.py fits the ODE for each group. The residual is a scikit-learn Gaussian process, or a polynomial when --model_type poly is passed. Model/query_per_id.py returns a time and a status: -1 if the target ratio already appears in the record, 1 if it is predicted in the future, and 0 if it is not reached inside the horizon. The default absolute tolerance for a historical match is 5\times10^{-3}.
Fitting the ODE for every group takes long enough that --fit_ode stays off unless it is passed. scripts/Val.sh and scripts/Val.ps1 pass it, and they set --max_time to 24. The synthetic table ends at 24 h, while the query script defaults to 12 h. app.py calls the same Model/ implementation and walks one group at a time in the browser. InSilicoValidation/get_actual_ratio.py integrates the generating ODE at each predicted time and records the ratio there.
Cycle 4 · Test
The score model is the same as in cycle 3, so the five-shape results still hold. The time query fits a BxB1 ODE and a residual for each group, and returns the time at which the target ratio is reached together with a status: already seen, predicted in the future, or not reached inside the horizon.
Cycle 4 · Learn
The two jobs stay separate. Score is still read from the ratio by the deep-kernel Gaussian process. Time is still answered per group by the ODE plus a residual. The next score measurement is near the UCB ratio 3.72 from the two-peak fit, and the same training code updates the posterior.
A laboratory run replaces the two synthetic tables with measured (id, time, ratio) and (id, time, score). get_actual_ratio.py checks the ODE ratio at each predicted time. The exact Gaussian process stores every training pair and fits a few hundred measured points.
CalcRatio
The phone records Hue and Saturation. The sample sheet records the prepared blue volume fraction. The two phyphox experiments used different stock concentrations and different camera exposures. CalcRatio is the curve a later batch reuses. Experiment 1 has 21 samples and five recorded stages; the model uses stage 2. Experiment 2 has 42 samples and one stage; the model uses that stage. Blue fraction 0 is that batch's pure yellow, and 1 is that batch's pure blue.
Cycle 1: one plane per batch
Cycle 1 · Design
Inside one experiment, the blue volume fraction is a plane in Hue and Saturation.
A within-batch plane should follow the prepared fraction. If both batches can share one set of coefficients, that plane is enough. If the shared plane fits worse, the next design takes the batch shift as an input.
Cycle 1 · Build
scripts/data_preprocess.py splits each Excel file into plateaus on Hue, takes the circular mean of Hue and the arithmetic means of Saturation and Value, and joins the file to true_blue_fraction on the sample sheet. scripts/fit_model.py fits the plane on those rows so it can be compared with the later shared curve.
Cycle 1 · Test
| Fit | n | R² | RMSE |
|---|---|---|---|
| Experiment 1, its own plane | 21 | 0.805 | 0.134 |
| Experiment 2, its own plane | 42 | 0.856 | 0.091 |
| Both batches, one plane | 63 | 0.638 | 0.159 |
Table 3-1. Per-experiment plane fits on the 24 h sample sheet, against one plane fitted to both batches.
Inside one batch, the plane follows the prepared fraction. Placing both batches on one plane drops R² to 0.638 and raises RMSE to 0.159. The pure-stock colours sit in different places: experiment 1 pure yellow is Hue 177.788° and Saturation 0.791; experiment 2 pure yellow is Hue 107.502° and Saturation 0.272.
Cycle 1 · Learn
A coefficient set describes the batch it was fit on. The next cycle places each sample between that batch's own pure yellow and pure blue, then fits one curve for both batches.
Cycle 2: one logistic across batches
Cycle 2 · Design
The blue volume fraction lies between 0 and 1. It rises from pure yellow and flattens near pure blue. After Hue and Saturation are rescaled by that batch's pure stocks, a logistic has this shape. The shared curve should be tighter than one plane on both batches. A later batch measures its own pure yellow and pure blue and keeps the three fitted coefficients.
Cycle 2 · Build
scripts/build_id_ratio_dict.py saves the map from planned filename to true_blue_fraction. scripts/fit_model.py treats the ratio-0 and ratio-1 samples as the yellow and blue endpoints, writes z_hue and z_saturation, and estimates the three coefficients by SciPy least squares. The same script still fits ratio ~ Hue + Saturation on the same rows. The fit is written to data/2_processed/mixing_model.npy and combined_modeling_data.pkl.
Cycle 2 · Test
The three coefficients are estimated on 63 rows, with 60 residual degrees of freedom. The intercept, z_hue, and z_saturation each have a test p-value below 0.001. The standard errors are 0.1314, 0.1538, and 0.2084.
| Fit | n | R² | RMSE |
|---|---|---|---|
| Shared logistic, both batches | 63 | 0.801 | 0.118 |
| Experiment 1 under that curve | 21 | 0.781 | 0.142 |
| Experiment 2 under that curve | 42 | 0.815 | 0.103 |
| Both batches, one Hue–Saturation plane | 63 | 0.638 | 0.159 |
Table 3-2. The shared logistic surface against the per-experiment fits and the single Hue–Saturation plane.
The shared curve is tighter than the pooled plane, and a little looser than each batch's own plane. Experiment 2 has RMSE 0.103. Experiment 1 has RMSE 0.142. Residuals are fitted ratio minus prepared ratio. The largest absolute residual is 0.257, skew is 0.57, and kurtosis is −0.33. An RMSE of 0.118 is about twelve percentage points of blue volume fraction.
Endpoints:
| Experiment | Yellow Hue | Yellow Saturation | Blue Hue | Blue Saturation |
|---|---|---|---|---|
| 1 | 177.788° | 0.791 | 215.408° | 0.990 |
| 2 | 107.502° | 0.272 | 210.154° | 0.586 |
Table 3-3. Reference yellow and blue Hue–Saturation values for the two experiments.
On experiment 1, stage 2, the pure-yellow reading is 177.8°, while samples with blue fraction 0.05–0.25 sit near 126–139°, so some z_hue values fall below 0. On the same recordings, stage 1 tracks the prepared fraction more closely (correlation about 0.94) than stage 2 (about 0.82). The current fit uses stage 2.
Cycle 2 · Learn
The next batch keeps these three coefficients. It measures its own pure yellow and pure blue under the same conditions, and those readings compute z_hue and z_saturation.
The stage-2 endpoints of experiment 1 still need a check. If that stage is an illumination and does not represent the sample, the endpoints are recomputed on stage 1, which follows the prepared fraction more closely. The ratio of stock concentrations currently sits inside the logistic intercept; these two batches do not separate it. A cell sample is calibrated with its own pure-colour endpoints on the same phone and the same illumination.
RATIO Pocket
Version 1 — RATIO Pocket: Pioneer
A first build that only had to show the principle could work: can a phone camera read a dye ratio at all?
Cycle 1 · Design
We set out to characterise solution colour by two routes at once, so that the same round of experiments would tell us which one to keep. The first route placed blue, green and red filters in sequence in the optical path and used phyphox Luminance to record the luminance of each single-colour beam. The second used no filter at all and read HSV straight from the camera.
To support both, the first-generation hardware needed four things: replaceable filters, a horizontal detection channel that excluded ambient light, a stable white-light position, and a fixed phone position. The goal for this cycle was to complete the whole chain — sampling, filter changing, export, modelling — and then judge the measurement method on the data it produced.
Cycle 1 · Build
We drew the hardware in SolidWorks: a rectangular main body, a snap-fit top cover, a sample cell, a top plug, a filter card, an LED mount and a phone holder. Light enters at one end, passes through the sample and the filter card, and reaches the phone camera at the other end.
The transparent windows on the front and rear of the sample cell let light through the liquid, and the top plug let us inject and replace it. The filter card was insertable and removable, and the top cover blocked light along the whole optical path. The first-generation assembly and eight STL files provide a basis for further reproduction and modification.
Click to view 3D model
Loading the 3D model…
Drag to rotate · pinch or Ctrl+scroll to zoom
Cycle 1 · Test
We mixed blue and yellow stock solutions prepared with food colouring to simulate mixed samples. Throughout this page, “blue ratio” means the volume of blue working solution divided by the combined volume of the blue and yellow working solutions, from 0 to 1.
The first round collected 34 raw phyphox exports. After excluding one blank file whose time span exceeded 200 s, 33 remained: 21 ratio samples, 6 blanks, 4 dark fields and 2 air samples. All 21 sample-level datasets passed the structural QC for this round. The usable B, G and R absorbances, however, were only 20/21, 18/21 and 4/21 respectively — only 4/21 had all three channels complete, while HSV information was available for all 21. The first-generation device completed the acquisition chain, but reliable ratio information came mainly from the no-filter stage.
To avoid repeatedly selecting models on test samples, we set aside 17 samples as the development set and 4 as the locked test set. During development we applied outer leave-one-out to each sample and inner four-fold cross-validation on the remaining 16 to choose the features and either the Ridge regularization strength or a random forest. Standardisation was fitted only within training folds. The final frozen model was Ridge regression with α = 1 over four HSV-derived features: sin(Hue), cos(Hue), Saturation and Value.
| Evaluation target | n | MAE (ratio) | MAE (pp) | RMSE | Max abs. error (pp) | R2 |
|---|---|---|---|---|---|---|
| Development set: outer leave-one-out of the complete selection process | 17 | 0.1203 | 12.03 | 0.1403 | 32.49 | 0.7954 |
| Same-fold training mean baseline | 17 | 0.2813 | 28.13 | 0.3295 | 53.13 | −0.1289 |
| Locked test: frozen HSV + Ridge | 4 | 0.0793 | 7.93 | 0.0975 | 17.16 | 0.8690 |
| Mean baseline for the same test samples | 4 | 0.2500 | 25.00 | 0.2693 | 35.00 | 0.0000 |
Table 1-1. Sample-level prediction results. Development-set MAE fell by about 57.2% against the baseline, and the locked test by about 68.3%.
Evaluating the frozen model on the four locked test samples showed both the strength of this first proof of concept and the behaviour that needed fixing:
| Sample ID | Ground truth (blue ratio) | Prediction | Abs. error (pp) |
|---|---|---|---|
| M065_B04 | 0.65 | 0.8216 | 17.16 |
| M035_B04 | 0.35 | 0.3710 | 2.10 |
| M085_B04 | 0.85 | 0.8994 | 4.94 |
| M015_B04 | 0.15 | 0.2252 | 7.52 |
Table 1-2. The four locked test samples. 2/4 were within 5 percentage points and 3/4 within 10.
On the four locked samples the frozen HSV–Ridge model reached an MAE of 7.93 percentage points against 25.00 for the mean baseline, with three of four predictions within 10 points of the known ratio. The individual results also set the next engineering target: every prediction was high, with a mean signed error of +7.93 points, and the development-set endpoints at ratios 0.00 and 1.00 predicted 0.1771 and 0.8098. We carried both the predictive signal and the endpoint behaviour forward.
Cycle 1 · Learn
The difficulty with the filter route was not filter quality. phyphox Luminance is a brightness value obtained by weighting the camera's colour channels — it is not an independent measure of red, green and blue spectral intensity. The red channel was usable in only 4 of 21 samples, some windows showed unstable shutter or brightness readings, and blank batches drifted noticeably. The existing data are therefore insufficient to build a stable three-channel absorbance model.
Although all 21 samples passed the first-round sample-level QC, the criteria also allowed retention on complete HSV data alone, so we cannot claim that every optical channel met the required standard. We set the filter route aside and made direct HSV recording the main input for the next round. That shift replaced a complex, exposure-sensitive four-stage workflow with a simpler white-light one, and pointed the next cycle at light-source stability, blank reference and concentration effects.
For the two samples that deviated most (C030_B01 and M065_B04) we kept the original records and later retested with new samples. We did not remove points or change labels after seeing the errors.
Key Takeaways & Next Steps
- Filter route unreliable — Luminance is not channel-separated; R usable in only 4/21
- Endpoint bias: predictions high at both ends of the ratio range
- Switch the acquisition to a single white-light HSV recording
- Next-cycle targets: light-source stability, blank reference, concentration effects
Version 2 — Data reprocessing and optical-path simplification
No new hardware. We asked whether one white-light recording could replace four filter changes — and the acceptance checks stopped the cycle before any model was fitted.
Cycle 2 · Design
The previous round showed that smartphone colour readings can predict the ratio, but also that coverage in the filter stage was insufficient. We therefore asked whether the camera's R/G/B representation could be recovered from a single white-light HSV recording with no filters at all, and whether that would be more stable and easier to operate than changing filters four times.
This round was an algorithmic reanalysis of existing data rather than a new set of sampling experiments — a deliberate choice to test the idea before spending another build on it.
Cycle 2 · Build
We reused the valid files from the first round's 34 raw exports, keeping only the 15–25 s no-filter window in each record. The code converted HSV back to R/G/B frame by frame, then computed transmittance and absorbance against the neighbouring blanks and dark fields.
The advantage is that all three channel values come from the same frame, so exposure does not need to restabilise after a filter change — and it opens the way to fewer printed parts and fewer acquisition steps. The limit is fundamental, though: HSV-to-RGB inversion recovers channels encoded by the camera's colour system, not true narrow-band spectra.
Reprocessing pipeline — white-light stage
Input34 raw phyphox exports (round 1)
Window15–25 s, no-filter stage only
StepsHSV → RGB per frame, then transmittance and absorbance against the neighbouring blank and dark field
Outputreconstructed three-channel values per sample
Cycle 2 · Test
For the same 21 ratio samples, reprocessing the existing white-light stage produced complete reconstructed three-channel values for 16/21 samples (76.2%), against 4/21 complete records in the original filter-based analysis — a fourfold gain in channel completeness from a single no-filter stage. The red and blue absorbance trends were also consistent with a two-component mixture, which gave us a basis for the next optical design.
Under the revised QC, however, only 16/21 samples passed structural checks and colour features were available for 15/21; only 13 of the 17 development samples met the modelling criteria, below the preset threshold of 14. The program therefore stopped before fitting any ratio model. We report this round as a clear improvement in channel recovery and workflow, and reserve ratio-prediction metrics for an iteration that passes the preset checks.
| Acceptance item | This round | Judgment |
|---|---|---|
| Three channels complete | 16/21 (76.2%) | Improved, still below the preset >95% threshold |
| First-to-last change within a blank batch | 46.8% | Did not meet the <2% stability requirement |
| Underexposed channels in samples | 11 | Operating point still needs adjustment |
| Negative absorbance / transmittance >1.2 | 10 each | Reference and exposure conditions need review |
| Repeated blanks, pure-colour gradients, blind samples | Not acquired | Unmixing and blind-sample recovery not reported |
Table 1-3. Cycle 2 algorithm acceptance. The shutter's relative extreme spread within the window was 0.00%, but only because those windows sat at the camera's minimum exposure limit — it does not mean exposure was actively locked.
Cycle 2 · Learn
This round pointed to a useful direction: reducing the number of mechanical steps can give more complete colour channels and remove the need to time operations around filter cards.
It also set a limit on what software can rescue. No algorithm compensates for a 46.8% drift in blanks or for missing pure-colour concentration gradients, and loosening the QC criteria just to obtain a score would not make the conclusions more reliable. We kept the failed acceptance records and decided to improve both sampling and data processing in the next round: shorten the single-sample workflow, add independently prepared replicates, test the same ratio at different concentrations, and support a future quantitative absorbance route with a stable light source, repeated blanks and blind samples.
Key Takeaways & Next Steps
- Channel completeness 4/21 → 16/21 from one white-light stage
- Cycle stopped before fitting — the preset QC threshold was not met, and we report it that way
- Blank drift 46.8% is a hardware problem, not a code problem
- Next build: stable light source, repeated blanks, concentration gradients, blind samples
Version 3 — Voyager 0
Redesigned around the failure modes the first build exposed: the optical path turns vertical and the phone moves above the device.
Cycle 3 · Design
Four problems came out of the first two iterations. Fixed on its side, the phone slipped or changed position during experiments. The top light-blocking cover was awkward to open and close, so replacing the test liquid was inconvenient. The liquid container leaked and needed better sealing. And liquid replacement took a long time by design.
The iterated hardware therefore had to achieve four goals: be more convenient to use than the first generation; completely block the optical measurement path against ambient light; hold the phone stably and minimise movement during measurement; and contain no filters at all, using only the phone to read HSV values.
This round shifted the design brief from “able to measure” to “easy to use, stable and repeatable”, concentrating on operating convenience and optical-path light blocking.
Cycle 3 · Build
We designed the second-generation hardware. The optical path moved from horizontal to vertical, so the device became cylindrical, and to hold the phone more stably we moved it from the side of the hardware to above it.
To make the distance from the phone camera to the liquid surface adjustable, we added a threaded structure to the top light aperture, so the optical path length can be set conveniently.
To simplify the workflow and improve usability, we designed a liquid-chamber door that is easy to open while still keeping the measurement path free of ambient light.
Data acquisition and processing followed the same procedure as before: 20 s of HSV data from phyphox, then a binary linear regression of ratio on Hue and Saturation. Because the path is vertical, the phone camera points straight down at the liquid surface, which avoids the side-mounted setup that tended to slip; the threaded aperture and openable door make the device easier to adjust and more reliable at blocking ambient light.
Click to view 3D model
Loading the 3D model…
Drag to rotate · pinch or Ctrl+scroll to zoom
Cycle 3 · Test
We increased the sampling density around a blue–yellow ratio of 50% — that is, over 40–60% — to give the curve more data to fit. The instrument was easy to operate and the measurement experiments ran smoothly.
The analysis code reads the formulation ratio from the file name and selects stages within each Excel file according to Hue changes, taking a circular mean for Hue and an arithmetic mean for Saturation. It then fits an ordinary least-squares model on Hue and Saturation and saves 42 rows of processed data. Those 42 rows come from 42 exports and 19 ratios; the 11 a/b file pairs at 0.40–0.60 are paired samples of the same ratio at different total concentrations and cannot be treated as 22 distinct ratio levels.
The resulting model was:
The model explains 85% of the variance in the data and can be used for prediction.
Compared with the previous round, the residual distribution is more symmetric and the 3D scatter is closer to the regression plane. This indicates that adding intermediate-ratio samples helps improve model robustness. However, the model still has some error, and the sample range needs to be further expanded.
See our Software page to learn more information.
Cycle 3 · Learn
The improved hardware is practical: data collection is convenient and a multiple linear equation can be fitted to estimate the pigment ratio. A linear model on Hue and Saturation alone, however, did not generalise across batches. Fitting both batches together dropped R2 to 0.638 and raised RMSE to 0.159 — the pure-colour solutions differed in pigment content between batches, so one set of fixed coefficients could not cover both.
| Fit | n | R2 | RMSE |
|---|---|---|---|
| Experiment 1 alone | 21 | 0.805 | 0.134 |
| Experiment 2 alone | 42 | 0.856 | 0.091 |
| Both batches, one plane | 63 | 0.638 | 0.159 |
Table 1-4. Fitting results for the Cycle 3 model.
So the current model depends heavily on batch, concentration and exposure conditions, and must be refitted whenever those change. Batch calibration or feature normalization would be the way to make it more general.
The hardware itself meets our goals of low cost, easy assembly and portability, and already gives reasonably accurate measurements. Three issues remain: replacing liquid samples is still inconvenient, there is no portable phone holder, and the light source output is not yet adjustable. We carried all three into Cycle 4.
Key Takeaways & Next Steps
- Vertical path + phone above = stable, easy to operate
- Single-batch fit R2 0.856 does not survive pooling the batches (0.638)
- Batch-dependent coefficients → normalise against pure-colour endpoints
- Three hardware fixes to carry forward: sample swapping, phone holder, adjustable light
Version 4 — RATIO Pocket: Voyager
Portable, adjustable and — for the first time — one model shared across batches, by normalising every sample against its own pure-colour endpoints.
Cycle 4 · Design
The previous iteration left three hardware issues unresolved: replacing liquid samples was inconvenient, there was no phone holder, and the light output could not be adjusted. All three are addressed in this design.
The binary linear equation also generalised poorly. To fix that we switched to fitting relative values: for each measurement batch we treat pure yellow (ratio = 0) and pure blue (ratio = 1) as colour endpoints and normalise each sample's position between them, which removes batch-to-batch differences. Because the volume fraction runs from 0 to 1 and flattens near the pure colours, we replaced the linear plane with a logistic curve so that one model can be shared across batches.
Cycle 4 · Build
On the hardware side we added a slide groove to the liquid chamber so the sample container can be swapped more easily, designed an adjustable aperture to control LED intensity, added a foldable phone holder, and removed unnecessary structures to make the device smaller and more portable.
The overall measurement device is cylindrical and mainly divided into three parts: a liquid chamber holding the sample, an LED base providing illumination, and an adjustable light aperture — with a detachable folding phone holder for the smartphone. CAD modelling files and the bill of materials are attached at the end of the Hardware write-up. The design is centred on light blocking, stability, portability and easy sample replacement, so the device can be assembled and reused quickly in a non-specialist laboratory.
Structure 1 — Door of the liquid chamber
We designed an easy-to-open door for the liquid chamber: slide it upward to open, and it can be fixed in place, which allows one-handed operation and shortens sample replacement time. The chamber also has a light-blocking structure, so samples can be swapped conveniently without ambient light entering once the door is closed.
Structure 2 — Liquid container
The liquid container is made of 3D-printed side walls and a transparent acrylic plate bonded with hot-melt adhesive. It seals well while letting light pass through the liquid. We placed the optical path vertically, so light passes through the horizontally held liquid from below — this keeps the beam as perpendicular to the liquid surface as possible and reduces errors from refraction and reflection. Because the chamber is kept narrow to save space and shorten the path, the container is awkward to reach; we therefore added a slide rail so it can be pulled out from the side.
Structure 3 — Light source
An LED bead provides the light. LED beads are extremely low-cost and readily available, and our tests show their brightness meets the experimental requirements. To adjust brightness we designed an adjustable aperture above the light source: sliding the side slider changes how much light passes through the liquid. This lets the device adapt to samples of different colour depth and to different exposure conditions, avoiding HSV distortion from over- or underexposure.
Structure 4 — Phone holder
To hold the measurement smartphone properly we designed a foldable phone holder. It is stable and supports the phone securely; the arm length is adjustable so it fits phones of various sizes, and when folded it is compact and easy to carry, so the measurement platform can be set up anywhere.
Loading the 3D model…
Drag to rotate · pinch or Ctrl+scroll to zoom
Cycle 4 · Test
For the model we fitted a logistic curve to the previously collected data. We first extracted the Hue and Saturation readings of the pure yellow and pure blue solutions for each batch, then normalised each sample's position between them:
Using z_Hue and z_Saturation as inputs and the blue volume fraction as output, we fitted a shared logistic curve over 21 sample recordings from Experiment 1 and 42 from Experiment 2. After aligning each batch to its own pure-colour references, the pooled in-sample fit reached R2 = 0.801 and RMSE = 0.118, against R2 = 0.638 for the unnormalised Hue–Saturation plane.
| Fit | n | R2 | RMSE |
|---|---|---|---|
| Shared logistic, both batches | 63 | 0.801 | 0.118 |
| Experiment 1 under that curve | 21 | 0.781 | 0.142 |
| Experiment 2 under that curve | 42 | 0.815 | 0.103 |
Table 1-5. Cycle 4 model performance under the shared logistic curve.
Overall the pooled curve captures the main trend in both batches. Experiment 1 keeps the larger fitting error, and the residual asymmetry points to where calibration can be improved.
Cycle 4 · Learn
Normalising each batch against its own pure-yellow and pure-blue references improved the pooled in-sample fit to R2 = 0.801 and RMSE = 0.118, against 0.638 for the unnormalised plane — a real advance in describing both available batches with one curve.
The residuals also showed what still limits the model. In Experiment 2 the pure yellow sample was not the yellow extreme of the series, so z_Hue extended into negative values; the residuals had a slight right skew and a positive long tail. The choice of endpoints therefore strongly influences the model, and future work should standardise how pure-liquid endpoints are selected and increase the sample size.
Across the four cycles, RATIO Pocket went from a horizontal optical path with filters to a portable platform built around a smartphone camera, and from a binary linear regression to a normalised logistic regression with pure yellow and pure blue as endpoints. Three limitations remain, and we state them plainly: the sample size is small (Experiment 1 has RMSE = 0.142 with a right-skewed residual tail); the model is sensitive to how endpoints are defined; and food-colouring ratio is not the same as cell ratio — in real cells, scattering, sedimentation and biological background add interference, so these results cannot be extrapolated directly to a bacterial suspension.
Key Takeaways & Outlook
- Endpoint normalisation makes one curve work across batches (0.638 → 0.801)
- Endpoint choice dominates the fit — standardise how pure liquids are selected
- Residual right skew and positive tail remain in Experiment 1
- Dye ratio ≠ cell ratio: calibration in real cell systems is the open problem
Summary and Outlook
RATIO Pocket began with the need for low-cost cell-ratio detection. We designed low-cost hardware and built a mathematical model to calculate the ratio.
On the hardware side, the device evolved from a first-generation horizontal optical path with filters into a portable platform built around a smartphone camera. Using phyphox’s HSV function, we were able to acquire solution colour quantitatively. On the modelling side, we moved from binary linear regression to a normalised logistic regression with pure yellow and pure blue as endpoints. This reached a cross-batch R2 of 0.801 and RMSE of 0.118, demonstrating that optical ratio detection is feasible.
The current results still have clear limitations. First, the sample size is small — Experiment 1 had a relatively large prediction error (RMSE = 0.142), and its residuals showed a slight right skew and a positive long tail. Second, the model is sensitive to how endpoints are defined: in Experiment 2, the pure yellow was not the yellow extreme of the series, which pushed zHue into negative values. Third, food-colouring ratio is not the same as cell ratio — in real cells, scattering, sedimentation and biological background will introduce additional interference, so the present results cannot be extrapolated directly.
In future work, we will standardise the selection of pure-liquid endpoints and increase both the sample size and the number of concentration gradients to make the model more robust. We will also continue improving the hardware, for example by designing holders for disposable containers such as centrifuge tubes, or by adding optical components such as lenses or narrow-band filters to improve detection accuracy. Finally, we plan to run calibration experiments in real cell systems to assess how scattering and background affect HSV readings, establish a mapping from pigment ratio to cell ratio, and ultimately build a portable ratio-detection platform for biological experiments.
RATIO Bench
Version 1 (First prototype: 154 ms / 16×)
Cycle 1 · Design
Premise (biological). The approach assumes that the amount of pigment a cell produces is proportional to the number of cells, so that the pigment concentration in the suspension reflects the cell concentration; a mixed suspension at a given ratio then maps to one reproducible colour. Chromoprotein-expressing cells were not yet available in the wet lab[3], so two food-colouring dyes — Brilliant Blue FCF (Blue No. 1) and Tartrazine (Yellow No. 5) — were used as substitutes for the bacterial pigment throughout this work.
Goal. verify that "absorbance ratio + four-channel colour sensor" can resolve the blue fraction of a two-chromoprotein mixture.
Hypothesis. the absorbance ratio y = A_B/A_G changes monotonically with the blue fraction x. Taking the ratio cancels the total concentration c and the path length L, so y depends on x alone.
Design targets, the baseline every version is measured against:
| Specification | Target | Unit |
|---|---|---|
| Resolution Δx | ≤ 5 | % |
| Calibration R² (rational fit) | > 0.95 | dimensionless |
| Signal-to-noise (R-channel drift) | < 2 | % |
| Concentration independence RSD | < 5 | % |
Table 2-1. RATIO Bench design targets, the baseline every version is measured against.
Firmware choice — 154 ms integration, 16× gain, a 1000-point sliding-average filter and an OLED display.
Cycle 1 · Build
STM32F103C8 + TCS34725[1] + 0.96" OLED, with the I²C drivers written in C (STM32Cube HAL). The sensor sits on I²C2 and the display on I²C1.
Cycle 1 · Test
A pre-experiment covered a wide range (25 % steps), 5 % steps, 1 % steps and concentration independence. Each sample was measured once (n = 1); the ± shown on the OLED is the spread of the on-board N = 10 readings, not replicate samples.
Reference (blank, pure medium): R₀ = 2876, G₀ = 4000, B₀ = 5207.
| ID | Blue fraction x | R | G | B | A_G | A_B | y = A_B/A_G |
|---|---|---|---|---|---|---|---|
| A0 | 0.00 | 2923 | 3903 | 4679 | 0.011 | 0.046 | 4.355 |
| A1 | 0.25 | 2621 | 3526 | 4382 | 0.055 | 0.075 | 1.368 |
| A2 | 0.50 | 2595 | 3656 | 4837 | 0.039 | 0.032 | 0.820 |
| A3 | 0.75 | 2675 | 3656 | 4633 | 0.039 | 0.051 | 1.299 |
| A4 | 1.00 | 2560 | 3753 | 5002 | 0.028 | 0.017 | 0.630 |
Table 2-2. Stage A — wide range (25 % steps). A_G = −log₁₀(G/G₀), A_B = −log₁₀(B/B₀).
| ID | x | R | G | B | A_G | A_B | y |
|---|---|---|---|---|---|---|---|
| B1_40 | 0.40 | 2681 | 3670 | 4662 | 0.037 | 0.048 | 1.284 |
| B1_45 | 0.45 | 2707 | 3730 | 4809 | 0.030 | 0.035 | 1.138 |
| B1_50 | 0.50 | 2645 | 3820 | 5057 | 0.020 | 0.013 | 0.635 |
| B1_55 | 0.55 | 2590 | 3733 | 4802 | 0.030 | 0.035 | 1.172 |
| B1_60 | 0.60 | 2686 | 3754 | 4886 | 0.028 | 0.028 | 1.003 |
| B2_48 | 0.48 | 2646 | 3696 | 4739 | 0.034 | 0.041 | 1.192 |
| B2_49 | 0.49 | 2340 | 2837 | 3681 | 0.149 | 0.151 | 1.010 |
| B2_50 | 0.50 | 2749 | 2906 | 4954 | 0.139 | 0.022 | 0.156 |
| B2_51 | 0.51 | 2539 | 3661 | 4710 | 0.038 | 0.044 | 1.133 |
| B2_52 | 0.52 | 2557 | 3636 | 4947 | 0.041 | 0.022 | 0.537 |
Table 2-3. Stage B1 (5 % steps) and Stage B2 (1 % steps).
| ID | Relative concentration | R | G | B | A_G | A_B | y |
|---|---|---|---|---|---|---|---|
| C1 | 0.5× | 2315 | 3444 | 4321 | 0.065 | 0.081 | 1.246 |
| C2 | 1× | 2520 | 3665 | 4616 | 0.038 | 0.052 | 1.377 |
| C3 | 2× | 2588 | 3811 | 5122 | 0.021 | 0.007 | 0.340 |
Table 2-4. Stage C — concentration independence (fixed 50:50).
The analysis followed seven steps:
- Blank calibration — measure the pure medium for the reference intensities I₀ (R₀, G₀, B₀).
- Absorbance conversion — A = −log₁₀(I / I₀)[2] for every channel.
- Feature ratio — y = A_B / A_G; taking the ratio cancels c and L.
- Outlier detection — robust MAD (median absolute deviation) on the fit residuals, |z| > 3 flagged. This flagged A3, B2_49, B2_50, B2_52 and C3, in each case because the G or B channel sits far from the rest of its stage.
- Model fitting — least squares on the theoretical fractional-linear form y = [b + (a-b)x] / [1 + (c-1)x], compared with a linear fit.
- Validation — invert the calibration to predict x from y for every sample and compute the absolute error.
- Noise audit — the R channel serves as a noise probe: neither chromoprotein absorbs red strongly, so R should stay constant and its drift is the noise floor.
Inverting the calibration puts the mean absolute error at ≈ 22 percentage points, and the three concentration levels disagree by 57 % (RSD).
Cycle 1 · Learn
The failure is not a wrong principle — the ratio method itself is sound; the data is noise-dominated. We therefore decided to quantify the noise sources before changing any hardware.
What we tried and abandoned in this version:
| What we tried | Why it failed | What we do instead |
|---|---|---|
| Linear calibration fit | R² = 0.612; the true model is fractional-linear, not linear | Rational fit (Version 3) |
| A single long sliding average | Smooths high-frequency noise but cannot quantify the error | N = 10 independent readings with mean ± std (Version 3) |
Table 2-5. What Version 1 tried and abandoned, and what replaced it.
Version 2 (Noise localisation)
Cycle 2 · Design
Hypothesis — the noise comes from light-source drift, the sampling method and/or an inconsistent blank baseline.
Method — use the R channel as a noise probe: neither chromoprotein absorbs red strongly, so R should stay constant, and its measured drift is therefore pure noise.
Cycle 2 · Build
Decomposed the noise into three quantifiable terms: R-channel drift, blank-baseline drift and the signal magnitude.
Cycle 2 · Test
| Quantity | Value |
|---|---|
| R-channel drift (noise floor) | 13.6 % |
| Blank-baseline drift | 3.0 %–5.1 % |
| Useful signal (absorption) | 2.4 %–15.8 % |
Table 2-6. Noise decomposition of the pre-experiment data.
Cycle 2 · Learn
Root cause: SNR ≈ 1 — the signal is drowned by the noise. The fundamental reason is that the chromoprotein concentration is too low, so too little light is absorbed.
What we tried and abandoned in this version:
| What we tried | Why it failed | What we do instead |
|---|---|---|
| 154 ms integration / 16× gain | Signal too weak; the Clear channel saturates at longer integration times | 700 ms / 4× (Version 3) |
| Not recording the Clear channel | Lost the chance to normalise light-source drift | Record R/G/B/Clear and normalise by C (Version 3) |
Table 2-7. What Version 2 tried and abandoned, and what replaced it.
Version 3 (700 ms / 4× + repeated sampling)
Cycle 3 · Design
- Integration time 154 ms → 700 ms (more photons → lower shot noise).
- Gain 16× → 4× (avoid saturating the Clear channel at 700 ms).
- Single sliding average → N = 10 independent readings with mean ± std-dev.
- Add the Clear channel for drift normalisation, and switch the calibration model from linear to rational:
Cycle 3 · Build
New firmware: TCS_Measure() takes N independent readings and returns mean ± std-dev; the OLED shows the mean on page 1 and the std-dev on page 2.
Cycle 3 · Test
The rational fit reaches R² = 0.974 on the Stage-A data, against 0.612 for the linear fit, with a = 15.3, b = 4.36 and c = 18.2:
Pending re-test — resolution (5 % / 1 %) and concentration independence with ≥ 5 replicates. The corresponding data have not yet been collected.
Cycle 3 · Learn
The ratio method is valid once the fitting model is correct. The remaining blocker is data quality — specifically the chromoprotein concentration — which is being addressed on the wet-lab side.
Summary and Outlook
RATIO Bench went through three Design–Build–Test–Learn versions. The first build showed that the ratio method is physically correct but too noisy; the second quantified the noise and found SNR ≈ 1; the third improved the firmware and validated the correct fitting model (R² = 0.974). Throughout, the signal (2 %–16 % absorption) was being drowned by the noise (13.6 %) — the problem was never the principle.
The current results still have clear limitations. The pre-experiment used a single measurement per sample (n = 1), so the reported errors rest on five calibration points. The calibration cannot yet resolve the 5 % and 1 % steps, and the three concentration levels disagree by 57 %. The samples were also prepared from two food-colouring dyes (Brilliant Blue FCF and Tartrazine) rather than from the chromoprotein itself, so these results validate the measurement principle rather than a finished biological calibration.
In future work we will raise the chromoprotein concentration so the absorbance reaches 0.2–0.8, re-test resolution and concentration independence with ≥ 5 replicates, normalise by the Clear channel, and optionally upgrade to a dual-wavelength LED with a 16-bit ADC.
Next iteration — re-select the feature ratio. The ratio used throughout, y = A_B/A_G, follows from the chromoprotein absorption peaks (amilCP ≈ 588 nm, amilGFP ≈ 512 nm), which both fall inside the G channel. The measurements reported here, however, used food-colouring dyes as substitutes, and those dyes absorb elsewhere: Brilliant Blue FCF peaks at ≈ 630 nm (the R channel) and Tartrazine at ≈ 427 nm (the B channel). For the dye system the informative pair is therefore R and B, not B and G — the ratio tuned for the chromoproteins is not necessarily the ratio that is optimal for the samples actually measured.
The next iteration should therefore: (i) recompute y = A_B/A_R from the existing raw R/G/B data; (ii) fit both candidates (A_B/A_G and A_B/A_R) and compare their resolution; and (iii) once real chromoprotein samples are available, repeat the comparison before fixing the model. Which channel pair is used should be decided by the data, not inherited from the chromoprotein peaks.
References
- ams-OSRAM, TCS34725 Colour Sensor — Datasheet. ams-osram.com (accessed 2026).
- Mayerhöfer T. G., Pahlow S., Popp J., The Bouguer–Beer–Lambert Law: Shining Light on the Obscure, ChemPhysChem (2020). DOI: 10.1002/cphc.202000464.
- Liljeruhm J. et al., Engineering a palette of eukaryotic chromoproteins for bacterial synthetic biology, Journal of Biological Engineering (2018). DOI: 10.1186/s13036-018-0100-0.
Linked mentions
4Results 3
- …the expected connections, supporting the selection of candidate plasmids for expression testing; the sequencing results are documented in Notebook 1. The change in assembly method is described on the Engineering page.under · Results
- …The iterative investigation of these double-positive signals, including circuit and experimental-condition checks, is documented on the Engineering page. Here, we used confocal observations to select third-round candidates dominated by single-positive cells with more readily distinguishable green and red…under · Results
- …Cre/lox-recorded states. Nor is a model estimate an independent cell count; the exploration of cell-counting methods is described on the Engineering page. Dual-channel signals in some microscopic positions, variable per-cell brightness, and the current use of three technical replicates limit the inference to…under · Results