Introduction

Piped drinking water distribution systems (DWDS) supply potable water for over half of the global population, approximately 5.3 billion people in 20171,2. Most systems in well-resourced settings operate on a continuous basis, with continuous water supply (CWS) through pressurized, mainly underground, pipes. However, more than one billion people worldwide access drinking water via intermittent water supply (IWS) services, with additional public health risks, such as diarrheal infections3. In IWS, the distribution network experiences stagnation periods when the pipes are depressurized and left to drain4. This practice can promote conditions for (i) ingression of contaminants from the groundwater through compromised pipe walls and/or pressure differentials between the pipe and the surrounding soil5 and (ii) biofilm growth during non-supply period with subsequent detachment when flow resumes. Such biofilms consist of microbes embedded in extracellular polymeric substances and form at interfaces6 such as pipe walls7 and may contain enteric pathogens, such as human viruses and parasitic protozoa8,9. They can harbor opportunistic pathogens or bacteria capable of microbially-influenced corrosion, leading to discoloration of the water as well as foul odor. When water supply is reactivated, the biofilms and other contaminants detach due to the change in hydraulic regime during initial supply and re-pressurization of the pipes and transfer into the bulk water phase5. This may affect the biological stability of drinking water, defined as a minimal change in microbial characteristics from the point of production up to the point of consumption, including cell abundance and viability and the composition of microbial communities10.

In regions like the Caribbean and Latin America, up to 60% of the population receiving piped water is currently serviced intermittently. This mode of provision is also common in regions of the global south, particularly in South (East-) Asia11,12, China13 and Sub-Sahara Africa14. While governments and stakeholders such as the WHO and UNICEF call for the conversion of IWS to continuous systems to reduce the health risks associated with unsafe water15, the hydraulic and microbial processes that lead to water quality degradation in IWS services are seldom investigated.

Differences in hydraulic conditions between stagnation and turbulent pipe flow (“fast-flow”) during water supply periods are known to stress pipe materials and pipe joints, potentially allowing cross-contamination of the water with soil and fecal microorganisms4,16. In addition, biofilms that form on pipe surfaces due to physical, chemical, and biological processes can lead to elevated decay rates for residual chemical disinfectants such as chlorine or chloramine, depending upon their microbial community composition17,18. This is particularly relevant under the hot and humid conditions prevalent in Singapore. Free chlorine has been a commonly used residual by water utilities due to its rapid rate of disinfection (with short contact time and low dosage required)19,20. Since the early 20th century, chloramine has been a preferred secondary disinfectant to chlorination in some countries to prevent microbial growth in DWDS and protect water quality from source to tap because it is easier to maintain a free disinfectant residual, and monochloramine is better at penetrating biofilms and less prone to forming regulated disinfection byproducts and causing taste or odor issues21,22. However, the use of monochloramine in DWDS favors nitrifiers, which tend to grow in biofilms21. While the continuous water flow in CWS systems suppresses microbial colonization of pipe walls to some extent, biofilms are nonetheless endemic in all engineered water distribution systems9 and more than 95% of the overall biomass is known to be attached to the pipe walls in a given pipe section. 23. This has been further illustrated with the use of flow cytometry (FCM)24,25.

Filling and draining occurs during system maintenance due to planned or unplanned interventions in the case of CWS and as part of normal operations in the case of IWS. When there is a planned preventative or reactive maintenance being conducted in the DWDS, there are necessary corrective actions that utilities take after flow interruption or diversion26. This includes unidirectional flushing, chlorination, and monitoring turbidity and free chlorine before flow is returned to customers19. It has been reported that flushing alone was effective in removing microorganisms from the water but not in removing biofilms based on a pilot-loop DWDS with PVC pipes, and shock chlorination was recommended19. In full-scale intermittent water supply systems, monitoring of biofilm detachment is rarely reported, and hence information about the time needed to detach biofilms before restoring water to the customer is not available.

To date, there are only a few pilot-scale studies on the impact of biofilm detachment on microbial water quality in either CWS19,27 or IWS28. In an unreplicated study, Preciado et al. (2021)28 used high density polyethylene (HDPE) pipes with an internal diameter of 79.3 mm and a length of 21.4 m and water recycling while simulating interruptions in CWS with various stagnation times (6 h, 2 days, and 6 days) before gradually returning flow to normal operation. This created temporary (one-time) intermittency scenarios under controlled conditions. In their study, the relative abundance of potential bacterial pathogens, such as Mycobacterium and Sphingomonas, and potential fungal pathogens, Penicillium and Cladosporium, in biofilm samples increased during longer non-supply periods based on metabarcoding of the 16S rRNA gene and ITS 1–2 region, respectively. However, under routine IWS operation in full-scale DWDS systems, the biological stability of drinking water is rarely explored. More research is needed to understand the biological stability in IWS networks with low levels of disinfectant due to stagnation or low usage.

Advancements in microbial assessment techniques are transforming our understanding of drinking water quality. Standard microbial drinking water quality assessments rely on culture-dependent methods, such as heterotrophic plate counts, which are typically based on samples collected in premise plumbing systems and fire hydrant systems. Utilities have also installed water monitoring stations at reservoirs providing long-term time series of water quality to meet guidelines29,30. Additionally, genome sequencing provides in-depth insights into the composition and factors shaping drinking water communities31. Robust flow cytometry (FCM) has extended the ability of utilities to conduct remote and near real-time monitoring of total and intact cell counts at strategic points throughout the DWDS32. In addition to direct cell concentration measurements, phenotypic fingerprinting based on FCM has been well documented for measuring microbial community changes in drinking water studies32,33. This is because FCM allows for the construction of phenotypic fingerprints, which enable the evaluation of the phenotypic microbial community change and the estimation of its diversity33. Recently, fingerprinting has also been applied to online FCM data to assess longitudinal changes in the microbial community dynamics of bulk water samples32,34, an advancement that could allow for close to real time assessment of drinking water quality, e.g., after pipe repairs. While measurement of turbidity and flushing volumes is commonly used by utilities, these parameters do not capture the effect of biofilms on microbial water quality. Here, we propose an FCM-derived, fast and sensitive biofilm detachment potential (BDP) index as a proof-of-concept. To our knowledge, no study of microbial community changes with time is available for comparing the distribution modes of both CWS and IWS using the same source water in the literature.

This paper investigates and compares how biofilm growth and detachment affect water quality under IWS and CWS operating conditions. The objectives of the present study are (i) to compare directly the microbial and physicochemical quality of bulk water under both IWS and CWS supply conditions in a simulated pilot-scale distribution system with residual monochloramine present; (ii) to assess the effect of flow regime on the detachment of biofilm from pipe walls; (iii) to validate the efficacy of cost-effective FCM fingerprinting to detect deviations in drinking water quality; and (iv) to refine a model that links microbial community changes to environmental parameters collected from the distribution network, hence, to develop effective strategies to minimize the potential risks for customers of IWS.

Results

An above-ground testbed (pipe rigs) was constructed on the Nanyang Technological University campus (Fig. 1) and isolated from the actual distribution network (see Materials and Methods). The CWS section was primed under conditions of laminar flow, and the IWS section was subjected to 23.8 h of stagnation followed by a 12-min supply window on a daily cycle. Priming for CWS and IWS continued for one month prior to each round of testing.

Fig. 1
figure 1

Above-ground drinking water testbed used to simulate continuous and intermittent drinking water supply. (A) Photograph of testbed setup including a 270-m-long pipe and storage tank (shown on the left). The direction of flow and division of pipe segments for intermittent (IWS) and continuous (CWS) operation is shown using orange and black arrows, respectively. (B) Schematic overview of the division of flow for IWS and CWS scenarios. Parallel 90-meter pipe segments were run continuously (CWS) or intermittently (IWS) and fed with water from the storage tank. Pipe outlets (IWSfast and CWSfast) and sampling taps (CWSslow) allowed for the release of bulk water with the pre-determined flow rate during the three replicate experiments. The CWS was flushed with flow rates comparable to both IWS and utility recommended speeds after each of the 3 replicate samples simulated conditions found in operational systems after pipe maintenance. The testbed is isolated from the university DWDS but is fed by inflowing water from its mains via the storage tank. Sampling points are located at the outlets of Pipe 6 for IWSfast and Pipe 1 for CWSslow/CWSfast.

The study simulated regular daily interrupted service, named IWSfast, with 23.8 h of non-supply followed by 12 min of drinking water supply under fast flow for a duration of 30 d; this experiment was repeated three times. Uninterrupted supply, CWSslow, was simulated in a separate section of the testbed, over the same length of pipe rigs and using the same water source. Once a month, we also simulated typical flushing action, CWSfast, after interrupted supply due to maintenance or repair works in these latter pipes by providing the same source water under fast flow (10 times the average flow, CWSslow) for 12 min; this experiment was also repeated three times. We investigated water quality by assessing features of microbial communities over time. This involved comparing inlet and outlet bulk water conditions over three repeated sets of experiments performed on separate 90-m-long uPVC pipe sections for IWS and CWS in an above-ground testbed exposed to water containing low levels of the residual chemical disinfectant monochloramine. Table S1 provides a full list of tested variables.

Monochloramine levels in IWS outflow bulk water were significantly lower than in CWS

Concentrations of the residual chemical disinfectant monochloramine in the inflowing water (Tap and Tank, see Fig. 2) ranged from 0.4 to 0.8 mg/L, reflecting DWDS sections near customer delivery points. This level was close to the guideline of ≥ 0.5 mg/l proposed by the WHO (2003)35 and required by PUB (Singapore’s National Water Agency) for potable water. During steady, laminar flow in the CWS pipe section (CWSslow, Fig. 2A, D and G), monochloramine levels decreased with distance from the source (Outlet #0) to the Outlets #3 and #1. However, it remained stable at the specific sampling location throughout the three experimental repeats, each conducted over a one-month period for a duration of 266 min. When the same pipe section was flushed in unsteady, turbulent conditions (CWSfast in Fig. 2B, E and H) associated with a surge in the flowrate (Table 1), monochloramine levels in the outflow (Outlet #1) showed an increasing trend during the sampling time (0.2–0.4 mg/L), close to the inflow source, Tank and Outlet #0 (0.35–0.5 mg/L), but higher than that under CWSslow, likely due to the shorter water age. In contrast, during initial supply of the IWS section, monochloramine was below the limit of detection for the first 20 s in all three test repeats for IWSfast (Fig. 2C, F and I), which was followed by an increase to 0.2–0.4 mg/L in the remainder of the samples (i.e., comparable to the baseline CWSslow conditions).

Fig. 2
figure 2

Monochloramine and temperature measurements for the sampling points (CWSslow), and times (CWSfast and IWSfast). Monochloramine (green diamond) and temperature (grey rectangle) showed similarly reproducible trends within each experimental condition and the repeated samplings (30–33 days apart). Lower monochloramine in the earlier collection indicates a decay of the residual disinfectant within the IWS in-between provision cycles. Error bars indicate standard deviations and measurement was done in biological triplicates (n = 3) for each time point and parameter. Error bars may be contained in the symbol.

Table 1 Hydraulic conditions for the three experimental setups investigated. Experiments were repeated three times on different days.

Higher biofilm detachment potential (BDP) under IWS than CWS

BDP is a unitless parameter (log value) to describe the net contribution of biofilm cells to bulk water cell concentrations after detachment, as defined in Eq. 1 in Materials and Methods. The BDP measurements at Outlets #1 and #3 under CWSslow for the steady laminar flow conditions (Fig. 3A, D and G) were close to 0 for both total and intact cell concentrations for the three sets of experiments, implying negligible detachment of biofilm. In contrast, turbulent flow conditions for both pipe sections (CWSfast, Fig. 3B, E and H) and IWSfast (Fig. 3C, F, and I) resulted in a significant but transient increase in BDP in the initial supply or within the first 60 s. For the CWSfast runs, total and intact cell concentrations increased by up to one order of magnitude (i.e., BDP ≤ 1) and typically maintained values above the baseline throughout the sampling window of 12 min (higher values persisted for ~ 720 s in the third test; Fig. 3H). Higher variations of BDP were seen for the three IWSfast runs than for CWSfast. A higher BDP (1.0–1.5) occurred during initial supply (30–40 s) of the IWS section in the repeated three tests. The number of intact and total bacteria released from the biofilm into the distributed water was about 5 to 40 times higher in IWS pipes than in CWS pipes during the first 60 s.

Fig. 3
figure 3

Ratio of outflow to inflow concentrations of total and intact microbial cells in the three experimental setups, each repeated three times at monthly intervals. The y axis refers to log10 (Cells Outflow/Cells Inflow), defined as the logarithmic ratio of outflow to inflow biomass as calculated from flow cytometry results and flowrate measurements. Flow cytometry measurements involve biological and technical triplicates for each time point. Green diamonds and blue circles represent intact and total cell concentration, respectively. Error bars indicate standard deviations. (A,D,G) Refers to the three monthly repeats of experiment, laminar flow conditions on pipes 3, 2 and 1 connected in series, CWSslow sampled at locations outlet 3 and outlet 1, respectively every 38 min; (B,E,H) refers to the three monthly repeats of experiment under fast flow conditions, CWSfast performed on pipes 3, 2 and 1 connected in series but sampled from outlet 1 only; (C,F,I) refers to the three monthly repeats of experiment under fast flow conditions, IWSfast performed on pipes 4, 5 and 6 connected in series but sampled from outlet 6 only.

Higher microbial diversity in CWSfast than IWSfast

Two approaches, sequencing and FCM fingerprinting, were applied to compare the alpha diversity between CWS and IWS systems. The pipe biofilms were sequenced too for both systems. Almost half of the amplicon sequence variants (ASVs) measured in the inflow bulk water (430 of 1047) are also found in outflow samples for all three hydraulic conditions (Fig. 4A). A total of 629 ASVs were measured from outflows under steady laminar flow (CWSslow) conditions compared to 719 for CWSfast and 916 for IWSfast. In contrast, second order Hill numbers (2D; Fig. 4B) show a similar alpha-diversity for CWSslow and IWSfast systems (inverse Simpson index, 2D = 10.0 ± 3.4 and 10.1 ± 3.2, respectively). The alpha-diversity in CWSfast samples is significantly higher (2D = 16.2 ± 6.4), suggesting that detached biofilm (once per month) had a greater influence on alpha-diversity in the CWS pipe section than in the IWS section (once per day). The lowest diversity was measured in inflow samples (2D = 8.7 ± 2.9) as well as pipe biofilms in the CWS section (2D = 5.0 ± 2.6) and IWS section (2D = 4.9 ± 2.8).

Fig. 4
figure 4

Microbial alpha diversity in all three water flow scenarios and the inflow. (A) Venn diagram showing the number of ASVs (that is, richness) for inflow (1047), CWSslow (629), CWSfast (719), and IWSfast (916). Second order hill number2D) from (B) 16 S rRNA gene metabarcoding, and (C) flow cytometry fingerprinting data. The box bounds the interquartile range (25th and 75th) divided by the median, and Tukey-style whiskers extend to a maximum of 1.5 times the IQR beyond the box. Asterisks (** and ****) indicate significance (p ≤ 0.0001) in terms of p-values of Games-Howell post hoc grouping.

Phenotypic alpha-diversity using the FCM fingerprinting analyses shows the same trend as genotypic alpha-diversity (Fig. 4C). The phenotypic alpha diversity for CWSfast, 2D = 3,535 ± 640, was also significantly higher compared to the inflow (2D = 2,850 ± 400) and the outflow under CWSslow (3,063 ± 450) and IWSfast (2,825 ± 574) conditions.

Microbial communities affected by hydraulic conditions

Based on 16S rRNA gene metabarcoding analysis, the predominant bacterial taxa in bulk water samples in the testbed (inflow vs. outflows under three hydraulic regimes) during the sampling period include (i) Sphingomonas hankyongensis (average relative abundance of 10.1% in inflow, 7.1% in CWSslow, 4.4% in CWSfast, and 5.5% in IWSfast) which is commonly isolated in tap water worldwide; (ii) the genus Mycobacterium (24.6%, 18.3%, 12.1%, and 19.4%, respectively), (iii) the genus Nitrospira (11.7%, 20.9%, 15.7%, and 10.8%), (iv) the genus Nitrosomonas (7.0%, 5.3%, 3.2%, and 4.7%), (v) the thermotolerant genus Amphiplicatus (7.5%, 2.9%, 1.9%, and 3.9%), (vi) the genus Blastomonas (2.9%, 2.1, 1.4, and 7.6%), (vii) the genus Hyphomicrobium (3.3%, 3.9%, 2.7%, and 1.7%) and (viii) the genus Phreatobacter (3.9%, 3.2%, 1.7%, 1.3%) (see Fig. 5). One exception is Nitrospira moscoviensis (a nitrite oxidizing bacterium, NOB), which was enriched in IWSfast (3.9%) compared to the inflow water (0.1%), CWSslow (0.2%), and CWSfast (0.6%).

Fig. 5
figure 5

Community structure considering the twenty most abundant bacterial genera (family rank also included) in the three repeats (1–3) of the inflow, CWSslow, as well as the initial 60 s and the remaining 660 s of CWSfast and IWSfast groups. Sample size (n) was 11, 9, 14, 6, 6, 4, 7, 6, 6, 8, 7, 7, 7, 7, 7, 7, 7, 8 on each column from left to right (i.e., there were 34 inflow samples and 100 samples from outflow group, respectively, including 16 samples for CWSslow, 41 samples from CWSfast, and 43 samples from IWSfast).

Most bacterial species in bulk water samples collected from both IWS and CWS during early fast flow (t ≤ 60 s) differed from those in samples collected at a later stage (t = 61–720 s), implying that biofilm detachment was responsible for observed increases in alpha-diversity in the IWS and CWS pipe sections.

Comparison of Bray–Curtis dissimilarities in CWS and IWS using 16 S rRNA gene metabarcoding (BCMBC) and flow cytometric fingerprinting (BCFP)

We calculated average Bray-Curtis dissimilarity indices based on 16S rRNA gene metabarcoding (BCMBC) and FCM fingerprinting (BCFP) of outflow samples in CWS and IWS as compared with inflowing water in three repeats for each of the three hydraulic regimes, CWSslow, CWSfast and IWSfast. This index serves as an indicator of biological stability, where stability increases with decreasing Bray-Curtis dissimilarity. An analysis of the microbial community structures (beta-diversity) of inflowing water samples during three experimental repeats reveals no significant differences, as visualized by a PCoA plot (Fig. S1). Therefore, results from the three repeats for each hydraulic regime can reasonably be analyzed and plotted together to understand how the supply modes will impact the outflow bacterial community using the same source water (Fig. 6, S2 and S3). To identify outflowing water samples that deviated from inflowing water, two means are presented in the last section (Fig. 7).

Fig. 6
figure 6

Bray-Curtis dissimilarity indices in bulk water samples collected from CWSslow, CWSfast and IWSfast, compared to the inflowing water from (A) 16S rRNA metabarcoding (i.e., Sequencing) and (B) flow cytometric fingerprinting. Decreasing dissimilarity over time (after an initial peak) indicates reduced microbial communities and detached biofilms during the turbulent supply of both IWS and CWS and that the microbial water quality resembles that of laminar CWSslow after 60–80 s. Dots represent replicate samples taken during IWSfast, CWSfast and CWSslow with whiskers indicating the standard deviation between replicates analysis. Shaded areas (grey, red, and blue) indicate the 95% confidence interval of the model.

Fig. 7
figure 7

Deviating events calculated using (A) 16S rRNA metabarcoding data at the ASV level and (B) flow cytometry fingerprinting data collected from the same samples. Note: CWSslow, CWSfast and IWSfast refer to bulk water collected outlets samples and numbers 1, 2, and 3 denote the repetition of the experiment. All the samples were arranged in sequence of the sampling time of each experiment. The y-axis contains values of the difference of the Bray-Curtis dissimilarity of the outlet samples from the threshold, and only positive values indicating deviating events are shown. A threshold is set using the average of inflow Bray-Curtis dissimilarity plus 3 times the standard deviation, following the approach of Favere et al.32. The Bray-Curtis dissimilarity that was assigned to a sample was calculated as the average of the Bray-Curtis dissimilarities between that sample and the inflow water samples of the same date.

Generalized linear mixed-effect model (GLMM) of microbial community changes

GLMM analysis revealed the association between the Bray-Curtis dissimilarity indices, BCMBC and BCFP of outflow bulk water and variables with a significant effect on the Bray-Curtis indices. The Bray-Curtis dissimilarity in the outflowing water for both metabarcoding and fingerprinting approaches was found to be a function of time, experiment and total cell concentration (data not shown) in each experiment, CWSslow, CWSfast and IWSfast. The change of BCMBC and BCFP with time is shown in Fig. 6A and B, respectively. Initial supply significantly elevated the Bray-Curtis dissimilarity of the bulk water community, and hence reduced biological stability, and this was due to detachment of biomass from the pipe walls for both CWSfast and IWSfast experiments (Fig. 6A). However, the dissimilarity decreased over time with an average decrease of 23.0% and 51.1% from 1 s to 60 s and 1 s to 720 s, respectively (p < 0.001) for CWSfast, and 26.3% and 62.7% from 1 s to 60 s and 1 s to 720 s, respectively (p < 0.001) for IWSfast but converged to conditions measured for laminar flow within a period of 7–10 min (corresponding to replacement of a full volume of water within each 90-m pipe section). The FCM fingerprinting analyses also show dissimilarity reducing with time for both CWSfast and IWSfast (Fig. 6B), and the changes in dissimilarity with time were smaller compared to metabarcoding. However, there is a positive Spearman correlation of BCMBC and BCFP during the first 60 s (Fig. S3, p < 0.001), suggesting that FCM fingerprinting can be a reasonable representation of sequencing-based information in terms of routine monitoring of community changes. Unlike the fast flow conditions in IWS and CWS systems, there is no significant change in bulk water community between different outlets in the CWSslow experiment regardless of whether genotypic or phenotypic approaches were used.

Identification of deviating events in CWS and IWS based on 16 S rRNA gene metabarcoding (BCMBC) and flow cytometric fingerprinting (BCFP)

To evaluate biological stability across three flow conditions over time, Bray-Curtis indices were analyzed in three repeat experiments, where biological stability decreases with increasing deviating events. Deviating events were defined when the outflow water had a Bray-Curtis dissimilarity exceeding the threshold defined in Eq. 2 (see Materials and Methods). Figure 7 highlights that most detected deviating events occurred under fast flow regimes. Notably, flow cytometric fingerprinting (Fig. 7B) showed consistent results in two out of three repeats, aligning with 16S rRNA gene metabarcoding findings (three out of three repeats, Fig. 7A) for both CWSfast and IWSfast conditions. These findings indicate that significant biofilm detachment events can alter the bulk water community. Specifically, a trend was observed for the BCMBC in IWSfast, where the first seven samples taken (t = 1–60 s) frequently exceeded the threshold in the first repeat experiment (Fig. 7A), and this was similarly observed in CWSfast during the initial unsteady transition to turbulent flow (Fig. 7B), releasing about 0.1 m3 of water.

In contrast, under the CWSslow flow regime, where minimal detachment was expected in all three repeats, 16S rRNA gene metabarcoding detected some deviating events in one out of three repeats (Fig. 7A), while flow cytometric fingerprinting (BCFP) detected nearly none (Fig. 7B), suggesting that metabarcoding may be overly sensitive. In short, the FCM fingerprinting approach (Fig. 7B) gave comparable results to the metabarcoding approach (Fig. 7A) in the detection of deviating events.

The presence of nitrifiers in biofilm swabs indicates favorable growing conditions for nitrifiers in CWS

To investigate the effect of monochloramine on nitrifiers in biofilms and the bulk water, the relative abundances of AOB, AOA and NOB in biofilms under different flow conditions were compared based on swab samples obtained before and after the 100-day experimental period using beta-regression model. There was a significant increase in the mean relative abundance of both AOB and NOB in the CWS and IWS pipe sections, but the increase was greater in the CWS section (Fig. 8). On average, over a 100-day period, the mean relative abundance of nitrifiers (AOB and NOB) in the biofilm communities subjected to continuous water supply (BiofilmCWS) is 33.3 times higher than in the biofilm control communities before the start of the experiment (Biofilmbefore) (p < 0.001). During the same period, the mean relative abundance of AOB and NOB in the biofilm communities subjected to intermittent water supply (BiofilmIWS) is 9.08 times higher than in the Biofilmbefore (p < 0.001). For BiofilmCWS, the mean relative abundance of AOB and NOB is 3.67 times higher than in BiofilmIWS (p = 0.005; see Fig. 8). This biofilm disruption in IWS is illustrated by an increase in total and intact cell concentrations observed during the initial supply of the IWS and CWS sections (Fig. 3), as represented by the increase in biofilm detachment potential. Therefore, the frequent biofilm disruption in the IWS section likely resulted in repeated colonization of nitrifiers in biofilms, unlike the growth of nitrifiers in biofilms in the CWS section. Candidatus Nitrosotenuis, which is known to oxidize ammonia to nitrite36, was the dominant AOA in the outflow. Figures S4 and S5 further depict the relative abundances of AOA, AOB and NOB in the bulk water samples, and nitrogen species measured in the three sets of supply experiments, respectively. These data show significant transient changes in the abundances of AOB and NOB and the concentrations of NH3-N and NO3-N, particularly in the IWSfast experiments, but minimal net changes from CWSslow conditions after supply for ~ 12 min. The elevated NO3-N concentrations along with reduced NH3-N and NO2-N concentrations, along with elevated abundances of AOB and NOB, strongly suggest the occurrence of nitrification in the system.

Fig. 8
figure 8

Pairwise comparisons of relative abundance of ammonia oxidizing (AOB, red) and nitrite oxidizing bacteria (NOB, green) in three groups of biofilm samples (equivalent to 10 cm2 of pipe surface) obtained before and after the start of the 100-day study period. The average relative abundance of AOB or NOB for these three groups ranged from 0.1–4%. The analysis relies on data that underwent a natural logarithm transformation prior to conducting beta regression. The significance test is derived using the estimated marginal means after beta regression analysis with a log link function. The p-values were adjusted using the Benjamini–Hochberg method to account for multiple comparisons. The symbols ** and **** indicate statistical significance, representing p ≤ 0.01 and p ≤ 0.0001, respectively.

Microbial communities were stable in CWS and IWS scenarios during the 100-day study

PCoA analysis of outflow water data based on both 16 S rRNA gene metabarcoding and FCM fingerprinting analyses show differences among the bacterial communities sampled from CWSslow, CWSfast, and IWSfast (Fig. 9). This was confirmed by a PERMANOVA test of Bray-Curtis dissimilarity indices (p < 0.001). The microbial community in IWSfast was more heterogenous than communities obtained from both CWSfast and CWSslow, which in turn was most likely due to the comparably higher Bray-Curtis dissimilarity indices in IWS. Comparing microbial communities in the inflowing water throughout the experimental phase to the water supplied by the university’s distribution network revealed limited variability in community composition, which further strengthens the conclusion that the supply cycles are the main ecological driver.

Fig. 9
figure 9

Community structure differences between CWSslow (blue circles), CWSfast (red triangles), and IWSfast (black asterisks) flow conditions from all three repeats, assessed via principal coordinates analysis (PCoA) of (A) 16S rRNA metabarcoding and (B) flow cytometry (FCM) fingerprinting data. Dotted lines indicate the 95% interval of the corresponding microbial communities. Both analyses show a significant difference in bacterial communities among CWSslow and CWSfast (p = 0.001) and CWSslow and IWSfast (p = 0.002) according to PERMANOVA test. The number of replicates are CWSslow (16S rRNA gene metabarcoding, n = 16; FCM, n = 45); CWSfast (16 S rRNA gene metabarcoding, n = 41; FCM, n = 59); and IWSfast (16S rRNA gene metabarcoding, n = 43; FCM, n = 60).

Discussion

A decline of water quality in IWS systems can pose potential risks to public health, impacting overall well-being and quality of life28. This concern is heightened when consumers store water to cope with supply shortages, as prolonged storage conditions may create opportunities for pathogen growth37,38. Even systems with a continuous water supply (CWS) may occasionally operate intermittently for a variety of reasons39,40. Hence, there is an urgent need to understand the dynamics of biofilm detachment under both CWS and IWS conditions. Here we establish the conditions leading to biofilm detachment and evaluate microbial changes affecting the biological stability of potable water in both CWS and IWS sections of the same pilot-scale testbed.

The presence of Mycobacteria in all bulk water samples was expected, given their ability to grow in the presence of monochloramine disinfectant41,42. Nontuberculous mycobacteria are known to be opportunistic pathogens in natural and built water systems and can cause human disease via the drinking water route43; they have been associated with intermittent stagnation periods (i.e., IWS priming conditions)44. Similarly, the relative abundances of genera like Phreatobacter, Mycobacterium and Sphingomonas have been found to increase following the restart of IWS flow in a previous experimental flow study28. The genera Mycobacterium and Sphingomonas were also prevalent among isolates obtained from a DWDS operating intermittently in Beirut, Lebanon45, and Pseudomonas sequences were present in water when supply restarted under IWS conditions46, although no sampling time period was specified.

As for the nitrifying bacteria and archaea in biofilms, the relative abundance of AOB and NOB was similar. The use of monochloramine in DWDS has been known to result in nitrification, along with an increase in nitrifier abundance47. However, the levels of nitrite- and nitrate-nitrogen measured were still below the guidelines adopted in Singapore. The presence of nitrifiers per se does not represent a health threat but may indicate disinfectant decay. Although previous results in Singapore’s national distribution network confirmed that monochloramine in bulk water favors the growth of nitrifiers in DWDS biofilms, the influence of monochloramine on biofilms and water quality under IWS conditions remains unknown21. Stagnation, as observed with IWS, is posited to lead to the decomposition of monochloramine, releasing more ammonia into the bulk water48,49, which should be more favorable for AOA/AOB growth. In contrast, biofilms accumulated in the IWS section in the present study reveal lower relative abundances of AOB and NOB than in the CWS section, likely due to frequent disruption of the biofilms from the shear forces of flow resumption as suggested by Preciado et al. (2021)28. Without a constant supply of water, growth of these nitrifiers was likely limited by the availability of free ammonia and monochloramine in the stagnant water. The relative AOA abundance in the bulk water was much lower than that of AOB and NOB, likely owing to the much slower growth rate of AOA compared to AOB and NOB50. Additionally, the 100-day experimental period is likely too short for AOA to predominate in the nitrifier biofilms, as the model suggested by Cruz et al. (2020)21 stated that increasing water age, length of pipe from the service reservoir and pipe age, along with decreasing monochloramine concentrations, will select for AOA over AOB in the nitrifying biofilms in DWDS. As such, the results showed that low levels of monochloramine in the bulk water led to favorable growing conditions for the establishment of nitrifying biofilms with increasing relative abundances of AOB and NOB over a period of 100 days in CWS. The frequent disruption of biofilms in IWS over the same period disrupted the establishment of nitrifying biofilms resulting in less nitrification than was observed in CWS. Although the relative abundance of nitrifiers based on metabarcoding provided valuable insights in this study, quantitative PCR could be applied to quantify the absolute abundance of predominant nitrifiers in future.

For fast detection of deviating events in drinking water quality by flow cytometry, we adapted the phenotypic fingerprinting (FCM) method developed by Favere et al. (2020)32 to test whether the samples collected from the outflow differed significantly from the inflow. The Bray-Curtis dissimilarity index that was assigned to a sample was calculated as the average of the Bray-Curtis dissimilarities between that sample and the inflow water samples of the same date. This was done to suit the variable blending of different types of water sources practiced in Singapore, namely, local catchments, imported river water, reclaimed wastewater, imported groundwater, and desalinated seawater. In contrast, Favere et al. in Belgium worked with a stable blend of surface and groundwater32. They used the average Bray-Curtis dissimilarity of about the first 40 samples collected every 40 min over a much longer monitoring period to obtain a threshold to compare samples against on a particular day. The sensitivity could be improved by increasing the sample size of the inflow group per analysis or increasing the sample volume for FCM fingerprinting.

In this study, deviating events under three different flow conditions were detected based on Bray-Curtis dissimilarity indices: (1) CWSslow-full pipe but minimal hydraulic change (laminar flow condition) as control, (2) CWSfast -full pipe but with transit flow condition (transition flow condition from laminar to turbulent flow conditions) and (3) IWSfast-transition from empty pipe to full pipe (transition from laminar to turbulent flow conditions). Minimal changes were expected under slow continuous flow conditions with negligible biofilm detachment based on Bray-Curtis dissimilarity indices derived from FCM fingerprinting (Fig. 7B), while deviating events were more prominent under fast flowrate conditions with CWSfast producing more events. It is possible that more biofilm growth occurred in the CWS pipes, thus producing more deviating events, while the frequent biofilm detachment occurring in IWS pipes allowed for fewer deviating events to occur.

As a complementary approach, the newly proposed unitless biofilm detachment potential (BDP) which calculates the extent of biofilm detachment in the water based only on FCM and measured flowrate. A similar approach was used in annular reactors to evaluate the contribution of net rates of cell growth and transfer of biofilm cells to the water at different water ages25. One advantage of BDP over phenotypic fingerprinting of flow cytometry data is that it can account for different flowrates in the drinking water network. Both BDP and phenotypic fingerprinting allow for an assessment of the biological stability in full-scale distribution systems, operated continuously or intermittently. This study demonstrates the need for greater consideration of biofilm detachment in DWDS, particularly in locations with low levels of residual disinfectant, as conventional water quality parameters do not reveal biofilm detachment in DWDS, or the time required to stabilize microbiological water quality in the outflow bulk water. BDP monitoring could also help localize areas at risk. For example, in a pilot DWDS, flushing alone after high-risk repair works or incidents resulted in a 1.5 to 2.7 log removal of cells in the bulk water, but not of the biofilm, thus shock chlorination was recommended to maintain microbial water quality19. The duration of the high BDP values could help water utilities estimate the minimum amount of water to be discarded before microbial cell counts and community composition return to baseline levels. BDP is proposed as a complementary method to inform decision-making by water utilities before resuming supply in an IWS system. As expected, the BDP values for CWSfast and IWSfast in this study were much higher than for CWSslow. In addition, the high BDP of CWSfast lasted longer compared to IWSfast. This suggests that biofilms in the CWS pipes were more conditioned to prevailing hydraulic conditions and less susceptible to biofilm detachment, whereas the biofilm formed in the IWS pipes was more easily detached when flow resumed after a period of stagnation. However, high BDP values do not imply that pathogenic microorganisms are present in the outflow.

One limitation of this study is that monochloramine concentrations in the source water supplied to the testbed were low, which may restrict direct application of the results to networks that operate at higher levels of monochloramine residuals. We are confident that the findings are reproducible in terms of biofilm detachment, and that higher monochloramine levels in the range used by utilities would not change that outcome. Biofilm growth and detachment are known to occur in all DWDS, and this study was about finding a way to detect and measure such detachment events in general. By providing actionable information to operators, the risks associated with the release of water to customers are likely to be better understood resulting in water conservation (by reducing the length of time needed for flushing) in countries or areas that are water-stressed.

Another area for improvement is the absence of online monitoring of pressurization and depressurizing events in the IWS in this study. The side-by-side comparison of CWS and IWS in this study could have revealed if there was more leaking in IWS pipes compared to CWS, caused by pressure transit effects in IWS as documented previously. One study found that pipe filling in intermittent supply did not always result in concerning pressure transients51. In contrast, Weston et al. (2022) reported that pressure transients measured online with high temporal resolution were caused by air in the system during the filling of mid-elevation zones, resulting in oscillating high-pressure values larger than the supply conditions before stabilizing52. This could lead to more events of pipe bursts thus affecting water quality, and the authors recommended the installation of well-maintained air-relief valves at strategic locations.

Conclusions

The comparison of microbial communities in biofilm and bulk water of an above-ground DWDS testbed exposed to intermittent and continuous supply in repeated and temporally separated experiments revealed that periods of high flow periods followed by stagnation or continuous slower flow periods affect microbial water quality in a predictable manner.

  • Metabarcoding results indicate that long-term development of biofilm in the CWS pipe section enables the growth (i.e., increased relative abundance) of bacteria associated with AOB and NOB. Bulk water data from the IWS section show significant changes in AOB/NOB (and nitrogen species) during initial supply but no long-term increase in relative abundance in the biofilm.

  • The accumulation of nitrate in the absence of nitrite and ammonia in the initial 60 s of each IWS flush suggests that nitrifiers in the biofilm were active between daily supply cycles.

  • Deviations in microbial water quality was detected by phenotypic fingerprinting for timely management and surveillance of microbial water quality in DWDS by comparing the outflow Bray-Curtis dissimilarity index with that of the inflow samples of the same date. This makes the method attractive for utilities relying on varying water sources to produce and deliver biologically stable potable water.

  • Using the biofilm detachment potential (BDP) developed here, it is feasible to determine how much water to discard prior to resuming supply in an IWS system. For the present testbed and a total length of 120 m per section, discarding 0.1 m3 would be appropriate to minimize consumer exposure to biofilm-associated microorganisms.

Materials and methods

Testbed: hydraulic regimes and bulk water samples

We constructed an above-ground outdoor testbed on the Nanyang Technological University (NTU) campus in Singapore (February 2020) to simulate different water supply methods. The testbed consists of 270 m of drinking water grade uPVC pipes (Ø 100 mm), 16 valves that allow for modification in flow paths, 14 screw-capped access points (Ø 100 mm) for biofilm collection, and seven outlets to regulate flow rates (see Fig. 1A). As an island state, Singapore obtains its water supply from four main sources (“four national taps”): local catchments (stored in 17 reservoirs), imported river water (Johor River), high-grade reclaimed wastewater (NEWater), and imported groundwater and desalinated seawater (Cheng et al., 2021; Kitajima et al.17. These diverse sources can result in varying physicochemical characteristics depending on the mixture of the water supply (PUB, 2021). To ensure homogeneous conditions during the experimental period, a temporary water storage tank (effective capacity of 4 m3 was installed upstream of the pipes and supplied continuously with water from the campus drinking water distribution system. To minimize biofilm growth and ensure consistent water quality, we implemented several control measures in the tank: monitoring of water quality, discarding the water exiting during the first 5 min before sampling from the tank, keeping the same hydraulic retention time, and minimizing surface contact by securing the tank entrance. These measures helped to control biofilm development within the storage tank and maintain consistent influent water quality in the pilot.

Two 90 m long pipe segments (Fig. 1) were primed under controlled flow regimes for a period of 30–33 days prior to each set of experiments. Priming of the CWS section comprised a continuous, slow daily laminar flow (flow rate, Q ~ 0.1 L/s)53; while the IWS section was subject to a 15 min daily supply period (flow rate, Q ~ 1.5 L/s) and allowed to drain and stagnate for the remaining time. We performed three repeats of a set of experiments during a 100-day period. All repeats were conducted on the same pipes assigned to either IWS or CWS. The idea was to ensure that for repeats 2 and 3, biofilms in pipes would have the same ‘history’ (IWS or CWS) as the first repeat in terms of flow and stagnation periods. Detachment is affected by flow but also existing biofilm architecture. Switching pipes from IWS to CWS and vice versa would have introduced a possible confounding factor and required extended priming of pipes (more than 30 days) after each repeat, thus considerably lengthening the study. Sampling involved the collection of two-liter bulk water samples at the inlet (i.e., tap, tank and outlet #0; Fig. 1) and outlet on each pipe section under three hydraulic conditions (see Table 1):

  1. 1.

    CWSslow: Steady-state continuous slow-flow conditions corresponding to uninterrupted laminar flow (flow rate, Q = 0.11 ± 0.02 L/s, with Reynolds number, Re < 1,800). We collected seven outlet samples (from outlets # 3 and #1; Fig. 1) at 38 min intervals over a period of 266 min (i.e., the time for replacement of the total pipe volume, t1 = 106 min) to provide a baseline on temporal variations in physicochemical bulk water properties and microbial cell counts.

  2. 2.

    CWSfast: Monthly fast flow of the above CWS section intended to induce biofilm detachment in unsteady, turbulent flow conditions. The average flow rate Q = 1.17–1.42 L/s (t1 = 600–500 s) simulates flushing used in typical pipe maintenance operations recommended by the American Water Works Association26 and utilities in the Netherlands19,54. Fifteen samples were collected from outlet #1 over a period of 720 s (at intervals increasing from 10 s in the first minute to 120 s for the remainder of the sampling).

  3. 3.

    IWSfast: Initial supply of the drained IWS section daily was accomplished at average flow rates Q = 1.36–1.63 L/s (turbulent flow regime with t1 = 520–430 s after the initial filling phase) with sample collections from outlet #6 over a total period of 720 s (see CWSfast). The experimental hydraulic conditions (IWSfast) are comparable to flow rates reported55 for operational IWS systems (Q = 0.6 to 3.5 l/s).

The samples were collected directly into sterile PVC bottles (Corning, USA), stored on ice, and then transported back to the laboratory for further analysis within 90 min.

There are 7 identical pipe sections, outlets 1–7 for sampling. These outlets can be connected in parallel or in series. There is an additional sampling port, outlet 0 near the end of shared pipe section, which could further split into CWS and IWS as indicated by the arrows.

The source water for this testbed study is taken from one tap installed on NTU mains. Water in the tank is replenished continuously (with a feeding rate of 7.2 L/min) with low monochloramine (0.3–0.8 mg/L) present. It travels from the tank to the end of outlet 0, and is then shared by CWS (continuously) at discharging rate of 6.8 L/min and IWS. IWS is operated intermittently, and manually with one flush per day for nearly 3–4 pipe volumes of water.

The pipe for the IWS section remained nearly dry most of the day for IWS. CWS is kept wet and full in all times except biofilm swabbing. The number of valves, bends, and sampling windows as well as the locations where were installed in the respective pipe rigs in the testbed were identical for CWS and IWS lines to minimize any effects of potential confounding factors.

Biofilm sampling

Biofilm samples were obtained at the start of the whole test and after completion of the collection of bulk water samples for the second and third repeats. Approximately 10 cm2 of pipe walls were accessed via sampling windows (W3, W10 for CWS section and W8, W15 for IWS, see Fig. 1B). Biofilm was swabbed from the pipe walls using multiple disposable cotton swabs immersed in sterile 0.845% NaCl (n = 3–6 swabs per sampling window). Cotton swabs were then transferred into fresh reaction tubes and immersed in 1 mL of sterile 0.845% NaCl, stored at 4 °C, and transported back to the laboratory for further processing within 90 min. Next, the biofilm was dislodged from the swabs by vigorous mixing followed by bead beating and whole DNA extraction using the Pathogen UCP kit (Qiagen, Germany) according to the manufacturer’s protocol. In addition to comparing the biofilm community changes in CWS and IWS, the colonization by ammonia oxidizing bacteria (AOB) and archaea (AOA) and nitrite oxidizing bacteria (NOB) in biofilms under different flow conditions was evaluated using swab samples obtained before and after the 100-day experimental period and analyzed using 16 S rRNA gene metabarcoding.

Physicochemical measurements

Physicochemical parameters commonly associated with drinking water quality were measured onsite or immediately after the arrival of the samples in the laboratory. More details were summarized in Table S1. Temperature, total dissolved solids, and conductivity were monitored in triplicate with a Myron L Ultrameter II (Cole Parmer, Singapore). Monochloramine was measured using a colorimetric method (Hach DR 900 Colorimeter, HACH Lange, USA) according to the manufacturer’s recommendations.

Ammonia (NH3-N), nitrite (NO2-N) and nitrate (NO3-N) were measured using a HACH DR-3900 Spectrophotometer (HACH Lange, USA). Total organic carbon (TOC) was quantified using a Shimadzu TOC-L (Shimadzu, Japan) and total carbon (TC), total inorganic carbon (TIC), and total nitrogen (TN) as well as chloride (Cl-) and sulphate (SO42-) measurements were done with a Shimadzu Prominence HIC-SP (Shimadzu, Japan).

Flow cytometry (FCM) and biofilm detachment potential (BDP)

Quantitative flow cytometry (FCM) was conducted using the LIVE/DEAD BacLight Bacteria Viability Kit (Thermo Fisher, USA) on a CytoFlex LS flow cytometer (Beckman Coulter, USA). As described elsewhere, this approach allows for the differentiation of microbial cells with intact and ruptured membranes as well as the clustering of populations according to size, shape, and relative nucleic acid content56. Prior to the analysis, the bulk water samples were diluted in sterile 0.845% NaCl (1:4) and stained with 3.34 mM of SYTO9 and 20 mM of propidium iodide (PI) and incubated in the dark at room temperature for 25 min, then gently mixed by inverting the tubes several times. Biofilm taken from the operational campus drinking water distribution system served as positive and sterile filtered NaCl buffer served as negative control. Positive controls were grown overnight in Luria-Bertani broth (Merck, USA) before each experiment, washed twice in 0.845% NaCl and diluted 5,000 times to reach total cell counts comparable to typical environmental (i.e., Singapore drinking water) counts (~ 105 cells/mL; data not shown). For quality control purposes, and to validate the gates assigned to intact and damaged bacteria, 1 mL of the positive control was pasteurized (90 °C for 10 min) before staining to represent non-viable cells with ruptured cell walls.

Before each FCM run, and to minimize background signals, sheath fluid (Beckman Coulter, USA) was filter-sterilized by two passages through a 0.2 μm nitrocellulose membrane (Merck, USA) and a quality control regime performed according to manufacturer’s protocols using validated CytoFlex QC Fluorophores (Beckman Coulter, USA). Triplicate samples were run for cell counts in bulk water, and duplicate measurements were performed per sample at a fixed measuring window of 120 s. Samples were analyzed within 24 h of collection (to minimize post-sampling membrane degradation), and data analysis was conducted using CytExpert 2.4 (Beckman Coulter, USA) following a gating approach described elsewhere (Wu, 2021). Biomass flux (cells per second, cells/s) at a given time in the outflow was defined as cell concentrations derived from respective FCM results (FCMoutflow, cells/mL) multiplied by the hydraulic flow rate (Qoutflow, L/s) of the respective experiment. Biomass flux (cells/s) in the inflow was defined as cell concentrations derived from respective FCM results (FCMinflow, cells/mL) at Outlet 0 collected for 0 min, 6 min and 12 min multiplied by the average hydraulic flow rate (Qinflow, L/s) of the respective 720 s supply experiment. It is an attempt to account for the variation between experiments and includes the variation in flowrate at the start of an IWS cycle with a partially filled pipe compared to the flowrate of a full pipe in CWS. To illustrate the difference in detachment between water entering and leaving the testbed, we define the logarithmic ratio of outflow to inflow biomass (collected from Outlet 0) as the Biofilm Detachment Potential (BDP):

$$\:BDP=\:{\text{log}}_{10}\frac{{Biomass}_{outflow}}{{Biomass}_{inflow}}={\text{log}}_{10}\frac{{FCM}_{outflow}\bullet\:{Q}_{outflow}}{{FCM}_{outlet\:0}\bullet\:{\stackrel{-}{Q}}_{inflow}}$$
(1)

In situations where there is no detachment of biofilm, the BDP = 0, while BPD > 0 implies detachment of biofilm as expected in unsteady and/or turbulent flow conditions. Values of BDP < 0 indicate attachment of microbial cells to the pipe wall.

Flow cytometric fingerprinting and data analysis

The open-source programming language R was used for phenotypic fingerprinting and measuring community changes based on flow cytometrical data32,33. In brief, flow cytometrical data in the form of Flow Cytometry Standard (*.fcs) files were processed with the flowCore (v1.44.2) package in R (v4.1.0) (R Core Team, USA) before using the FlowAI (v1.14.0) package for quality control and data clean-up. The Phenoflow (v1.1.2) package (https://github.com/rprops/PhenoFlow) then allowed for additional data processing in accordance with Props et al. (2016)33 and Rogers and Holyst (2009)57 (i.e., transformation, discretization, and concatenation of cytometrical data such as relative fluorescence, cell shape and size into one-dimensional vectors) and subsequently provided the foundation for the phenotypic community structure analysis. This analysis is based on a fixed size binning approach in the Phenoflow (v1.1.2) package and deriving from fluorescence intensity values (red and green emission spectra)58. All figures were generated using GraphPad Prism 9.0 (GraphPad Software, USA) or R Studio (R Core Team, USA).

16S rRNA gene metabarcoding to analyze microbial community composition

16S rRNA gene metabarcoding of the water samples was conducted with the Illumina multiplex strategy (Illumina genome analyzer IIx, Illumina, Singapore) at the sequencing facilities in the Singapore Centre for Environmental Life Sciences Engineering, Singapore. Genomic DNA extracted from the filtered samples was amplified using the primer pair 515 F-Y (5ʹ-TCG TCG GCA GCG TCA GAT GTG TAT AAG AGA CAG GTG YCA GCM GCC GCG GTA A-3ʹ) and 926R (5ʹ-GTC TCG TGG GCT CGG AGA TGT GTA TAA GAG ACA GCC GYC AAT TYM TTT RAG TTT-3ʹ) in accordance with Parada et al. (2016)59 and Cruz et al. (2020)21 and using the KAPA HiFi HotStart ReadyMix (Kapa Biosystems, USA). The PCR amplification was conducted using the following program: 5 min of denaturation at 95 °C, 30 cycles at 98 °C, 30 s for annealing at 54 °C, and 45 s with elongation at 72 °C, and a final extension at 72 °C for 1 min. The primer concentrations were 0.4 µM and the 2×KAPA HiFi HotStart ReadyMix was used in a reaction volume of 40 µL. Subsequently, PCR products were purified using magnetic beads (Agencourt AMPure XP-PCR purification, Beckman Coulter, USA), and the quality of the purified PCR products was checked using an Agilent 2200 TapeStation (Agilent, USA) for amplicon size and a Qubit 4 Fluorometer (Invitrogen, USA) with the dsDNA HS assay kit for concentration. For each sample, 10 µL of amplicon at a concentration of no more than 15 ng/µL was submitted for indexing and sequencing (MiSeq 300 bp PE, Illumina, USA).

Microbiome analysis and data processing

The divisive amplicon denoising algorithm 2 (DADA2) workflow (v1.20 in R4.1.0) was used due to its sensitivity in inferring true biological sequences from reads60,61. Denoising was implemented separately on the forward and reverse reads, resulting in amplicon sequence variant (ASV) tables after removal of chimeras. The taxonomic assignments of the final ASV were blasted against the SILVA SSU r138 database. Subsequent analysis followed an updated workflow (https://github.com/CSB5/GERMS_ 16S_pipeline) described by Ong et al. (2013)62 in GERMS using R Studio (R Core Team, USA) to determine how the microbial community structure in samples differed among groups. Differences in community structure between samples (beta diversity) were assessed via the Bray-Curtis dissimilarity index and visualized by principal coordinate analysis (PCoA) at the ASV level. Permutational multivariate analysis of variance (PERMANOVA) was applied to assess the significance of differences in dissimilarity indices for bacterial community structure among samples using the Adonis function of the vegan package in R63 with further validation for the analysis of multivariate homogeneity of group dispersions (variances) using the PERMDISP package in R with 9999 permutations.

Bray–Curtis dissimilarity indices to identify changes in the drinking water microbiome

The Bray-Curtis dissimilarity index was used to quantify differences in the overall microbial composition across samples64. Two different Bray-Curtis dissimilarity indices were computed: one from 16S rRNA gene metabarcoding (BCMBC) and the other from flow cytometric fingerprinting (BCFP). PCoA was used to visualize microbial community differences based on Bray-Curtis dissimilarity indices for bulk water sampled at the inflow and outflows of CWS and IWS pipe sections. Bulk water samples collected from a sampling point (Outlet 0) located upstream from the pipe segments used in experiments (“inflow”) were first compared to city bulk water to see if inflowing water changed over time (Fig. S1). The Bray-Curtis dissimilarity indices from the respective outflows were compared to the inflow collected from the original storage tank supply and Outlet 0 (see Fig. 1B). The index assigned to its respective sample in the outflow subgroup was calculated as the average of the Bray-Curtis dissimilarities between that sample and the inflow samples of the same date. The index that was assigned to an inflow sample subgroup was calculated as the average of the Bray-Curtis dissimilarities between that sample and the remaining inflow samples of the same date.

To identify deviating events, we defined a threshold dissimilarity index as follows:

$$\:Threshold={\mu\:}_{inflow}+{3\sigma\:}_{inflow}$$
(2)

where µinflow and sinflow are the mean and standard deviation of Bray-Curtis dissimilarities for inflow samples, as proposed previously by Favere et al.32.

The threshold approach was modified and adapted for surveillance purposes to improve sensitivity. For each experiment, CWSslow, CWSfast and IWSfast, the outflow Bray-Curtis dissimilarity index was calculated with respect to the inflow samples of the same experiment and on the same day only. Samples from the outlets with a Bray-Curtis dissimilarity larger than this threshold value were defined as deviating events. The overlapping deviating events were summarized in Table S2.

Microbial alpha diversity

The second order Hill number (2D), also known as inverse Simpson index, is used to describe alpha diversity. This metric was chosen because it considers both taxonomic composition and abundance and is a proven estimator of microbial diversity65. Values of 2D were reported for each bulk water sample using both 16S rRNA gene metabarcoding based on relative abundance of ASVs and from flow cytometric fingerprinting using Phenoflow58.

Statistical analyses

Changes in microbial water quality and microbial community composition in the samples taken from CWS and IWS were examined using 16S rRNA gene metabarcoding and FCM-phenotypic fingerprinting. Welch’s analysis of variance (ANOVA), a robust method suitable for heteroskedastic data, was applied to test differences in 2D alpha-diversity, followed by Games-Howell post-hoc tests, which do not assume equal variances or sample size. To assess the relationship between microbial community changes, Spearman’s rank correlation coefficient was computed between Bray-Curtis dissimilarity indices during the first 60 s from 16S rRNA gene metabarcoding and flow cytometry fingerprinting data from the same samples, using the caret package in R 4.1.2. This is for testing rather flow cytometry fingerprinting provides a reliable representation of sequencing-based microbial community shifts. Furthermore, the relative abundance of biofilm nitrifying communities was modeled using beta regression, implemented through the betareg package in R, an appropriate approach for proportional data constrained between 0 and 1. To improve interpretability, a log link function was employed to transform the response variable. Subsequently, the estimated marginal means (EMMs) were computed to facilitate pairwise comparisons, using the emmeans package in R, with the p-values adjusted using the Benjamini-Hochberg method to account for multiple comparisons. A threshold of p < 0.05 was maintained for statistical significance.

Generalized linear mixed-effects model (GLMM) to understand the microbial community changes in the drinking water microbiome

To assess factors influencing microbial community compositions, a generalized linear mixed-effects model (GLMM) was applied to Bray-Curtis dissimilarity indices, BCMBC and BCFP, derived from 16S rRNA metabarcoding and flow cytometry fingerprinting, respectively. This approach incorporates both fixed effects, which are consistent across observations, and random effects, which account for variability among experimental replicates66. Fixed effects included the following: time, time2 to account for non-linearity, flow regime (CWSslow, CWSfast, and IWSfast), computing method (metabarcoding vs. phenoflow), ammonia levels, interactions between method and flow regimes, as well as interactions between time and method.

A random intercept was incorporated for each experimental replicate to account for within-group variation across runs. Model selection was performed using stepwise backward elimination, optimizing the Bayesian Information Criterion (BIC) via the buildmer package in R.

To account for multiple comparisons, false discovery rate (FDR) adjustment was applied to all p-values67. Statistical significance was determined at p < 0.05.