Introduction

The variability in individual responses to pharmaceuticals among patient populations is primarily driven by their unique physiological characteristics1,2,3,4,5. Achieving precise regulation of drug concentrations in the bloodstream is particularly critical for drugs with a narrow therapeutic window, such as chemotherapy agents, where even minor deviations can significantly impact therapeutic outcomes6,7,8,9. Methotrexate (MTX), a commonly prescribed chemotherapeutic agent10,11, plays a vital role in oncological treatment, as well as in managing autoimmune diseases such as rheumatoid arthritis and Crohn’s disease12,13. Its narrow therapeutic index and potential for severe toxic side effects upon overdosage necessitate meticulous monitoring. Current clinical therapeutic drug monitoring (TDM) methodologies3,14,15,16,17,18, however, are constrained by their periodic sampling, complex procedures, high costs, and most importantly, their lack of precise in vivo molecular recognition capability19,20,21,22. Real-time monitoring of MTX is of paramount importance due to its narrow therapeutic window and the potential for severe toxic side effects upon overdosage. The necessity for such monitoring is further emphasized by the cardiotoxicity associated with MTX and the medical demand for personalized MTX dose assessment during chemotherapy. Continuous monitoring ensures that the concentration of MTX in the bloodstream is maintained within a therapeutic range, thereby maximizing the drug’s efficacy while minimizing the risk of toxicity. Therefore, real-time monitoring of MTX not only ensures patient safety and therapeutic efficacy but also helps in preventing environmental contamination and safeguarding public health. The ability to monitor MTX concentrations in real time provides a critical tool for personalized medicine, allowing for the adjustment of treatment protocols to meet the individual needs of patients and improve outcomes. This underscores the urgent need for innovative strategies that can provide selective recognition, reliable, and continuous monitoring of MTX concentrations in vivo.

In response to these challenges, we propose a novel synergistic atomic-molecular docking strategy specifically tailored for selective in vivo monitoring of MTX. This strategy leverages the unique chemical properties of MTX, particularly its two adjacent carboxyl groups and aminopyrimidine group, which enable selective capture through coordination with designed iron single atoms (Fe1) and zinc single atoms (Zn1) respectively23,24. The resulting synergistic hybrid-dual atomic sites not only secure the capture of MTX but also facilitate selective photoelectrochemical (PEC) monitoring directly within the in vivo milieu. PEC detection modalities are preferred due to their ability to elicit analytical signals without extrinsic bias25,26,27,28, thereby avoiding potential perturbations to the endogenous electrophysiological milieu and enhancing the fidelity and selectivity of detection. By integrating the rationally designed hybrid-dual atomic photoelectrode of Fe1-Zn1-TiO2 with a single-chip microcomputer system, we have developed an implantable PEC-therapeutic drug monitoring (PEC-TDM) system that enables continuous and precise monitoring of MTX concentrations. In addition, we seamlessly integrate the peristaltic pump driver into our detection system, enabling the automated control of drug delivery via the controller. This sophisticated integration ensures that the peristaltic pump operates autonomously, thereby allowing for the accurate and uninterrupted monitoring of the therapeutic process. This system has the potential to inform personalized therapeutic decisions and guide intelligent drug delivery for individualized therapy, ultimately leading to improved patient outcomes and quality of life. The PEC-TDM system represents a transformative management model that contributes to a more comprehensive and personalized approach to oncological care.

Results and discussion

The laborious processes inherent to traditional TDM, encompassing sample collection, analytical detection, data processing, and result interpretation (Fig. 1a), not only amplify operational intricacy but also pose potential impediments to the expeditious execution of treatment protocols. To surmount these challenges, we have conceived and developed a PEC-TDM approach (Fig. 1b). This innovative apparatus is capable of real-time blood drug concentration monitoring and, through its intelligent design, automatically adjusts drug administration strategies based on detected data. The PEC-TDM system thus achieves full automation of the otherwise cumbersome steps within the TDM process. This paradigm shift not only enhances the precision of blood concentration control, ensuring therapeutic levels are maintained but also successfully transcends the limitations of conventional TDM methods in practical application settings. The architectural schematic of the PEC-TDM device is elucidated in Fig. 1c. By integrating a wireless control module with the photoelectrode, we have fabricated an autonomous monitoring and treatment apparatus. The device comprises a Bluetooth chip with an embedded micro-control unit (MCU), a micro-electrochemical workstation, a photoelectrode, a peristaltic pump, and a rechargeable battery. Following in vivo calibration of the photoelectrode, measured data are translated into corresponding MTX concentration values. Subsequently, the dosing intervals of the peristaltic pump are determined based on this information. The compact device highlights its portability and suitability for use in various clinical settings (Fig. 1d). When implanted in mice with electrodes positioned in the tail vein, MTX can be administered under real-time monitoring conditions. The Fe1-Zn1-TiO2 photoelectrode was strategically designed to exhibit selective affinity for MTX, leveraging a double-site recognition mechanism as depicted in Fig. 1e. This mechanism involves the aminopyrimidine and dicarboxylic moieties of the MTX molecule coordinating with the Zn and Fe atoms of Fe1-Zn1-TiO2, respectively. This coordination ensures the selective capture of MTX on the photoelectrode surface. Under illumination, the TiO2 substrate becomes excited, triggering the transfer of photogenerated electrons from the Fe/Zn atoms to the MTX molecules. This process results in the reduction of MTX and a corresponding decrease in the photocurrent signal. By measuring these photocurrent signal values, it is possible to accurately construct a pharmacokinetic curve for MTX.

Fig. 1: Proposed PEC-TDM system.
figure 1

Schematic diagrams of a traditional TDM program and b PEC-TDM approach; c the block diagram of PEC-TDM system with micro-control unit, micro-electrochemical workstation, peristaltic pump, and battery; d digital photos of PEC-TDM device; e recognition mechanism of MTX on Fe1-Zn1-TiO2 and corresponding detection of MTX.

The fabrication process of Fe1-Zn1-TiO2 photoelectrodes is thoroughly delineated in the “Method” section and visually depicted in Supplementary Fig. 1. To facilitate real-time drug concentration monitoring within a biological environment, titanium (Ti) wires with good biocompatibility were meticulously engineered into fine needle shapes with an apical diameter of 10 μm and a basal diameter of 100 μm (Fig. 2a, more detailed data is provided in Supplementary Table 1), to enable seamless implantation into blood vessels. Then, the Ti wire underwent electrochemical anodization, resulting in the formation of neatly arranged TiO2 nanotubes (Supplementary Fig. 2a). Subsequent ultrasonic treatment removed the nanotube layer, leaving behind a regular array of nanocaves (Supplementary Fig. 2b). A second anodization step yielded TiO2 structures characterized by micro-morphologies of top-nanoring (Fig. 2b) and bottom-nanotube (Supplementary Fig. 3). This unique nanostructure conferred responsiveness to near-infrared light (Supplementary Fig. 4). Utilizing a cryo-electrodeposition technique, Fe and Zn single atoms were coordinated onto the TiO2 surface.

Fig. 2: Synthesis and characterizations of Fe1-Zn1-TiO2 photoelectrode.
figure 2

a SEM image of thin wire Fe1-Zn1-TiO2 photoelectrode, the scale bar is 100 μm; b top-view SEM image of Fe1-Zn1-TiO2, the scale bar is 500 nm; c HRTEM image of Fe1-Zn1-TiO2, the scale bar is 2 nm; d AC HAADF STEM image of Fe1-Zn1-TiO2, the scale bar is 2 nm; e three-dimensional color grid diagram of single atoms in selected area in Fig. 1d; f enlarged AC HAADF STEM image of Fe1-Zn1-TiO2 and corresponding xy line scan data diagram; g HADDF STEM image and corresponding EDS mapping images of Fe1-Zn1-TiO2, the scale bar is 250 nm; h core-level XPS of Fe 2p of Fe1-Zn1-TiO2; i Fe K-edge XAS spectra of Fe1-Zn1-TiO2 and Fe foil; j R-space EXAFS spectra of Fe1 in Fe1-Zn1-TiO2 and Fe foil; k 3D Fe K-edge wavelet transform (WT)-EXAFS for wavelet transform of Fe1-Zn1-TiO2 and Fe foil; l core-level XPS of Zn 2p of Fe1-Zn1-TiO2; m Zn K-edge XAS spectra of Fe1-Zn1-TiO2 and Zn foil; n R-space EXAFS spectra of Zn1 in Fe1-Zn1-TiO2 and Zn foil; o 3D Zn K-edge wavelet transform (WT)-EXAFS for wavelet transform of Fe1-Zn1-TiO2 and Zn foil; p cross-sectional SEM image of Fe1-Zn1-TiO2, the scale bar is 200 nm, and the inset is a schematics of top-nanoring-bottom-nanotube structure; q DRS of Fe1-Zn1-TiO2; r top view FDTD simulation diagram of Fe1-Zn1-TiO2; s cross-sectional FDTD simulation diagram of Fe1-Zn1-TiO2. Three electrodes are independent characterized with similar results (n = 3).

The crystal structure of the resulting Fe1-Zn1-TiO2 photoelectrode was elucidated through X-ray diffraction (XRD) analysis. All discernible XRD peaks were attributed to metallic Ti (substrate) and TiO2 (anatase phase), with no detectable XRD patterns for Fe or Zn species (Supplementary Fig. 5). High-resolution transmission electron microscopy (HRTEM) imaging (Fig. 2c) revealed a clear lattice structure with a spacing of 0.35 nm, corresponding to the (101) crystal face of anatase TiO229. Furthermore, no nanoparticles or clusters of Fe or Zn species were observed in HRTEM images (Supplementary Fig. 6).

To conclusively demonstrate the presence of single atoms, a high-precision aberration-corrected high-angle dark field scanning transmission electron microscopy (AC HAADF-STEM) image was acquired and displayed in Fig. 2d. Numerous isolated bright spots, highlighted by yellow circles, were identified as Fe and Zn single atoms due to their elevated atomic weights. No clusters or nanoparticles were discerned within the AC HAADF-STEM observation range. This finding aligns with the absence of metal crystals in the TEM image, further validating the existence of atomically dispersed Fe/Zn single atoms on the TiO2 surface. For a more intuitive representation of the dual single atoms’ presence, a 3D color grid diagram (Fig. 2e) of the box selection region in Fig. 2d was generated. Given that stronger contrast signals correspond to atoms with larger atomic numbers, spots with higher contrast can be assigned to Zn single atoms, while those with relatively weaker contrast are attributed to Fe single atoms. Comparable results were derived from the line scan spectrogram analysis of the ACHAADF-STEM image (Fig. 2f), wherein the atoms of Zn, Fe, and Ti, each exhibiting distinct contrast signal intensities, could be unambiguously differentiated.

To elucidate the elemental distribution of Fe1-Zn1-TiO2, HADDF-STEM imaging coupled with corresponding X-ray energy dispersive spectrum (EDS) elemental mapping was conducted for Ti, O, Fe, and Zn elements (Fig. 2g). Both Ti and O elements exhibited high intensity and uniform distribution across the entire surface. In contrast, Fe and Zn elements were found to be isolated and dispersed at the atomic level. Consequently, these microscopic morphological findings provide compelling evidence confirming the successful modification of both Fe and Zn single atoms on the TiO2 surface.

To further elucidate the existence of single atoms from a macroscopic perspective, X-ray photoelectron spectroscopy (XPS) and X-ray absorption spectroscopy (XAS) were employed. The XPS survey revealed the presence of Ti, O, Fe, and Zn elements in Fe1-Zn1-TiO2 (Supplementary Fig. 7), with atomic ratios of 0.17% and 0.19% for Fe and Zn respectively, consistent with EDS characterization results (Supplementary Fig. 8). Core-level XPS analysis of Fe 2p was presented in Fig. 2h, where two distinct absorption peaks at 709.2 eV and 722.8 eV can be attributed to Fe 2p3/2 and Fe 2p1/2, respectively30,31. These binding energy values exceeded those of metallic Fe, suggesting the presence of high valence state Fe species32,33. To investigate the single atom state and probe the coordination environment of Fe in Fe1-Zn1-TiO2, X-ray absorption near-edge spectroscopy (XANES) and extended X-ray absorption fine structure (EXAFS) analyses were conducted and are depicted in Fig. 2i. The white line peak intensity of Fe1-Zn1-TiO2 significantly surpassed that of Fe foil and exhibited a notable positive shift towards higher energy positions. This higher intensity and positional shift of the white line peak indicated an elevation in the metal ion’s oxidation state, confirming that Fe single atoms existed in a positively charged state (Feδ+) and elevated valence state relative to Fe0, aligning with XPS characterization findings. The local coordination environment of Fe single atoms was detailed in Fig. 2j. Contrastingly, unlike Fe foil, which exhibited a peak at 2.2 Å due to Fe-Fe coordination, Fe1-Zn1-TiO2 displayed two distinct peaks at 1.53 Å and 2.42 Å, assignable to Fe-O and Fe-Ti coordination, respectively. A comprehensive least square curve fitting analysis disclosed that the Fe single atoms were coordinated with three oxygen atoms and two Ti atoms (Supplementary Fig. 9 and Table 2), implying their integration into the TiO2 crystal lattice. Wavelet transform analysis was executed to intuitively validate the coordination of Fe single atoms in Fe1-Zn1-TiO2. As illustrated in Fig. 2k, the peaks located at 3.5 Å−1 corresponded to the Fe-O bond, while the peak at 13.2 Å−1 was associated with the Fe-Ti bond, markedly divergent from the 8.1 Å−1 of the Fe-Fe bond. The absence of an Fe–Fe bond in Fe1-Zn1-TiO2 substantiated the macroscopic single-atom state of the Fe species within the compound.

For the single atom Zn in Fe1-Zn1-TiO2, the core-level XPS of Zn 2p in Fig. 2l exhibited two peaks with binding energies at 1022.2 eV and 1045.1 eV, which can be attributed to Zn 2p3/2 and Zn 2p1/2, respectively34,35. In comparison to Zn foil, Fe1-Zn1-TiO2 also demonstrated a positive shift. Additionally, the core-level XPS spectra of Ti 2p and O 1s were obtained (Supplementary Figs. 10 and  11), both displaying a negative shift in Fe1-Zn1-TiO2 relative to those in TiO2, suggesting potential charge transfer between the Fe/Zn single atoms and the TiO2 substrate. The XANES spectrum of the Zn K-edge was shown in Fig. 2m, where an increased white line peak intensity and a higher energy position were indicative of a higher oxidation state and partial positive charge (Znδ+). As depicted in Fig. 2n, a prominent peak at 1.6 Å was observed in the R-space EXAFS spectra, corresponding to the first coordination layer of Zn-O. In contrast to the Zn-Zn bond coordination peak at 2.3 Å in Zn foil, no distinct Zn-Zn coordination peak was detected in Fe1-Zn1-TiO2. Based on EXAFS data, least square curve fitting analysis indicated that the Zn single atom was coordinated with five oxygen atoms (Supplementary Fig. 12 and Supplementary Table 3). This result suggested that Zn single atoms were anchored on the surface of TiO2 primarily through coordination with oxygen atoms. The wavelet transform spectrum (Fig. 2o) revealed a maximum intensity absorption peak at 4.45 Å−1, associated with the Zn-O coordination bond in Fe1-Zn1-TiO2. Compared to the wavelet transform spectrum of Zn foil, which exhibited a Zn-Zn bond at 7.7 Å−1, the peak position of the Zn single atom was significantly lower, and no characteristic peak of the Zn-Zn bond was detected in Fe1-Zn1-TiO2, indicating an absence of Zn agglomeration. All the aforementioned XPS and XAS characterizations confirmed that both Fe and Zn have been successfully loaded onto the TiO2 electrode surface in an atomically dispersed state. The modification with Fe and Zn single atoms was expected to provide unique molecular docking sites for specific molecule adsorption, enabling selective MTX capture on Fe1-Zn1-TiO2.

The Fe1-Zn1-TiO2 micro-photoelectrode was designed for in vivo drug concentration monitoring through vascular penetration, rendering its optical absorption activity crucial for practical applications. In this study, the TiO2 substrate featured a distinctive top-nanoring-bottom-nanotube nanostructure (Fig. 2p). The periodically arranged top-nanoring effectively traps photons, while the vertically oriented bottom-nanotube facilitated charge transfer. The optical absorption of Fe1-Zn1-TiO2 was assessed using a diffuse reflection spectrum (DRS) (Fig. 2q), revealing multiple absorption peaks across a broad wavelength range, particularly in the infrared region. By comparing the DRS absorption spectra of each electrode preparation step, it can be seen that the unique structure of Fe1-Zn1-TiO2 endows it with infrared absorption characteristics (Supplementary Fig. 13). To further substantiate the photon capture efficiency of this unique nanostructure, finite difference time domain (FDTD) simulations were employed to illustrate the electromagnetic response and spatial distribution of photon absorption. As depicted in Fig. 2r, the top-view FDTD image demonstrated effective photon localization within the nanoring. Moreover, the cross-sectional FDTD view (Fig. 2s) revealed that the top-nanoring region possessed significantly higher photon capture efficiency compared to the bottom. This enhanced optical absorption activity was a fundamental prerequisite for an efficient PEC response. The PEC performance was evaluated (Supplementary Fig. 14), exhibiting remarkable near-infrared light-responsive PEC activity (Supplementary Fig. 15). Besides the commendable optical absorption activity, the superior PEC performance can be further attributed to high carrier density (Supplementary Fig. 16), low electronic resistance (Supplementary Fig. 17), and appropriate electronic structures (Supplementary Fig. 18). These results confirmed the successful fabrication of the Fe1-Zn1-TiO2 photoelectrode, which featured dual single-atom sites and significant PEC capabilities, ensuring high selectivity for in situ MTX detection under in vivo conditions.

In order to enable long-term in vivo detection of MTX, a polyacrylamide hydrogel anti-fouling layer was applied to the photoelectrode’s surface to mitigate non-specific adsorption of proteins. The schematic diagram of this anti-fouling strategy was illustrated in Supplementary Fig. 19. The hydrogel, characterized by high hydrophilicity (Supplementary Fig. 20) and porous structure (Supplementary Fig. 21), formed a barrier against protein contact, preventing electrode contamination. Electrochemical tests showed that, unlike the unmodified electrode, the Fe1-Zn1-TiO2/Gel photoelectrode retained its photocurrent signal (Supplementary Fig. 22) and low electrochemical impedance (Supplementary Fig. 23) after BSA exposure, confirming the hydrogel’s effectiveness in resisting protein adsorption. Fluorescence microscopy with FITC-BSA revealed minimal fluorescence on the modified electrode compared to strong signals on the unmodified one, further validating the anti-fouling capability (Supplementary Fig. 24). SEM images supported these findings, showing abundant protein adsorption on the unprotected photoelectrode compared to the original photoelectrode (Supplementary Fig. 25), while no proteins were observed on the protected Fe1-Zn1-TiO2/Gel photoelectrode (Supplementary Fig. 26). This robust anti-fouling strategy ensured sustained photoelectrode performance in complex in vivo environments.

To ensure the precise qualitative detection of MTX molecules, it is imperative to assess the selectivity of the Fe1-Zn1-TiO2/Gel photoelectrodes specifically for MTX. The tests were performed in a solution containing 1000-fold higher concentrations of Na+, Cl, K+, Mg2+, and SO42− ions, alongside 50-fold more concentrated glycine (Gly), and 20-fold increased levels of citric acid (CA), glucose (Glu), ascorbic acid (AA) and human serum albumin as potential interfering species. The TiO2/Gel photoelectrode exhibited a marginal response to MTX (Fig. 3a), suggesting that the unmodified TiO2 electrode lacked sufficient selectivity for MTX and was easily perturbed by other chemical species presented in the medium. Further experiments examined the selectivity of Zn1-TiO2/Gel (Fig. 3b) and Fe1-TiO2/Gel (Fig. 3c) photoelectrodes towards MTX. Although these modified photoelectrodes demonstrated an enhanced response to MTX compared to the pristine TiO2/Gel photoelectrodes, their selectivity remained suboptimal. Such poor selectivity implied that these photoelectrodes might struggle to differentiate between MTX and other interfering compounds in complex samples. In contrast, the Fe1-Zn1-TiO2/Gel photoelectrode manifested a pronounced photocurrent response exclusively to MTX molecules (Fig. 3d), while displaying negligible reactions to other interferences. This outcome underscored the superior selectivity of the Fe1-Zn1-TiO2/Gel photoelectrode, making it a promising candidate for the specific and reliable PEC detection of MTX in intricate biological matrices.

Fig. 3: Selective PEC detection of MTX.
figure 3

Selectivity evaluation of MTX on a TiO2/Gel, b Zn1-TiO2/Gel, c Fe1-TiO2/Gel, and d Fe1-Zn1-TiO2/Gel photoelectrodes (n = 3, detection of the interfering substances was repeated three times on each electrode. The bar represents the mean of n = 3 independent experiments, the error bar represents the standard deviation, the dots represent independent experimental results); e FTIR spectra and f Raman spectra of MTX, TiO2, MTX/TiO2, MTX/Zn1-TiO2, MTX/Fe1-TiO2, and MTX/Fe1-Zn1-TiO2; g femtosecond transient absorption spectra of Fe1-Zn1-TiO2 and MTX/Fe1-Zn1-TiO2; h high-resolution XPS spectra of Fe 2p and Zn 2p of MTX/Fe1-Zn1-TiO2 before and after illumination; DFT calculation of adsorption energy of i MTX/Fe1-TiO2, j MTX/Zn1-TiO2, and k MTX/Fe1-Zn1-TiO2; l DFT calculation of local charge density difference of MTX/Fe1-Zn1-TiO2, yellow part represents local electron accumulation region and cyan part represents local electron depletion region.

Furthermore, to provide direct experimental evidence of the adsorption of MTX molecules on Fe1-Zn1-TiO2, both Fourier transform infrared (FTIR) spectroscopy and Raman spectroscopy were employed. As depicted in Fig. 3e, the FTIR spectrum of MTX displayed numerous characteristic peaks of functional groups within the wavenumber range of 1000–1500 cm−1. Upon adsorption of MTX molecules onto different electrodes, notable differences emerged. The post-adsorption infrared spectral peaks of TiO2, Zn1-TiO2, and Fe1-TiO2 remained identical to those of pristine TiO2, suggesting that these photoelectrodes did not effectively adsorb MTX molecules. Conversely, for the Fe1-Zn1-TiO2 photoelectrode, a pronounced peak emerged at 1211 cm−1 following MTX adsorption, which can be associated with the bending vibration of the O-H bond in the MTX molecule36. Additionally, the peaks observed at 1240 cm−1, 1455 cm−1, and 1504 cm−1 can be ascribed to the C-O stretching vibration, C-N stretching vibration of the heterocyclic ring, and N-H bending vibration in the heterocyclic ring, respectively37,38. The manifestation of these distinctive peaks unequivocally indicated that the Fe1-Zn1-TiO2 photoelectrode can efficiently adsorb MTX molecules. As illustrated in Fig. 3f, the Raman spectra have further corroborated these findings. MTX/Fe1-Zn1-TiO2 manifested two prominent Raman peaks at 1352 cm1 and 1601 cm1, corresponding to the C-O bending vibration and the C=C stretching vibration of the MTX molecule, respectively39,40. In contrast, Zn1-TiO2 and Fe1-TiO2 exhibited only weak MTX signal peaks after MTX adsorption, while MTX/TiO2 displayed no discernible difference from the original TiO2 Raman signal. These outcomes substantiated the enhanced selectivity of the Fe1-Zn1-TiO2 photoelectrode towards MTX molecule adsorption. In addition, it can be observed by changing the concentration of MTX (Supplementary Fig. 27) that the photocurrent signal of the electrode decreases after MTX is adsorbate on the surface of the Fe1-Zn1-TiO2 electrode, while the photocurrent signal recovers as before after the concentration of MTX is reduced, indicating that the interaction between MTX and the electrode is reversible. This phenomenon is related to electron transfer between the MTX and Fe1-Zn1-TiO2 electrodes.

The electron transfer between MTX and Fe1-Zn1-TiO2 was characterized using femtosecond transient absorption (fs-TA) spectroscopy. As shown in Fig. 3g, in the absence of MTX adsorption, the original TiO2, Zn1-TiO2, Fe1-TiO2 (Supplementary Fig. 28), and Fe1-Zn1-TiO2 electrodes did not show significant TA signals during the analysis process. After adsorption of MTX molecules, a more significant TA signal was observed on the Fe1-Zn1-TiO2 photoelectrode compared to the original TiO2 and mono-metal doped electrodes, indicating that excited photoelectrons were efficiently transferred to MTX molecules by Fe/Zn atoms under light. Moreover, the modification of the hydrogel anti-fouling layer has no negative impact on the charge transfer process (Supplementary Fig. 29). Due to its high hydrophilicity and porous structure, it provides a more favorable electrolyte environment for charge transfer, and improves the charge transfer efficiency of the interface to a certain extent. To elucidate this electron transfer process, a fitting analysis was performed on the experimental curve, with the fitting parameters detailed in Supplementary Table 4. The fitting outcomes revealed two principal decay processes: the faster decay time τ₁ (4.09 ps, accounting for 47%) was likely associated with the oxygen vacancy trapping charge of TiO2, while the slower decay time τ₂ (177.21 ps, 53%) might reflect the recombination process of photogenerated electrons and holes. Moreover, after 400 ps, a significant TA intensity persisted, signifying an ongoing electron transfer process between Fe1-Zn1-TiO₂ and MTX41,42. Based on these empirical results, a plausible electron transfer mechanism was proposed: the valence band electrons of the Fe1-Zn1-TiO₂ photoelectrode were photoexcited to the conduction band under illumination, and then shuttled via Fe/Zn single atoms to anchored aminopyrimidine and dicarboxylic structures of MTX, leading to the reduction of these moieties. The reduced MTX molecule subsequently desorbed from the photoelectrode surface, allowing the photoelectrode to capture and reduce the next MTX molecule. This cyclic process facilitated continuous monitoring of MTX molecules. To validate this hypothesis, the MTX solution post-reaction was subjected to mass spectrometry. A molecular species with a mass of 410.17 appeared in the MTX sample post-reaction (Supplementary Fig. 30). From the pre-binding analysis, it can be deduced that this substance was likely an MTX molecule that had undergone reduction to an aldehyde group following the detachment of an amino group. The mass spectrometry result supported the hypothesis that amino pyrimidine and dicarboxylic groups underwent reduction process under PEC conditions on Fe1-Zn1-TiO2. It can be seen from the cyclic voltammetry curve (Supplementary Fig. 31) that the reduction potential of MTX is between the valence band and conduction band of Fe1-Zn1-TiO2, and the electrode can transfer electrons to MTX through conduction band to participate in the reduction reaction of MTX. Furthermore, the electron transfer pathway of this reduction process can be elucidated by comparing the XPS spectra before and after illumination. As shown in Fig. 3h, in MTX/Fe1-Zn1-TiO₂ post-illumination, the binding energy of Fe/Zn single atoms experienced a positive shift. This alteration suggested a diminished electron cloud density and concomitant electron migration. Consequent to this observation, it can be affirmed that electrons were translocated from the Fe/Zn site to the MTX molecule, and the MTX reduction reaction indeed transpired on the photoelectrode surface.

To elucidate the capability of the Fe1-Zn1-TiO2 photoelectrode in capturing MTX molecules, we employed density functional theory (DFT) calculations using DS-PAW software43,44. These computations were grounded on the Fe/Zn coordination parameters derived from XAS spectral data, ensuring the precision and robustness of our model construction. Initially, we examined the interaction between the Fe1-TiO2 electrode and the MTX molecule. As depicted in Fig. 3i, the Fe1-TiO2 photoelectrode predominantly engaged in coordination bonding with the carboxyl group of the MTX molecule. The computed adsorption energy of −5.01 eV suggested that the Fe1-TiO2 photoelectrode possessed a moderate adsorption capacity for MTX molecules. Subsequently, we explored the interaction between the Zn1-TiO2 photoelectrode and the MTX molecule (Fig. 3j). The Zn1-TiO2 photoelectrode primarily coordinated with the aminopyrimidine segment of the MTX molecule, exhibiting an adsorption energy of −2.29 eV. Although this process constituted spontaneous adsorption, its adsorption capacity was marginally inferior to that of the Fe1-TiO2 photoelectrode. The Fe1-Zn1-TiO2 photoelectrode concurrently bonded with the aminopyrimidine and dicarboxylic structures of the MTX molecule, thereby establishing a more stable adsorption configuration (Fig. 3k). The calculated adsorption energy reached as high as −7.99 eV, which was notably greater than those of the Fe1-TiO2 and Zn1-TiO2 photoelectrodes. These findings underscored that the Fe1-Zn1-TiO2 photoelectrode exhibited the most pronounced selective adsorption effect toward MTX molecules. Differential charge analysis shed light on the electron transfer mechanism between the MTX molecule and the Fe1-Zn1-TiO2 photoelectrode (Fig. 3l). A pronounced charge transfer was observed with the electron transfer pathway principally traversing through Fe/Zn single atoms linked to the aminopyrimidine and carboxyl groups. This indicated the superior trapping efficacy of the dual-atom photoelectrode for MTX molecules. Through DFT calculations, we unveiled the trapping mechanism of MTX molecules by the Fe1-Zn1-TiO2 photoelectrode. The results suggested that MTX might be captured by the electrode via a dual-chelate bond, and the judicious design of the dual-atom electrode manifested commendable trapping and recognition performance for MTX. Additionally, apart from the Fe+Zn combination, we also calculated the adsorption capacities for the Co+Zn, Ni+Zn, and Fe+Cu combinations and found that the Fe+Zn combination exhibited the maximum adsorption capacity for MTX (Supplementary Fig. 32). This indicates that the Fe+Zn combination is the optimal choice.

The sensitivity of the Fe1-Zn1-TiO2 photoelectrodes towards MTX was assessed through photocurrent response measurements. As MTX concentration increased, the photocurrent response decreased (Supplementary Fig. 33), indicating more MTX molecules reducing at the photoelectrode surface and increasing electron depletion. Notably, the photocurrent response showed a linear correlation with MTX concentration from 1 to 100 μM, allowing for precise determination of MTX levels (Supplementary Fig. 34). The detection threshold is as low as 0.684 μM. The safe therapeutic blood concentration range for MTX is between 6 μM and 16 μM for low-dose MTX administration and between 25 μM and 60 μM for high-dose MTX administration45, which allows for real-time monitoring within the therapeutic range, and the PEC sensor’s detection range and minimum detection limit fully meet the monitoring of the clinical treatment range. Investigations into the effects of varying Fe and Zn single atom ratios on the photocurrent response revealed that the maximum response was achieved with a 1:1 ratio (Supplementary Fig. 35). This suggested an optimal interaction between Fe, Zn, and MTX molecules within the electrode matrix. The molecular structure of MTX, specifically its aminopyrimidine and dicarboxylic moieties, played a key role in this recognition process. Further evaluations confirmed the reproducibility and stability of the electrode. Repeated tests showed consistent photocurrent responses, and long-term storage and use did not significantly affect the photocurrent response (Supplementary Fig. 36). The photoelectrode remained remarkably responsive and stable to MTX even after a continuous 30 h test cycle (Supplementary Fig. 37). These evaluations confirmed the admirable selectivity and pronounced photocurrent response to MTX molecules on Fe1-Zn1-TiO2 photoelectrode, making it a viable candidate for qualitative and quantitative analysis of MTX.

In order to practically apply in vivo PEC-TDM for MTX, a live mouse experiment was conducted to evaluate the performance of Fe1-Zn1-TiO2/Gel photoelectrodes within a living organism. As depicted in Fig. 4a, PEC-TDM system was comprised of a micro-photoelectrode, a micro-electrochemical workstation, a development board, a battery, and a micro-peristaltic pump. Upon near-infrared light irradiation, with Fe1-Zn1-TiO2/Gel micro-photoelectrode implanted into the tail vein of mice, a swift increase in the photocurrent signal was observed, which unequivocally demonstrated the excellent near-infrared light response characteristics of the Fe1-Zn1-TiO2/Gel electrode (Supplementary Fig. 38). This attribute not only ensured high sensitivity for in vivo detection but also facilitated real-time and precise monitoring of MTX fluctuations in vivo.

Fig. 4: In vivo PEC-TDM of MTX.
figure 4

a Schematic diagram of in vivo PEC-TDM of MTX molecules on Fe1-Zn1-TiO2/Gel; b in vivo PEC detection of blood concentration of MTX by intravenous, intramuscular, and oral administration (n = 3, under each dosing administration, the in vivo detection experiment was repeated three times); drug concentration monitoring in c TDM-ST group and in d TDM-RT group (the red line represents a fitting curve of drug concentration over time); e photos of tumor from tumor-bearing mice in different treatment groups after 14 days; f tumor growth curves over time of tumor-bearing mice in different treatment groups (n = 5, ***p < 0.001); g average tumor mass of tumor-bearing mice in different treatment groups (n = 5, ***p < 0.001); h H&E and tunel staining photos of tumor tissue in different treatment groups, the scale bar is 200 μm; i H&E staining images of Liver and Spleen tissue section after 14 days of continuous treatment in different treatment groups, the scale bar is 200 μm (n = 3, independent three samples with similar results).

Subsequently, varying concentrations of MTX were administered through the tail vein, and concomitant changes in the photocurrent signal were noted. An escalating concentration of MTX corresponded with a progressive decrease in the photocurrent signal (Supplementary Fig. 39), exhibiting a linear relationship within the 2–25 mg/kg range (Supplementary Fig. 40). These findings affirmed that the Fe1-Zn1-TiO2/Gel photoelectrode retained its capability for quantitative and qualitative analysis of MTX in vivo, enabling accurate reflection of MTX concentration variations within the organism, thereby fulfilling fundamental prerequisites for drug monitoring regimens. To elucidate the versatile in vivo detection ability of Fe1-Zn1-TiO2/Gel photoelectrode for different MTX administrations, intravenous injection, intramuscular injection, and oral medication were adopted and their corresponding drug concentration metabolic curves were recorded in Fig. 4b. After administering 10 mg/kg of MTX via mouse tail vein injection, the Fe1-Zn1-TiO2 photoelectrode rapidly detected a significant rise in blood concentration, peaking within 2 min. The photocurrent signal intensity gradually reverted to a baseline value equivalent to that of the blank after 67 min (Supplementary Fig. 41), signifying the complete metabolism of MTX in peripheral blood. This result was compared with the results of in vitro high-performance liquid chromatography (HPLC) analysis, and a highly similar conclusion was obtained (Supplementary Table 5). With an identical drug dosage administered intramuscularly, the MTX blood concentration peaked after 24 min; whereas, upon oral administration, the peak MTX concentration was attained after 35 min. These findings underscored that the Fe1-Zn1-TiO2 photoelectrode was not solely applicable for monitoring intravenous treatments but also possessed the capability to track drug metabolism post intramuscular and oral deliveries.

By employing a predefined concentration threshold, the PEC-TDM device could autonomously determine the timing for drug administration, thereby ensuring stabilization of the MTX blood concentration. To evaluate the practical application efficacy of the PEC-TDM device within a TDM treatment regimen, a group treatment experiments were conducted on 4T1 tumor-bearing mice. The experimental findings revealed that the Fe1-Zn1-TiO2/Gel photoelectrode can sensitively detect alterations in MTX concentration in mice, providing a dependable foundation for therapeutic interventions. In the control group, mice were treated exclusively with phosphate buffers (PBS) to observe the natural progression of the disease. The conventional treatment group (C-MTX) received a fixed dose of MTX (88 mg/kg) every 72 h46,47. Conversely, the TDM treatment group received automatic administrations when the MTX blood concentration fell below a preset threshold, as determined by real-time monitoring via the PEC-TDM device. Within the TDM treatment group, two subgroups were identified: the safe treatment group (TDM-ST) and the radical treatment group (TDM-RT). The TDM-ST group was initially administered a low dose of MTX (8.8 mg/kg) to mitigate the risk of drug toxicity. The I-T curve depicting drug concentration monitoring is shown in Fig. 4c. When the MTX blood concentration decreased below 4.4 mg/kg, the PEC-TDM device automatically triggered drug administration to ensure that the medication concentration remained within a safe therapeutic range (~6.4 mg/kg) (Supplementary Movie 1). The TDM-RT group was initiated with a higher initial concentration (19 mg/kg) in pursuit of enhanced therapeutic outcomes. As illustrated in Fig. 4d, upon the MTX blood concentration falling below 9.5 mg/kg, the PEC-TDM device activated an automatic dosing process to sustain the drug concentration at an elevated therapeutic level (about 14 mg/kg, corresponding molar equivalent concentration is shown in Supplementary Fig. 42). The outcomes from this group also underscored the precision of the PEC-TDM devices in controlling drug concentrations.

The anti-tumor therapeutic efficacy across various treatment groups was depicted in Fig. 4e. After a 14-day treatment period, the tumor volume in the control group exhibited a marked increase, reaching 13.57 times its initial size, thereby illustrating the rapid tumor growth trend in the absence of therapeutic intervention (Fig. 4f). Despite receiving an identical MTX dosage, the C-MTX group still experienced an increase in tumor volume to 8.64 times of its initial value, indicating that traditional chemotherapy did not yield optimal tumor inhibition outcomes. Conversely, the TDM-ST and TDM-RT groups demonstrated significant antitumor effects when personalized therapy was administered using PEC-TDM devices equipped with Fe1-Zn1-TiO2/Gel photoelectrodes. Tumor growth was substantially inhibited in both treatment groups, with inhibition rates of 89% and 92%, respectively. This outcome intuitively demonstrated that PEC-TDM device can effectively impede tumor progression. Moreover, the body weight of mice in each group remained largely unaffected throughout the entire treatment duration, suggesting that the treatment regimens of each group did not adversely impact the overall health of the mice (Fig. 4g). Histological evaluations through H&E and Tunel staining were conducted to assess alterations in tumor tissue across different treatment groups48,49. As shown in Fig. 4h, tumor tissue sections from the control group and the C-MTX group revealed tightly packed tumor cells, with no evident apoptosis or tumor cell inhibition observed. However, in the TDM-ST and TDM-RT treated groups, significant nucleolysis and extensive cellular spaces were noted, which are indicative of tumor cell apoptosis. Furthermore, Tunel staining results also corroborated the apoptosis of tumor cells in the TDM treatment groups. In the control and conventional treatment groups, virtually no green fluorescence (indicative of apoptotic cells) was observed, whereas blue fluorescence (representing all cells) was more prominent. Conversely, in the TDM-ST and TDM-RT treatment groups, pronounced green fluorescence was visible, signifying that a substantial number of tumor cells were undergoing apoptosis. Therefore, the PEC-TDM device exhibited notable efficacy in antitumor therapy. By facilitating real-time monitoring and adjustment of drug concentrations, the device enabled personalized and precise treatment that not only effectively inhibited tumor growth but also promoted tumor cell apoptosis.

To thoroughly evaluate potential toxic side effects across different treatment groups, internal organs of the mice from each group were examined and subjected to pathological assessments after a 14-day experimental period. As shown in Supplementary Fig. 43, observations from internal anatomy indicated no significant abnormalities in the appearance of organs (heart, liver, spleen, lung, and kidney) in the control group, C-MTX group, and TDM-ST treatment group, suggesting that the pharmaceutical interventions in these groups did not cause considerable damage to these organs’ appearance. Conversely, mice in the TDM-RT group exhibited enlarged spleens due to toxic damage induced by the elevated drug concentration. To validate this assumption, pathological examinations were conducted. As illustrated in Supplementary Fig. 44, no discernible pathological injuries were found in the organs of the control group, C-MTX group, and TDM-ST treatment group, confirming that the pharmaceutical interventions in these groups were relatively safe. However, pathological findings in the TDM-RT group revealed hepatocyte necrosis (arrow) and vacuolar degeneration, implying that high concentrations of MTX may exert toxic effects on the liver, leading to compromised liver function (Fig. 4i). Additionally, the spleen’s original structure was also disrupted, with a substantial abnormal proliferation of macrophages observed (circles in Fig. 4i). This might be due to the diminished metabolic function following liver damage, resulting in the failure to expedite the excretion of toxins and waste within the body, subsequently stimulating the abnormal proliferation of macrophages in the spleen, ultimately manifesting as splenomegaly and hyperfunction of the spleen. The aforementioned experimental results indicated that the PEC-TDM device exhibited commendable therapeutic efficacy and minimal toxic side effects on the 4T1 tumor model mice in the TDM-ST treatment group. In contrast, although the therapeutic effect was pronounced in the TDM-RT treatment group, the high concentration of MTX also led to conspicuous toxic damage, particularly affecting the liver and spleen. Therefore, in future clinical applications, it will be imperative to judiciously adjust the drug concentration and treatment plan according to patients’ specific conditions and the characteristics of drug metabolism, thereby ensuring therapeutic efficacy while minimizing the occurrence of toxic side effects.

In summary, a PEC-TDM system with Fe1-Zn1-TiO2 photoelectrode was successfully developed through a reverse design strategy for selective adsorption of MTX. An automatic PEC-TDM was constructed, achieving real-time MTX monitoring and maintaining stable blood drug concentration. In terms of live real-time monitoring, the system has a low detection limit and extremely fast response time (Supplementary Table 6). In 4T1 tumor model treatment, the device effectively inhibited tumor growth and avoided high-concentration toxicity, ensuring safety and efficacy. This work provided a new solution for individualized treatment differences and advances medical technology development. As research progresses and technological advancements continue, the customization of single atom-based biomolecular sensor electrodes is set to become a cornerstone of future medicine, offering tailored monitoring and treatment solutions that have the potential to significantly enhance patient care and outcomes on a global scale.

Methods

Chemicals and materials

Titanium wire (0.1 mm 99.6%) was purchased from Jinjia Metal, China. Ethylene glycol (EG), ammonia fluoride (NH4F), EG, potassium dihydrogen phosphate (KH2PO4), ferric trichloride (FeCl3), zinc sulfate (ZnSO4), Gly, magnesium sulfate (Mg2SO4), disodium hydrogen phosphate (Na2HPO4), MTX, glutamic acid (GA), N, N-methylene bisacrylamide, Glu, fluorescein isothiocyanate (FITC), Phenyl (2,4, 6-trimethyl benzoyl) lithium phosphate (LAP) salt, AA, N-hydroxyethyl acrylamide, N, N-diethyl-2-acrylamide and Bovine serum albumin (BSA) were purchased from Macklin Chemical and used as received. Sulfuric acid (95–98%) (H2SO4), kalium chloratum (KCl), and sodium chloride (NaCl) were supplied by Sinopharm Chemical Reagent Co., Ltd, China. Trichloracetic aldehyde was supplied by Sangon Biotech, Shanghai, China. All aqueous solutions were prepared using deionized (DI) water with a resistivity of 18.2 MΩ cm at 25 °C.

Preparation of TiO2 photoelectrode

TiO2 was prepared by a two-step anodizing method. Before anodizing, the Ti wire with a diameter of 100 μm was fused at a voltage of 60 V to obtain a pin-like Ti wire, and then the Ti wire was polished in turn with sandpaper of different sizes until smooth. The Ti wire was then subjected to a sequential ultrasonic cleaning process to remove oils and contaminants. This involved immersing the wire in acetone, followed by ethanol, and finally in DI water to ensure it was thoroughly cleaned and oil-free. The treated Ti wire was dried in a pure N2 stream to further remove residual moisture and impurities from the surface. Then, a traditional two-electrode system was used for anodizing with Ti wire as anode and Pt foil as cathode. In this process, the electrolyte solution of EG consisting of 0.32 wt% NH4F and 2.7 vol% water was used to ensure smooth anodizing. In order to control the reaction rate and ensure the orderly growth of the nanotubes, all anodizing processes were carried out at ice bath temperatures. In the anodizing process, the nanotube layer was initially formed by anodizing at 60 V for 0.5 h. Subsequently, by ultrasonic treatment in DI water, the surface-growing nanotube layer was effectively removed, preparing for the second step of anodizing. After drying, the Ti wire was anodized again, at which time the voltage was reduced to 30 V for 0.5 h. This step aimed to further form a stable and ordered TiO2 nanotube structure. Finally, the prepared TiO2 photoelectrode was cleaned with DI water and dried with N2 to obtain the final sample.

Fabrication of Fe1-Zn1-TiO2

The Fe/Zn precursor solution was prepared by adding 20 mM FeCl3 and 20 mM ZnSO4 to 0.5 M dilute sulfuric acid solution as solvent. Subsequently, the previously prepared TiO2 electrode was immersed in the Fe/Zn precursor solution to ensure that the electrode was in full contact with the solution, and this state was maintained for about 1 h. The purpose of this step was to allow the Fe/Zn precursor solution to fully penetrate into the nanotube structure of TiO2 in preparation for the subsequent electrochemical reduction process. Prior to electrochemical reduction, the Pt foil was set as the working electrode and the Ti wire as the opposing electrode, and the TiO2 electrode dipped in Fe/Zn precursor solution was fixed between the two electrodes. The mixture containing the Fe/Zn precursor solution and TiO2 NTPCs was then immersed in liquid nitrogen as a whole so that it reached the frozen state in a very short time, which lasted about 5 min. The rapid cooling effect of liquid nitrogen not only fixed the ion state in the solution, but also ensured that the structure of TiO2 would not be damaged during the subsequent electrochemical reduction process. After freezing was complete, the mixture was slowly electrochemical reduced at a potential of −10 V. In this process, Fe and Zn ions accept electrons on the surface of TiO2, gradually reduce to Fe and Zn single atoms, and uniformly deposit on TiO2. The reduced frozen electrolyte was thawed at room temperature, and the prepared Fe1-Zn1-TiO2 photoelectrode was taken out and washed with DI water, and then dried with N2 for use.

Fabrication of Fe1-Zn1-TiO2/Gel

The antifouling layer of Fe1-Zn1-TiO2 was constructed by using mixed acrylamide hydrogel reported in the literature50,51. The specific construction method was as follows: First, N, N-diethyl-2-acrylamide, and n-hydroxyethyl acrylamide are mixed at a mass ratio of 1:1 as monomers for preparing hydrogels. Then, 1% phenyl (2,4,6-trimethylbenzoyl) LAP was added to the diluted mixed polyacrylamide solution as a photoinitiator and 1% N, N-methylene bisacrylamide as a crosslinking agent. The desired hydrogel precursor solution was obtained by fully mixing and dissolving. The photoelectrode was soaked into the polyacrylamide hydrogel precursor solution for 10 min, and then illuminated under 365 nm ultraviolet lamp for 5 min to form the polyacrylamide hydrogel anti-stain layer.

PEC detection of MTX by Fe1-Zn1-TiO2

The PEC characteristics of Fe1-Zn1-TiO2 were evaluated by using Fe1-Zn1-TiO2, Ag/AgCl, and Pt foil as working electrode, reference electrode, and counter electrode respectively. A 0.1 M PBS solution with pH of 7.4 was used to simulate the environment in living organisms. The transient photocurrent response of Fe1-Zn1-TiO2 under chopper light was measured in order to observe rapid changes in the photocurrent. The wavelength of the light source used for the test is ≥800 nm, that is, the infrared light region. In addition, in order to study the repeatability and long-term stability of Fe1-Zn1-TiO2/Gel, a 10-day intermittent test method was used. During each cycle, the photocurrent response of Fe1-Zn1-TiO2/Gel under the same conditions was tested and the relevant data was recorded.

In vivo PEC detection

All procedures involving animals were conducted with the approval of the Animal Ethics Committee at East China Normal University, China. The male BALB/c mice were anesthetized using chloral hydrate. Meanwhile, the BALB/c mouse was wrapped in a heating pad to maintain the body temperature at 37 °C. As shown in Supplementary Fig. 45, the prepared sensing electrode was implanted into the tail vein of mice using a two-electrode system. Pt filament with a length of 4 cm and a diameter of 100 μm was used for the electrode. The transient photocurrent response was evaluated under chopped light irradiation (light on/off cycles: 20 s) at 0 V potential. The photocurrent is measured under infrared light with a wavelength ≥800 nm and 380 mW, and the electrode can maintain a stable photocurrent under the irradiation of this light source (Supplementary Fig. 46).

Construction of PEC-TDM device

The photocurrent is acquired by the micro-electrochemical workstation, and the data is transmitted through the Bluetooth protocol. Then, the motor of the micro-peristaltic pump was driven by a switch which is controlled by the embedded MCU in the Bluetooth chip. One end of the peristaltic pump was connected to the MTX agent, and the other end was connected to the tail vein of the mouse through the injection needle. The onboard LED light source was fixed on the tail of the mouse by tape, and threshold detection and closed-loop control programs were deployed in the microcontroller to realize closed-loop drug delivery. The system maintains the drug concentration within a preset appropriate range by means of a peristaltic pump, and the entire system weighs 7.54 g (Supplementary Fig. 47).

Cell culture and establishment of tumor model mice

Mouse 4T1 breast cancer cells were cultured in DMEM medium containing 10% FBS, 50 U/mL penicillin, and 50 mg/mL−1 streptomycin, and incubated in a 5% CO2 incubator at 37 °C. BALB/c mice were flanked without hair and fed at 25 °C and 55% humidity, with free access to standard laboratory water and food. Tumor-bearing mice were obtained by subcutaneously injecting about 106 4T1 cells into the flanks of mice.

In vivo testing for tumor treatment

A tumor model mouse was successfully constructed 1 week after 4T1 cell injection, and then the mice were randomly placed in four cages (n = 5 mice/group), the first group was PBS group (injected 90 μL 0.01 M PBS every 72 h), and the second group was conventional treatment group (C-MTX, injected 1.76 mg MTX every 72 h). The third group was the drug monitoring safety treatment group (TDM-ST). The PEC-TDM device was fixed on the mouse, Fe1-Zn1-TiO2/Gel was used as the working electrode, Pt filament was used as the reverse electrode to connect the micro-electrochemical workstation, and the mouse venule was implanted. The photocurrent value was detected under near-infrared light irradiation. For the first injection of 0.176 mg MTX, the detection threshold was set as the current value when the MTX metabolism reached half of the concentration. When the current exceeded the threshold, the device started the peristaltic pump to inject 0.176 mg MTX, and administered ten times every 72 h to maintain a safe and effective blood concentration of MTX. The fourth group was the drug monitoring radical therapy group (TDM-RT), that is, PEC-TDM device was used to achieve automatic treatment, 0.38 mg MTX was injected for the first time, and the current value when the detection current threshold was 0.19 mg was set, and the drug was administered 10 times every 72 h, so as to maintain high blood concentration of MTX for treatment. Fractional body weight and tumor volume were recorded in each group after each administration, and tumor volume was calculated as length × width × width/2.

Histological analysis

After 14 days of treatment, mice in each group were euthanized, tumor tissues of mice in each group were collected, and fixed with 4% paraformaldehyde solution. The tumor tissue is then dehydrated, waxed, and sectioned for H&E and Tunel staining. In order to further evaluate the possible toxic side effects of different treatment groups during treatment, the internal anatomy of mice in each group was observed, and the changes of tissues and organs (heart, liver, spleen, lung, kidney) in each group were observed. The rest of the tissues and organs were fixed in formaldehyde solution, paraffin sections were made, H&E staining was performed for histopathological examination.

DFT calculation

All the calculations were carried out based on DFT implemented in DS-PAW software. The electron-ion interactions were described by the projector augmented wave (PAW) method and the exchange-correlation energy was described within Perdew–Burke–Ernzerhof functional in the generalized gradient approximation. To avoid the interaction between two layers, a 15 Å vacuum layer was added at the top of surface. Only the top layer was relaxed during the optimization, and the bottom layer was fixed as the bulk layer. The surface optimization was done with an energy cutoff of 400 eV with a k-mesh of 3 × 3 × 1, and an energy and force convergence of 1 × 10−5 eV and 0.02 eV/Å respectively. Van der Waals interaction was taken into account at the DFT-D3 level as proposed by Grimme. The adsorption of molecules on the surfaces was computed under the same setting as mentioned before in the optimization of the bare surfaces. The adsorption energy of the molecules on the surfaces were calculated as:

$${E}_{{{{\rm{abs}}}}}={E}_{{{{\rm{molecule@alab}}}}}-{E}_{{{{\rm{slab}}}}}-{E}_{{{{\rm{molecule}}}}}$$
(1)

Atomic charges were calculated from electronic structure by Bader charge analysis. Differential charges were used to study the electron transfer.

Statistical analysis

All data analyses were performed in Origin 8.5 and statistical significance was defined as a two-tailed P value of less than 0.05 by t-test as description in comparison of two groups.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.