Abstract
Textile dyeing using microorganisms is a step towards sustainable manufacturing. Computational design offers the prospect of new biosynthetic colourants with better dyeing performance, greater photostability, reduced toxicity, and desired colour. We present a workflow (DyeDactic) to predict halochromism, i.e. colour at different pH values. We filter compound libraries using a graph neural network model to estimate the relevant electronic transition energies of potential colourants. The absorption spectra in the visible region and the colours of the resultant molecules are calculated using time-dependent density functional theory. The populations of protonated and deprotonated species are estimated at different pH values. A weighted sum of their computed absorption spectra gives the predicted colour. The DyeDactic workflow is applied to four natural colourants: emodin, quinalizarin, biliverdin, and orcein, followed by experimental validation. As an illustration we also investigated the molecular mechanism of a red to blue colour change when microbial culture containing polyketide bikaverin is autoclaved. The workflow represents a useful tool to guide chemoenzymatic modifications to achieve industrial applicability.

Similar content being viewed by others
Data availability
The results from TD-DFT calculations and the trained chemprop models are available at https://github.com/colorifix/DyeDactic.
Code availability
All code to reproduce the workflow (except the colour index related analysis) is available at https://github.com/colorifix/DyeDactic; https://doi.org/10.5281/zenodo.17955211.
References
Bechtold, T. & Mussak, R. Handbook of Natural Colorants (John Wiley & Sons, 2009).
Grätzel, M. Dye-sensitized solar cells. J. Photochem. Photobiol. C Photochem. Rev. 4, 145–153 (2003).
Huang, H. et al. Targeted photoredox catalysis in cancer cells. Nat. Chem. 11, 1041–1048 (2019).
Woźniak, M. & Nowak-Perlak, M. Hypericin-based photodynamic therapy displays higher selectivity and phototoxicity towards melanoma and squamous cell cancer compared to normal keratinocytes in vitro. Int. J. Mol. Sci. 24, 16897 (2023).
Islam, M. R. & Mostafa, M. G. Textile dyeing effluents and environment concerns-a review. J. Environ. Sci. Nat. Resour. 11, 131–144 (2018).
Mouro, C., Gomes, A. P., Costa, R. V., Moghtader, F. & Gouveia, I. C. The sustainable bioactive dyeing of textiles: a novel strategy using bacterial pigments, natural antibacterial ingredients, and deep eutectic solvents. Gels 9, 800 (2023).
Li, D. P. et al. Stabilization of natural dyes by high levels of antioxidants. Adv. Mater. Res. 441, 192–199 (2012).
Roberts, M. A. J., Cranenburgh, R. M., Stevens, M. P. & Oyston, P. C. F. Synthetic biology: biology by design. Microbiology 159, 1219–1220 (2013).
Piñero, J., Furlong, L. I. & Sanz, F. In silico models in drug development: where we are. Curr. Opin. Pharmacol. 42, 111–121 (2018).
Yang, S., Chen, R., Cao, X., Wang, G. & Zhou, Y. J. De novo biosynthesis of the hops bioactive flavonoid xanthohumol in yeast. Nat. Commun. 15, 253 (2024).
Olsson, K. et al. Microbial production of next-generation stevia sweeteners. Microb. Cell Factories 15, 207 (2016).
Xu, F., Gage, D. & Zhan, J. Efficient production of indigoidine in Escherichia coli. J. Ind. Microbiol. Biotechnol. 42, 1149–1155 (2015).
Esclapez, J. et al. Optimization of phycocyanobilin synthesis in E. coli BL21: biotechnological insights and challenges for scalable production. Genes 15, 1058 (2024).
Manta-Costa, A., Araújo, S. O., Peres, R. S. & Barata, J. Machine learning applications in manufacturing—challenges, trends, and future directions. IEEE Open J. Ind. Electron. Soc. 5, 1085–1103 (2024).
Marques, M. A. L. & Gross, E. K. U. Time-dependent density functional theory. Annu. Rev. Phys. Chem. 55, 427–455 (2004).
Santos, M. C. dos & Bicas, J. L. Natural blue pigments and bikaverin. Microbiol. Res. 244, 126653 (2021).
Shestak, O. P., Novikov, V. L. & Glazunov, V. P. Direct amination of naphthopurpurin and mompain, sea urchin pigments, and their O-methyl ethers by the reaction with ammonia. Russ. Chem. Bull. 70, 792–804 (2021).
Maaten, L. vander & Hinton, G. Visualizing data using t-SNE. J. Mach. Learn. Res. 9, 2579–2605 (2008).
Newsome, A. G., Culver, C. A. & van Breemen, R. B. Nature’s palette: the search for natural blue colorants. J. Agric. Food Chem. 62, 6498–6511 (2014).
Arteca, G. A. Molecular shape descriptors. in Reviews in Computational Chemistry 191–253 (John Wiley & Sons, Ltd, 1996).
Porter, J. J. Dyeing equilibria: interaction of direct dyes with cellulose substrates. Color. Technol. 118, 238–243 (2002).
Beeson, K. H. Jr. Indigo production in the eighteenth century. Hisp. Am. Hist. Rev. 44, 214–218 (1964).
Russell, F., Harmody, D., McCarthy, P. J., Pomponi, S. A. & Wright, A. E. Indolo[3,2-a]carbazoles from a deep-water sponge of the genus asteropus. J. Nat. Prod. 76, 1989–1992 (2013).
Mann, H. B. & Whitney, D. R. On a test of whether one of two random variables is stochastically larger than the other. Ann. Math. Stat. 18, 50–60 (1947).
Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyals, O. & Dahl, G. E. Neural message passing for quantum chemistry. in Proc. 34th International Conference on Machine Learning 70, 1263–1272 (JMLR.org, 2017).
Heid, E. et al. Chemprop: a machine learning package for chemical property prediction. J. Chem. Inf. Model. 64, 9–17 (2024).
Greenman, K. P., Green, W. H. & Gómez-Bombarelli, R. Multi-fidelity prediction of molecular optical peaks with deep learning. Chem. Sci. 13, 1152–1162 (2022).
Bannwarth, C., Ehlert, S. & Grimme, S. GFN2-xTB—an accurate and broadly parametrized self-consistent tight-binding quantum chemical method with multipole electrostatics and density-dependent dispersion contributions. J. Chem. Theory Comput. 15, 1652–1671 (2019).
Hirata, S. & Head-Gordon, M. Time-dependent density functional theory within the Tamm–Dancoff approximation. Chem. Phys. Lett. 314, 291–299 (1999).
Garcia-Ratés, M. & Neese, F. Efficient implementation of the analytical second derivatives of hartree–fock and hybrid DFT energies within the framework of the conductor-like polarizable continuum model. J. Comput. Chem. 40, 1816–1828 (2019).
Mester, D. & Kállay, M. Charge-transfer excitations within density functional theory: how accurate are the most recommended approaches? J. Chem. Theory Comput. 18, 1646–1662 (2022).
Lin, Y.-S., Li, G.-D., Mao, S.-P. & Chai, J.-D. Long-range corrected hybrid density functionals with improved dispersion corrections. J. Chem. Theory Comput. 9, 263–272 (2013).
Briggs, L. H. et al. Chemistry of fungi. XI. Corticins A, B, and C, benzobisbenzofurans from Corticium caeruleum. Aust. J. Chem. 29, 179–190 (1976).
Joung, J. F. et al. Deep learning optical spectroscopy based on experimental database: potential applications to molecular design. JACS Au 1, 427–438 (2021).
Ksenofontov, A. A., Lukanov, M. M. & Bocharov, P. S. Can machine learning methods accurately predict the molar absorption coefficient of different classes of dyes? Spectrochim. Acta. A Mol. Biomol. Spectrosc. 279, 121442 (2022).
McDonald, M. A., Koscher, B. A., Canty, R. B. & Jensen, K. F. Calibration-free reaction yield quantification by HPLC with a machine-learning model of extinction coefficients. Chem. Sci. 15, 10092–10100 (2024).
Fayet, G. et al. Excited-state properties from ground-state DFT descriptors: a QSPR approach for dyes. J. Mol. Graph. Model. 28, 465–471 (2010).
Priyadarshi, R., Ezati, P. & Rhim, J.-W. Recent advances in intelligent food packaging applications using natural food colorants. ACS Food Sci. Technol. 1, 124–138 (2021).
Musso, H. ORCEIN–UND LACKMUSFARBSTOFFE1. Planta Med. 8, 432–446 (2009).
Longhi, G. et al. Insights into the structures of bilirubin and biliverdin from vibrational and electronic circular dichroism: history and perspectives. Molecules 28, 2564 (2023).
Lightner, D. A., Holmes, D. L. & McDonagh, A. F. On the acid dissociation constants of bilirubin and biliverdin: pKa VALUES FROM 13C NMR SPECTROSCOPY (*). J. Biol. Chem. 271, 2397–2405 (1996).
Eckardt, K. et al. Anthracyclinone-blue A and B, new natural anthracyclinones containing nitrogen in the molecules: isolation, chemical structures and biosynthesis. J. Basic Microbiol. 31, 371–376 (1991).
Zhang, Q. et al. Discovery of hybrid chemical synthesis pathways with DORAnet. Digit. Discov. 4, 3109–3125 (2025).
Ren, Y. et al. Dyeing and antibacterial properties of cotton dyed with prodigiosins nanomicelles produced by microbial fermentation. Dyes Pigments 138, 147–153 (2017).
Landrain, T., Adenis, M.-S., Blache, J. & Boissonnat, G. Use of actinorhodin and the derivatives thereof as a colouring agent. WO2018138089 (2018).
Colour index https://colour-index.com/.
Colorifix/DyeDactic https://github.com/Colorifix/DyeDactic (2025).
Rogers, D. & Hahn, M. Extended-connectivity fingerprints. J. Chem. Inf. Model. 50, 742–754 (2010).
Rajan, K., Brinkhaus, H. O., Agea, M. I., Zielesny, A. & Steinbeck, C. DECIMER.ai: an open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications. Nat. Commun. 14, 5045 (2023).
Bienfait, B. & Ertl, P. JSME: a free molecule editor in JavaScript. J. Cheminform. 5, 24 (2013).
Greenman, K. P., Green, W. H. & Gomez-Bombarelli, R. Code for UVVis predictions benchmarking. Preprint at https://doi.org/10.5281/zenodo.5500428 (2021).
Bergstra, J., Komer, B., Eliasmith, C., Yamins, D. & Cox, D. D. Hyperopt: a Python library for model selection and hyperparameter optimization. Comput. Sci. Discov. 8, 014008 (2015).
Wang, S., Witek, J., Landrum, G. A. & Riniker, S. Improving conformer generation for small rings and macrocycles based on distance geometry and experimental torsional-angle preferences. J. Chem. Inf. Model. 60, 2044–2058 (2020).
Landrum, G. et al. rdkit/rdkit: 2024_03_6 (Q1 2024) release. Preprint at https://doi.org/10.5281/zenodo.13469390 (2024).
Halgren, T. A. MMFF VI. MMFF94s option for energy minimization studies. J. Comput. Chem. 20, 720–729 (1999).
Ehlert, S., Stahn, M., Spicher, S. & Grimme, S. Robust and efficient implicit solvation model for fast semiempirical methods. J. Chem. Theory Comput. 17, 4250–4261 (2021).
Neese, F. Software update: The ORCA program system—version 5.0. WIREs Comput. Mol. Sci. 12, e1606 (2022).
Grimme, S., Brandenburg, J. G., Bannwarth, C. & Hansen, A. Consistent structures and interactions by density functional theory with small atomic orbital basis sets. J. Chem. Phys. 143, 054107 (2015).
Cossi, M., Barone, V., Mennucci, B. & Tomasi, J. Ab initio study of ionic solutions by a polarizable continuum dielectric model. Chem. Phys. Lett. 286, 253–260 (1998).
Helmich-Paris, B., de Souza, B., Neese, F. & Izsák, R. An improved chain of spheres for exchange algorithm. J. Chem. Phys. 155, 104109 (2021).
Van Dijk, J., Casanova-Páez, M. & Goerigk, L. Assessing recent time-dependent double-hybrid density functionals on doublet–doublet excitations. ACS Phys. Chem. Au 2, 407–416 (2022).
Liang, J., Feng, X., Hait, D. & Head-Gordon, M. Revisiting the performance of time-dependent density functional theory for electronic excitations: assessment of 43 popular and recently developed functionals from rungs one to four. J. Chem. Theory Comput. 18, 3460–3473 (2022).
Perdew, J. P., Ernzerhof, M. & Burke, K. Rationale for mixing exact exchange with density functional approximations. J. Chem. Phys. 105, 9982–9985 (1996).
Yanai, T., Tew, D. P. & Handy, N. C. A new hybrid exchange–correlation functional using the Coulomb-attenuating method (CAM-B3LYP). Chem. Phys. Lett. 393, 51–57 (2004).
Boese, A. D. & Martin, J. M. L. Development of density functionals for thermochemical kinetics. J. Chem. Phys. 121, 3405–3416 (2004).
Zhao, Y. & Truhlar, D. G. The M06 suite of density functionals for main group thermochemistry, thermochemical kinetics, noncovalent interactions, excited states, and transition elements: two new functionals and systematic testing of four M06-class functionals and 12 other functionals. Theor. Chem. Acc. 120, 215–241 (2008).
Grimme, S. & Neese, F. Double-hybrid density functional theory for excited electronic states of molecules. J. Chem. Phys. 127, 154116 (2007).
Weigend, F. & Ahlrichs, R. Balanced basis sets of split valence, triple zeta valence and quadruple zeta valence quality for H to Rn: design and assessment of accuracy. Phys. Chem. Chem. Phys. 7, 3297–3305 (2005).
Zheng, J., Xu, X. & Truhlar, D. G. Minimally augmented Karlsruhe basis sets. Theor. Chem. Acc. 128, 295–305 (2011).
Sugita, Y. & Okamoto, Y. Replica-exchange molecular dynamics method for protein folding. Chem. Phys. Lett. 314, 141–151 (1999).
Zou, H. & Hastie, T. Regularization and variable selection via the elastic net. J. R. Stat. Soc. Ser. B Stat. Methodol. 67, 301–320 (2005).
Wang, J., Wolf, R. M., Caldwell, J. W., Kollman, P. A. & Case, D. A. Development and testing of a general amber force field. J. Comput. Chem. 25, 1157–1174 (2004).
Jakalian, A., Bush, B. L., Jack, D. B. & Bayly, C. I. Fast, efficient generation of high-quality atomic charges. AM1-BCC model: I. Method. J. Comput. Chem. 21, 132–146 (2000).
Li, P., Song, L. F. & Merz, K. M. Parameterization of highly charged metal ions using the 12-6-4 LJ-type nonbonded model in explicit water. J. Phys. Chem. B 119, 883–895 (2015).
Case, D. A. et al. AmberTools. J. Chem. Inf. Model. 63, 6183–6191 (2023).
Abraham, M. J. et al. GROMACS: high performance molecular simulations through multi-level parallelism from laptops to supercomputers. SoftwareX 1–2, 19–25 (2015).
Castañeda-Ovando, A. et al. Chemical studies of anthocyanins: a review. Food Chem. 113, 859–871 (2009).
Pietrzak, M., Maciejczyk, M., Szabelski, M., Kasparek, A. & Wieczorek, Z. Self-association of hypericin analyzed by light absorption and fluorescence spectroscopy and molecular dynamics simulations. Chem. Phys. Lett. 601, 39–44 (2014).
Calculators Playground https://playground.calculators.cxn.io/.
Csizmadia, F., Tsantili-Kakoulidou, A., Panderi, I. & Darvas, F. Prediction of distribution coefficient from structure. 1. Estimation method. J. Pharm. Sci. 86, 865–871 (1997).
Loco, D. & Cupellini, L. Modeling the absorption lineshape of embedded systems from molecular dynamics: a tutorial review. Int. J. Quantum Chem. 119, e25726 (2019).
Acknowledgements
The authors gratefully acknowledge the financial support from Innovate UK under the Knowledge Transfer Partnership (KTP) programme for KTP Associate funding (KTP13278). J.D.H. is supported by the Department of Science, Innovation and Technology (DSIT) and the Royal Academy of Engineering under the Chairs in Emerging Technologies scheme. We are grateful for access to the University of Nottingham high performance computer (HPC). We thank Ed Whitley for advice and help with experimental measurements and Helen Deeks for the code review.
Author information
Authors and Affiliations
Contributions
J.D.H. and R.J.W. conceived the idea of the project. D.S.K. carried out the calculations, wrote the computer code, performed the data analysis and experiments and prepared the manuscript draft. J.D.H., R.M. and R.J.W. supervised the research and edited the manuscript.
Corresponding author
Ethics declarations
Competing interests
D.S.K. is a KTP associate working with Colorifix Ltd. R.M. is an employee of Colorifix Ltd. All other authors declare no competing interests.
Peer review
Peer review information
Communications Chemistry thanks the anonymous reviewers for their contribution to the peer review of this work.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Karlov, D.S., Marques, R., Wheatley, R.J. et al. DyeDactic workflow to predict halochromism of biosynthetic colourants. Commun Chem (2026). https://doi.org/10.1038/s42004-025-01881-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s42004-025-01881-9


