Introduction

Microbes are the major drivers of nitrification and denitrification processes which produce nitrate (NO3), nitrite (NO2), nitric oxide (NO), dinitrogen gas (N2), and nitrous oxide (N2O), resulting in geochemical and ecological consequences such as eutrophication and global warming (Magalhães et al. 2005). In stream ecosystems, complex microbial assemblages attaching to river substrates like sand or gravels are called epilithic biofilms (Lyautey et al. 2003), which are hot spots of nitrification and denitrification process by taking and transferring nutrients and providing aerobic-anaerobic microsites (Besemer 2015; Hanrahan et al. 2018).

Epilithic biofilms are sensitive to anthropogenic activities and geological changes in river ecosystems (Besemer 2015; Lear et al. 2008; Magalhães et al. 2005). As a result, the abundance and composition of nitrifier and denitrifier communities in epilithic biofilms also change with the environment. For example, denitrifier community structure shifts with the variation in nutrient load, especially the nitrogen load (Lyautey et al. 2013); higher abundance of Proteobacteria was observed as a response to higher nutrient concentrations (Qu et al. 2017); ammonia-oxidizing bacteria dominate the epilithic biofilms when ammonium concentration is high (Liu et al. 2018a); and water warming changes the abundance of denitrifiers to modulate dissolved nitrogen removal indirectly (Boulêtreau et al. 2014; Lear et al. 2008).

Due to the close attachment between nitrifier/denitrifier communities and environmental changes, the abundance and composition of these micro-organisms in epilithic biofilms may act as indicators of nitrification and denitrification processes in rivers. However, the functions of microbial communities are often decoupled from their taxonomic composition. Therefore, the role of microbial functional genes in nitrogen cycle should be emphasized (Wang et al. 2022). In recent years, metagenomics enables the identification of all known nitrogen-cycling genes changing with the environment. A series of studies based on metagenomics have shown that the hydrological and physicochemical factors exert profound impacts on the abundance of functional genes. For instance, Ren et al. (2017) found that glaciated area proportion, runoff proportion, and distance to glaciers affect the relative abundance of nitrifying and denitrifying genes more significantly than physicochemical factors including temperature, dissolved oxygen, ammonium, and nitrate in glacial-fed streams; Palacin-Lizarbe et al. (2019) revealed that the abundance of nirS was higher than nirK in more productive lakes; Vila-Costa et al. (2014) showed that amoA abundance was strongly correlated with nutrient concentrations such as ammonium and nitrate. In addition to nutrient concentrations in river water, the riverbed substrates with different physical properties, as the main attachment places for epilithic biofilms, could also affect the nitrifying and denitrifying genes. However, this factor has not been sufficiently investigated. In addition, it remains to be seen the relative importance between the two factors, i.e., substrate properties and aquatic nutrient concentrations.

In this study, we try to explore how the nitrifying/denitrifying genes (i.e., amoA, hao, nxrB, napA, narG, nirS, norB, and nosZ) in epilithic biofilms correlate with the size and size distribution (heterogeneity) of substrates and aquatic nutrient concentrations in the Shitingjiang River located in the southwest of China and experiencing dramatic natural and anthropogenic changes (Fan et al. 2016; Li et al. 2022). In addition, bacteria potentially carrying the focused genes were also identified. Given that certain genes, such as hao and norB, are involved in the formation of nitrous oxide, a much stronger greenhouse gas than carbon dioxide (Wang et al. 2013), our study also analyzed the nitrogen metabolic pathways and the enzyme in groups with different substrate sizes, heterogeneity, and nutrient concentrations and discussed potential nitrous oxide emissions in rivers associated with substrate physical properties which could be changed by natural incision of riverbed and water conservancy projects.

Materials and methods

Site description

The Shitingjiang River (31° 10′–31° 17′ N, 104° 01′–104° 14′ E) is a 115 km-long tributary of the Mianyuanhe River (Fig. 1), originating from the Longmen Mountain and flowing to the Chengdu Plain in the southwest of China. The watershed area takes up ~ 1600 km2 with an average slope of ~ 3.3‰ (Fan et al. 2016). Shitingjiang River is highly heterogeneous in substrates, with particle size ranging from < 2 to > 256 mm, and the heterogeneity of substrates has been further increased since the Wenchuan earthquake (in 2008) which mobilized coarse particles. Commercial sediment extraction and constructions of water conservancy facilities also affect the heterogeneity of substrates. High nutrient concentrations are observed in the river due to fertilizer abuse and industrial wastewater discharge (Li et al. 2022).

Fig. 1
figure 1

Sketch map of the sampling sites in Shitingjiang river. (a) Location of the studied area in Sichuan Province in the southwest of China. (b) Tributaries of the Tuojiang River, including the Mianyuan River and the Shitingjiang River. (c) Locations of the ten sampling sites along the Shitingjiang River

Sample collection and pretreatment

The sampling was carried out from July 2 to July 10 in 2022 within a 25.8-km reach of the Shitingjiang River. At each sampling site, we randomly sampled submerged substrates from the river at a depth between 10 and 30 cm and divided the grain size into four groups, i.e., < 2 mm (D1), 2–40 mm (D2), 40–100 mm (D3), and 100–200 mm (D4). Then, epilithic biofilms were removed by scrapers from the upper surface of each substrate and put into pre-sterilized polyethylene tubes. For epipsammic biofilms (i.e., biofilm from particles smaller than 2 mm), the bead-beating procedure is an effective method. However, due to the constraints of time and environment for in situ monitoring, a rubber-tipped dropper was used to collect epipsammic biofilms after consulting with Majorbio Bio-Pharm Technology Co., Ltd (Shanghai, China). The procedure was as follows: (1) find the < 2-mm particles that were adjacent to the places where we got substrates of the larger-sized groups. To keep the epipsammic samples in consistent with the epilithic ones, only the epipsammic biofilms on the upper side of the < 2-mm particles were taken. Note that < 2-mm particles usually form a small continuous area, and the epipsammic biofilms growing after the particle deposits are also continuous. (2) A rubber-tipped dropper was used to suck up the epipsammic biofilms on the surface of the < 2-mm particles. (3) By extruding the water that had been sucked in with the epipsammic biofilms, the sample was placed in a pre-sterilized polyethylene tube. Note that only a very small amount of biofilms can be sucked up with every release, so Steps (2) and (3) needed to be repeated many times until 10 ml of sample was collected at one site.

The water samples were also collected from 0.2 m underwater using pre-sterilized bottles. Then, all the water and biofilm samples were immediately stored in thermos cabinet with ice bag and frozen at − 20 °C within 10 h to prevent the degradation of genes (Silva et al. 2021) for physiochemical and metagenomics analysis.

Meanwhile, the Wolman sampling method was used to estimate the grain size ranging from 2 to 256 mm on the bed of the stream. The Wolman method includes three steps: (1) establishing a grided area using step length (0.3–0.6 m) at the sampling site, (2) selecting one gravel randomly in each grid along the designed route and measure the length of its central axis, and (3) repeating the previous step until 100 gravels are measured (Bunte and Abt 2001; Galia et al. 2017; Wolman 1954).

Chemical analyses

Physicochemical properties of the overlying water samples were characterized including nitrate (NO3), nitrite (NO2), ammonium (NH+), total nitrogen (TN), total phosphorus (TP), chemical oxygen demand (COD), total inorganic carbon (TIC), total carbon (TC), and total organic carbon (TOC). The NO3 and NO2 concentrations were determined by UV spectrophotometer (SP-722E, Spectrum Shanghai, China). NO3 concentration was determined with potassium nitrate and hydrochloric acid at the peak absorption of 220 nm and 275 nm. The determination of NO2 concentration was conducted using N-1-naphthalene ethylenediamine based on National Standards (GB 7493–87) (Zhang et al. 2022). And the NH+ concentration was measured using the Nessler Reagent Spectrophotometry method (Zhang et al. 2022). The determinations of TN and TP were conducted using alkaline potassium persulfate digestion UV spectrophotometry (Hao 2014) and ammonium molybdate spectrophotometric method (Li et al. 2012), respectively. TOC, TIC, and TC concentrations were analyzed on a vario TOC SELECT (elementar-Analysensysteme GmbH, Germany) (Qu et al. 2017). The dichromate method was used for the COD measurement (Anderson et al. 2007).

DNA extraction and metagenomic sequencing

Genomic DNA from epilithic biofilm samples of Shitingjiang River was extracted using E.Z.N.A® Soil DNA Kit (Omega Bio-tek, Norcross, GA, USA) and then detected by 1% agarose gel electrophoresis. Analyses of DNA purity and concentration were performed using NanoDrop 2000 spectrophotometer and TBS-380, respectively. Paired-end library was constructed using NEXTflex Rapid DNA-Seq (Bioo Scientific, Austin, TX, USA) based on random fragments of extracted DNA with an average size of about 400 bp (Covaris M220, Gene Company Limited, China), and then paired-end sequencing was performed on Illumina NovaSeq 6000 (Illumina Inc., NovaSeq Reagent Kits) at Majorbio Bio-Pharm Technology Co., Ltd. (Shanghai, China) according to the manufacturer’s instructions (www.illumina.com). Paired-end reads were trimmed and improved (length < 50 bp or with a quality value < 20 or having N base) by fastp (http://github.com/OpenGene/fastp, version 0.20.0) (Chen et al. 2018) on the Majorbio Cloud Platform (www.majorbio.com). Metagenomic data were assembled using MEGAHIT (http://github.com/voutcn/megahit, version 1.1.2) and filter out contigs with a length < 300 bp (Li et al. 2015). ORFs (Open Reading Frames) which are essential to discover specific protein-encoding genes were predicted using Prodigal (Hyatt et al. 2010). A non-redundant gene catalog was obtained using CD-HIT (http://www.bioinformatics.org/cd-hit/, version 4.6.1) (Fu et al. 2012) based on predicted ORFs with 90% identity and 90% coverage. The relative abundance of genes were calculated by aligning high-quality reads (95% identity) to non-redundant gene catalogs using SOAPaligner (http://soap.genomics.org.cn/, version 2.21) (Li et al. 2008).

Genes and microbial taxonomy annotation

The genes involved in nitrification (i.e., amoA, hao, nxrB) and denitrification (i.e., napA, narG, nirS, norB, and nosZ) were identified against the Kyoto Encyclopedia of Genes and Genomes (KEGG) database via Diamond (http://www.genome.jp/keeg/, version 94.2) (Fig. 2). Microbial composition assigned with aforementioned genes was characterized against NR database (https://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/, nr_20200604) with an e-value cutoff of 1e−5 using Diamond (http://www.diamondsearch.org/index.php, version 0.8.35) (Buchfink et al. 2015).

Fig. 2
figure 2

Functional genes involved in nitrification and denitrification processes

Statistical methods

The data were analyzed on the online platform of Majorbio Cloud Platform (www.majorbio.com) and SPSS (version 26.0). The Skewness and Kurtosis tests were taken to test whether the relative abundance of functional genes followed normal distribution (SPSS version 26.0). Then significant difference (P < 0.05) among different size and heterogeneity of gravels was assessed using Kruskal–Wallis test (SPSS version 26.0) and Paired-Samples T test (SPSS version 26.0) (Xu et al. 2017). Significance of the relative abundance of genes involved in nitrification and denitrification among different substrate heterogeneity was calculated by permutational multivariate analysis of variance (PERMANOVA) (vegan package 2.4 in R 3.3.2) (P < 0.05). Analysis of unique and shared nitrifiers/denitrifiers of epilithic biofilms among groups with different substrate sizes were conducted using the VennDiagram package (R 3.3.2). The microbial community dissimilarities of nitrifiers/denitrifiers were examined using non-metric multidimensional scaling based on a Bray–Curtis similarity matrix (Kobayashi et al. 2009; Qu et al. 2017). After calculating the first axis of the lengths of gradient (based on the analysis result of Detrended Correspondence Analysis) (Griffith et al. 2001), we chose redundancy analysis (RDA) to reveal the correlation of nitrifying/denitrifying genes and their associated microbes with aquatic nutrients using Bray–Curtis distance matrix (vegan package 2.4 in R 3.3.2) (Qu et al. 2017; Ren et al. 2017). The relative abundance of functional gene proportions among different heterogeneity groups was visualized using Circos (Circos 0.67–7). Spearman analysis was conducted to compare the importance of aquatic nutrient concentrations and substrate size heterogeneity to the relative abundance of nitrifying/denitrifying genes and their associated microbes. Only the significant correlations were taken into consideration (P < 0.05).

Results and discussion

At one site, we collected four samples from the four substrate groups (i.e., D1, D2, D3, and D4), respectively, and we got a total of 40 samples at the ten sites. Each sample contained 10-ml biofilms.

Relative abundance of nitrifying/denitrifying genes and the associated microbes among different substrate size groups

The relative abundance of most nitrifying and denitrifying genes that followed the normal distribution shows significant difference among substrate size groups (P < 0.05 in the t test) (Table 1 and Table S1). In the case of hao, its relative abundance was the highest in Group D1, followed by Group D4 (Fig. 3). In contrast, the highest relative abundance of norB was found in the group with the largest size (D4), followed by Group D2 (Fig. 3). Besides, the presence of napA significantly varied among Groups D2, D3, and D4, while nxrB and nirS mostly differed between Groups D2 and D4. Groups D4 and D3 were also distinguished in the relative abundance of nosZ (Fig. 3).

Table 1 Paired-samples T Test results of relative abundance of nitrifying/denitrifying genes among groups with different sizes
Fig. 3
figure 3

Relative abundance of the nitrifying genes (amoA, hao, nxrB) and the denitrifying genes (napA, narG, nirS, norB, and nosZ) in groups with different substrate sizes. D1, substrate size < 2 mm; D2, substrate size within 2–40 mm; D3, substrate size within 40–100 mm; D4, substrate size within 100–200 mm. *P < 0.05; **P < 0.01; ***P < 0.001

By assigning all the concerned genes to specific bacteria, we found nitrifiers and denitrifiers mainly belonged to phyla Proteobacteria, Actinobacteria, Verrucomicrobia, and Planctomycetes (Fig. 4). In contrast to the functional genes, there was no significant difference in the relative abundance of bacteria at phylum level among the four substrate size groups (P > 0.05) (Table S3). Furthermore, we assigned all the concerned genes to the species level of nitrifiers and denitrifiers. The results showed that groups with different substrate size shared 465 species (74.6–77.8% of the total species number) for nitrifiers and 467 species for denitrifiers (74.4–80.4% of the total) (Fig. S1). The dominant species (i.e., top four species in relative abundance) among four substrate groups showed insignificant difference (Actinobacteria bacterium, Pseudogemmobacter bohemicus, Paracoccus zhejiangensis, Gemmobacter aestuarii for nitrifiers, and Actinobacteria bacterium, Pseudogemmobacter bohemicus, Paracoccus zhejiangensis, Rhodobacter veldkampii for denitrifiers, P > 0.05). The average relative abundance of Actinobacteria bacterium was 7.27%, 4.52%, 6.26%, and 7.72% in Group D1, D2, D3, and D4, respectively (Fig. 4c, d), while that of Pseudogemmobacter bohemicus varied from 4.31 to 5.50%, with the highest relative abundance found in Group D2 (Fig. 4c, d). The highest the relative abundance of Paracoccus zhejiangensis was in Group D2 while lowest was found in Group D3 (Fig. 4c, d). The highest relative abundance of Gemmobacter aestuarii as a nitrifier was observed in Group D2 (Fig. 4c). The lowest relative abundance of Rhodobacter valdkampii as a denitrifier was found in Group D4 (Fig. 4d).

Fig. 4
figure 4

Relative abundance of (a) nitrifiers at the phylum level, (b) denitrifiers at the phylum level, (c) nitrifiers at the species level, and (d) denitrifiers at the species level in groups with different substrate sizes. D1, substrate size < 2 mm; D2, substrate size within 2–40 mm; D3, substrate size within 40–100 mm; D4, substrate size within 100–200 mm

Although Aquabacterium pictum is the species with low relative abundance, the nitrifying and denitrifying genes in this species exhibited significant variation among the four substrate size groups (P < 0.05). The highest mean relative abundance of this species was found in Group D3 (1.33%), followed by Group D2 (1.06%), D4 (0.81%), and D1 (0.55%). The highest relative abundance of Verrucomicrobia bacterium as a nitrifier was observed in Group D1 (1.18%). The lowest relative abundance of Thermomonas spHDW16 as a denitrifier was found in Group D1 (0.22%).

The relationship between the relative abundance of genes and the composition of corresponding bacteria among different substrate size groups was also identified. For example, the substrate size group (i.e., Group D1) with the highest relative abundance of hao had the most various taxonomic compositions at both the genus level (including 50.27% of Nitrosomonas, 36.64% of Nitrospira, and 13.08% of Candidatus Brocadia, associated with genes showing significant difference among size groups) and the species level (including 39.22% of Nitrosomonas sp. ST-bin4, 20.97% of Nitrosomonas sp. Is79A3, and 26.19% of Nitrosomonas sp. Nm141, also associated with genes exhibiting significant difference among size groups). In contrast, in Group D3 where the relative abundance of hao was the lowest, the bacteria assigned from hao mainly belonged to genus Nitrosomonas (Fig. S2) (Merbt et al. 2015; Mußmann et al. 2013; Smith and Oerther 2006). In the case of norB, the highest relative abundance co-occurred the large proportions of genus Tabrizicola and species Tabrizicola sp. DJC in Group D4 (Fig. S2) (Lin et al. 2022; Wu et al. 2020).

Relative abundance of nitrifying/denitrifying genes and the associated microbes among different size heterogeneity groups

The ratio of d84 to d50 (di representing the substrate size larger than the ith percent of substrates in the river) was used to measure the heterogeneity in the distribution of substrate size (Cardinale et al. 2002). Here, we calculate d84/d50 (~ 3.4) of site A1 located in the mountain exit as the standard for median heterogeneity (MH) because the influences of human activities and earthquakes there are very small. Therefore, sampling sites with d84/d50 smaller or larger than 3.4 were identified as low heterogeneity (LH) or high heterogeneity (HH) (Table 2).

Table 2 Substrate size heterogeneity of sampling sites

The relative abundance of most denitrifying genes (except gene norB) presented significant difference among heterogeneity groups using Kruskal–Wallis H test (P < 0.05) (Fig. S3). Their relative abundance was usually the highest in HH sampling sites. In the case of nosZ, however, the relative abundance was lower in HH sites than in the LH sites (Fig. 5a), while there was no significant difference in the relative abundance of nitrifying genes.

Fig. 5
figure 5

a The nitrifying/denitrifying gene composition in groups with different heterogeneity. b The proportions of the relative abundance of nitrifying and denitrifying species in groups with different heterogeneity. The numbers in each circle represents the proportion of the nitrifier or denitrifier

The nitrifiers/denitrifiers taxonomic community also distinguished between HH and LH sampling sites at the phylum level (identified by assigning all the concerned genes, see Fig. S4), as indicated by the results of non-metric multidimensional scaling (NMDS). In terms of relative abundance, the permutational multivariate analysis of variance (PERMANOVA) test based on the Bray–Curtis distance also identified significant difference (P < 0.05) between HH and LH sites in the nitrifiers, which is unlike the nitrifying genes, and in the denitrifiers, which is in agreement with the denitrifying genes. For instance, being the largest phyla of both nitrifiers and denitrifiers, Proteobacteria phylum have higher relative abundance in HH sampling sites (82.0% for HH and 76.9% for LH, P < 0.001), while Actinobacteria phylum have lower relative abundance in HH sampling sites (8.5% for the HH and 11.9% for the LH, P < 0.001) (Fig. S5).

Furthermore, the dominant species (identified as the top four species in relative abundance after assigning genes with significant difference among heterogeneity groups) and their relative abundance of nitrifiers and denitrifiers were analyzed in sampling sites with different heterogeneity. It showed that three species, namely Actinobacteria bacterium, Pseudogemmobacter bohemicus, and Paracoccus zhejiangensis, were dominated in both nitrification and denitrification processes (Fig. 5b), with relative abundance differing significantly between HH and LH sampling sites (Table S4). Hereinto, the relative abundance of species Actinobacteria bacterium was higher in LH sites, while that of species Pseudogemmobacter bohemicus and Paracoccus zhejiangensis was higher in HH sites (Fig. 5b). The higher relative abundance of Gemmobacter aestuarii as a nitrifier was observed in LH sites (Fig. 5b). The lower relative abundance of Rhodobacter valdkampii as a denitrifier was found in LH sites (Fig. 5b).

The co-occurrence of most denitrifying genes and the corresponding denitrifiers was found in different heterogeneity groups. Higher relative abundance of napA co-occurred with higher affiliated genus, Pseudogemmobacter and Paracoccus, in HH sampling sites. Similarly, higher relative abundance of norB and nirS also co-occurred genus Tabrizicola in HH sampling sites (Fig. 6).

Fig. 6
figure 6

The relative contribution of denitrifiers at genus level for denitrifying genes. LH, low heterogeneity; HH, high heterogeneity; MH, median heterogeneity

Impact of aquatic nutrient concentrations on the relative abundance of nitrifying/denitrifying genes and the associated microbes

The results of redundancy analysis (RDA) showed that the nutrient concentrations were tightly correlated with the relative abundance of nitrifying genes but poorly correlated with that of the denitrifying genes. For example, ammonium (NH4+), total inorganic carbon (TIC), and total organic carbon (TOC) concentrations were positively correlated with the relative abundance of amoA and nxrB, while TIC and TOC concentrations negatively correlated with the relative abundance of hao (P < 0.05). Besides, the relative abundance of all the concerned nitrifying genes was negatively dependent on the total carbon and total nitrogen ratio (CN ratio).

When assigning genes to the bacteria, we found that dominant phyla Proteobacteria, Actinobacteria, Verrucomicrobia, and Planctomycetes were all shared for nitrifiers and denitrifiers in different sampling sites. Moreover, the cluster analysis of the relative abundance of nitrifiers and denitrifiers at phylum level in different sampling sites was visualized using the dendrograms based on Euclidean distance (Fig. 7).

Fig. 7
figure 7

Network analysis of a nitrifiers and b denitrifiers at phylum level at sampling sites

For nitrifiers, sampling sites including B1, B3, E2, and F3 were grouped together; A1, C1, C4, D2, and E2 were clustered in Group 2; and A3 site was in Group 3. In the case of denitrifiers, sites including A1, C1, and A3 were clustered in Group 1; B1, B3, C4, E1, and D2 sites were grouped together; and E2 and F3 sites were in Group 3 (Fig. 8a). However, we found that the relative abundance of nitrifiers and denitrifiers at phylum level in different sampling sites differed significantly (P < 0.05) (Table S5).

Fig. 8
figure 8

a Hierarchical clustering analysis based on the Euclidean distance of the relative abundance of nitrifers/denitrifiers generated from the biofilm samples collected from 10 sampling sites. b, c The RDA plot revealing the association of nitrifying genes/nitrifiers at phylum level and denitrifying genes/denitrifiers at phylum level, respectively, in relation to nutrients concentrations. The length of an arrow represents the degree of correlation between nutrient concentrations and community distribution. The angle between two arrows represents the correlation between nutrients concentrations and nitrifying/denitrifying genes and associated microbes. Acute angle, positive correlation; obtuse angle, negative correlation; right angle, no correlation

Although the relative abundance of bacteria at different sampling sites were distinguished at the phyla level, the heterogeneous aquatic nutrient concentration characteristics can only explain part of the changes in the relative abundance of nitrifiers and denitrifiers, with the total contribution of the first two RDA axes accounted for 30.87% and 27.01% of the variance, respectively. However, TIC concentration and CN ratio were relatively the most influential factors for the relative abundance of nitrifiers and denitrifers (P < 0.05). The relative abundance of Actinobacteria was positively correlated to TIC concentrations and CN ratio, while for Proteobacteria, its relative abundance had negative correlation with CN ratio and positive correlation with TIC concentration (Fig. 8b, c).

Discussion

Reasons for the impact of substrate size

The impact of substrate size on the relative abundance of nitrifying and denitrifying genes can potentially be interpreted by three mechanisms. First, substrate size determines the mobility of the substrates, adjusts the hydrodynamic conditions, and changes availability of the light and nutrients (Arnon et al. 2013), thus affecting the relative abundance of functional genes of the biofilms attached to substrates of different size groups (Fig. 3). Second, the substrate size not only controls biofilm attachment area but also affects the porosity, permeability, and interspace between substrates indirectly (Santmire and Leff 2007). Greater porosity allows higher ingress of fresh water containing oxygen and nutrients through the sediments in some instances, which is important for microbe/substrate reactions and removal of microbial by-products. Third, Suarez et al. (2019) found that the biofilm thickness, closely related to substrate size (Ahmad et al. 2017), played a decisive role in river ecosystem functioning and microbial community compositions. However, we did not measure the thickness of biofilm samples in this study because of the lack of microscopic equipment for mm-level measurement, and we encourage further investigation on the impact of biofilm thickness. However, Santmire and Leff (2007) argued that the effect of substrate size on the bacterial community and abundance is not always evident in field surveys due to the changing environment surround sampling sites. Romaní and Sabater (2001) also found that epilithic biofilms may be less sensitive to the changes of physicochemical parameters in aquatic environments when the composition of autotrophic organisms is complicated and abundant. This explains why some genes in our study showed little difference among size groups nor did the taxonomic compositions or the relative abundance of most nitrifiers and denitrifiers showed significant difference among substrate size groups (Table S3).

Reasons for the impact of substrate heterogeneity in size distribution

Physical habitat heterogeneity of stream ecosystem influences microbial diversity, composition, transportation of active substance, and biogeochemical cycle (Lear et al. 2008; Singer et al. 2010; Keil et al. 2011; Cardinale et al. 2002). In particular, higher heterogeneity of substrate in size distribution reduces the space between particles because smaller particles fill voids created by larger particles. Therefore, the overall porosity is also reduced, prohibiting the transfer of nutrients and oxygen (Singer et al. 2010; Wilson and Dodds 2009). Besides, higher heterogeneity also enhances geomorphological complexity, consequently increases water residence time, and promotes nitrogen removal (Hanrahan et al. 2018). These factors all exert impacts on biofilm microbial communities and finally the ecological process (Besemer 2015; Cardinale et al. 2002). Our results confirmed the role of substrate heterogeneity in affecting the relative abundance by presenting the co-occurrence of high relative abundance of denitrifying genes, microbes, and high heterogeneity (Fig. 5a). For instance, higher relative abundance of species including Pseudogemmobacter bohemicus and Paracoccus zhejiangensis was observed in substrate with high heterogeneity (Fig. 5b). These two distinguished dominant species are significantly more efficient in denitrification under anaerobic conditions (Cydzik-Kwiatkowska. 2015; Liu et al. 2018b; Qu et al. 2016), even though they are capable of aerobic denitrification. In contrast, higher relative abundance of Actinobacteria bacterium was found in sites with low heterogeneity because Actinobacteria bacterium prefers aerobic conditions (Zhang et al. 2023). Hanrahan et al. (2018) and Wang et al. (2021) also suggested that nitrogen removal rate is accelerated as the increase of substrate heterogeneity in size distribution. Considering the crucial role of these two species in total nitrogen removal, we could reasonably deduce that substrate heterogeneity may affect the existence of Pseudogemmobacter bohemicus and Paracoccus zhejiangensis.

Relative importance of aquatic nutrient concentrations and substrate heterogeneity

The Spearman’ correlation analyses showed that aquatic nutrient concentrations were significant (P < 0.05) in affecting the relative abundance of nitrifying genes, while the substrate heterogeneity was insignificant. For the relative abundance of denitrifying genes, nutrient concentrations and substrate heterogeneity were both important for narG (P < 0.05); only NH4+ and TIC concentrations had significant correlations with nosZ (P < 0.01); substrate heterogeneity was the major factor for the relative abundance of nirS (Table S6). In the case of the nitrifiers and denitrifiers, aquatic nutrient concentrations were significantly related to the relative abundance of phyla Verrucomicrobia and Planctomycetes, while the substrate heterogeneity was insignificant (Table S7). In contrast, TOC concentrations and substrate heterogeneity were both important for the relative abundance of Proteobacteria (P < 0.05).

Nitrification/denitrification pathways and potential nitrous oxide (N2O) emission in streams

Using the KEGG pathway database, a nitrogen metabolic network was constructed. We identified eight enzymes that associated with nitrification (i.e., amoAB, hao, nxrAB) and denitrification (i.e., napAB, narGHI, nirSK, norBC, nosZ). Furthermore, we analyzed the relative abundance of the enzymes that differed significantly in groups with different substrate size, heterogeneity, and nutrient concentrations (P < 0.05). For enzymes including nxrAB, narGHI, and nosZ, substrate size, heterogeneity, and aquatic nutrient concentrations all exerted great impact on their relative abundance (Fig. 9). The higher relative abundances of these three enzymes were observed in group with the smallest substrate size (D1) and in HH sampling sites. Reasons for this phenomenon might attributed to that high heterogeneity in size distribution would result in varied microenvironments, thereby affecting enzymes involved in nitrogen cycle (Wilson and Dodds 2009). As to nitrification process, NH4+ concentration posed positive effects on three annotated enzymes (amoABC, hao, nxrAB), and other physicochemical properties like CN ratio, NO3N, and TOC also showed different influence in the relative abundance of enzymes involved in nitrification. Also, heterogeneity and substrate size played a significant role in affecting the abundance of nitrifying genes, especially nxrAB. Meanwhile, in denitrification process, aquatic nutrient concentrations were also significantly correlated to relative abundance of denitrifying genes, like CN ratio to narGHI, and NH4+, NO3, and TIC to nosZ. In addition, relative abundances of napAB, narGHI, nirSK, norBC, and nosZ were impacted significantly by the substrate size and/or heterogeneity (Fig. 9).

Fig. 9
figure 9

Nitrogen metabolic pathways (nitrification and denitrification process) and enzyme analysis in groups with different substrate sizes, heterogeneity, and nutrient concentrations. The color of each histogram corresponds with the color of each gene label. All the relative abundance of functional enzymes differs significantly (P < 0.05). LH, low heterogeneity; HH, high heterogeneity

N2O is an important greenhouse gas with ~ 296 times warming potential of carbon dioxide. By providing microsites for nitrification and denitrification processes, epilithic biofilms are the main N2O source in river ecosystems (Lear et al. 2008; Magalhães et al. 2005; Sanli et al. 2015; Vila-Costa et al. 2014). Denitrifying genes of norB and nosZ are closely related to N2O emission in the process of reducing nitric oxide to N2O (i.e., producing N2O, linked to norB) and converting nitrous oxide to nitrogen (i.e., consuming N2O, linked nosZ) (Magalhães et al. 2008). In this study, the higher relative abundance of norB and lower relative abundance of nosZ was observed in epilithic biofilms attached to substrates with bigger size and higher heterogeneity (Fig. 3 and Fig. 5a), implying the higher N2O emission in streams with such characteristics. This implication could also be confirmed by the varied relative abundances of norBC, nosZ, and narGHI, affected by substrate size and heterogeneity, illustrated in Fig. 9. Considering that substrate size and heterogeneity can be altered by river regulation works and stream habitat restoration projects (Hasselquist et al. 2018; Morley et al. 2008; Stout et al. 2017; Wells et al. 2008), possibility of N2O emission could be increased after these human projects which generally coarsen substrates in streams (Morley et al. 2008).

Limitations of this study

There are several limitations due to the constraints of measuring equipment and in situ sampling. First, previous studies showed that the chemical properties of particle also affect the microbial community compositions and functions (Qin et al. 2017; Welz et al. 2018). In our study, however, we only considered the impact of particle size while ignoring the impact of chemical properties. In the future, chemical properties of substrates should be investigated using XRF to analyze the comprehensive effects on functional gene abundance and microbial community compositions.

Second, we only performed a once-off sampling mainly because the nutrient concentrations of the Shitingjiang River, such as total nitrogen and total phosphorus, did not differ significantly within one season (i.e., dry season, wet season, or mean-flow season, Li et al. (2022)). In addition, the primary focus of our study is the spatial heterogeneity not the temporal variation of the nutrients concentrations. However, the nutrient concentrations can vary over time in natural rivers, which can significantly impact on the abundance of functional genes and microbial community composition, which should be taken into account in the future.

Third, we only collected the overlying water samples to analyze the nutrient concentrations (Richards et al. 2020) for the consistency of adopting aquatic environment of microbes attached to biofilms. However, for the biofilms that attached to < 2-mm particles, pore water can be a more direct and accurate reflection of the environments of microbes (Drummond et al. 2017). We encourage pore water sampling for better investigation of the correlation with aquatic nutrient concentrations.

Conclusion

Correlations of the relative abundance of nitrifying/denitrifying genes and their associated microbes in epilithic biofilms with substrate properties and aquatic nutrient concentrations were analyzed in the Shitingjiang River. We found that nitrifiers/denitrifiers were influenced by substrate heterogeneity and aquatic nutrient concentrations rather than substrate size. For nitrifying genes, aquatic nutrient concentrations were the main factors that affected their relative abundance, while for the denitrifying genes, substrate size and heterogeneity both exerted great impacts, especially for those genes and dominant species connected with N2O generation. Since nitrogen removal in the form of N2O tends to take place in more heterogeneous streams with larger substrates, river restoration and regulation projects which usually lead to coarser and more heterogenous substrates possibly increase N2O emission. Therefore, the relative abundance of key functional genes related to N2O production and consumption should be monitored after river projects in the future.