Geochemical factors of the QTP rivers
The QTP rivers had lower concentrations of W_N (0.98 ± 0.50 mg L− 1), W_NH4+ (0.10 ± 0.02 mg L− 1) and W_NO3− (0.49 ± 0.40 mg L− 1), but higher dissolved organic carbon to total nitrogen (DOC:W_N) ratios (12.56 ± 45.58 mg L− 1) in the overlying water than did the other global rivers and streams [60, 61] (Supplementary Table 2). The TP and total carbon to total nitrogen (C:N) ratios of the QTP river sediment and biofilm were much higher and total nitrogen to total phosphorus (N:P) ratios were much lower than other aquatic systems in the world [39, 62–65] (Supplementary Table 3). Sediment samples from the QTP rivers had lower TC (26.06 ± 24.31 g kg− 1) and TN (1.08 ± 0.88 g kg− 1) concentrations but higher TOC (14.18 ± 14.17 g kg− 1) and TS (0.81 ± 0.92 g kg− 1) concentrations than biofilm samples (Supplementary Table 3). All of the QTP river sediment and biofilm samples exhibited C:N ratios surpassing the Redfield ratio of 5.72:1 (mass ratio) [66] (Supplementary Table 1), with average C:N ratios of 25.17 in the sediment and 15.12 in biofilm samples. Additionally, all of the QTP river sediment samples and 95% of the biofilm samples had N:P ratios less than the Redfield ratio of 7.2:1 (mass ratio) [66] (Supplementary Table 1), with an average N:P ratio of 2.29 in the sediment and 2.82 in the biofilm samples. Taken together, both the high C:N ratio and low N:P ratio indicate a marked N deficiency in the rivers of the QTP. The low external input of N relative to C and P might be beneficial for biological nitrogen fixation in QTP rivers. Furthermore, more than half of the sediment samples (55%) and biofilm samples (57%) showed total carbon to total phosphorus (C:P) ratios less than the Redfield ratio of 41.1:1 (mass ratio) (Supplementary Table 1), suggesting an excess of phosphorus [66]. Commonly, P is considered an essential nutrient that controls the growth of diazotrophs in freshwater [27], but studies have also shown that an elevated P supply does not increase the rate of terrestrial N fixation [67] and the high P bioavailability further leads to the limitation of other nutrients on N fixers [68]. Therefore, the effect of high phosphorus concentrations on the biological nitrogen fixation process in QTP rivers needs further in-depth analysis.
Atmospheric pressure decreased dramatically from 91.17 kPa to 59.09 kPa as the altitude increased from 882 to 4,510 m (Supplementary Table 1). Contrarily, concentrations of TC (r = 0.38, p = 0.0065; Fig. 1a), TOC (r = 0.32, p = 0.020; Fig. 1b), TN (r = 0.33, p = 0.017; Fig. 1c) in the biofilm and sediment samples, as well as NH4+ concentrations in sediment samples (r = 0.38, p = 0.041; Fig. 1d) strongly increased with altitude. In addition, the C:P ratio (r = 0.33, p = 0.018; Fig. 1e) and N:P ratio (r = 0.35, p = 0.012; Fig. 1f) in both biofilm and sediment also demonstrated significant positive relationships with altitude.
The diversity and community composition of diazotrophs in QTP rivers
High-throughput sequencing of diazotrophs yielded 1,228,440 high-quality sequences from sediment and 520,960 high-quality sequences from biofilm samples. These sequences were grouped into 7,008 and 5,143 operational taxonomic units (OTUs), respectively. The α diversity, as indicated by both the Chao1 and Richness indices, of the diazotrophic community was greater in the sediment than in the biofilms (p < 0.050) (Fig. 2a-b). In addition, the α diversity of the diazotrophic communities was greater at altitudes of 3000–4000 m and 4000–5000 m than at 0-3000 m (p < 0.05 for sediment but not for biofilm) (Fig. 2c-f), and there were positive correlations between the α diversity of diazotrophic communities and altitude (sediment: r = 0.47 ~ 0.48, p = 0.008 ~ 0.011; biofilm: r = 0.13 ~ 0.23, p = 0.30 ~ 0.57; Fig. 2g-h). Similarly, the α diversity of the sediment diazotrophic communities also significantly increased with decreasing atmospheric pressure (r = -0.46 ~ -0.38, p < 0.050; Fig. S1a-b) and overlying water temperature (r = -0.62 ~ -0.61, p < 0.001; Fig. S1c-d). Furthermore, the α diversity of diazotrophic communities in both the sediment (r = -0.46 ~ -0.42, p < 0.050) and biofilm (r = -0.6 ~ -0.52, p < 0.050) samples significantly decreased with increasing overlying water NH4+ concentration (Fig. 2i-j), and the α diversity of biofilm diazotrophs was positively linked to the OC:N ratio (total organic carbon to total nitrogen) (r = 0.50 ~ 0.55, p < 0.050; Fig. 2k-l), suggesting that N-deficient conditions favoured diazotroph community diversity.
Diazotrophic communities were predominantly composed of non-cyanobacterial diazotrophs across all samples, which were mainly from the phyla Proteobacteria (sediment: 62.03%; biofilm: 67.64%) and Actinobacteria (sediment: 9.54%; biofilm: 0.68%) (Fig. S2). The relative abundances of Cyanobacteria, Verrucomicrobia and Euryarchaeota were minor, accounting for less than 1% of the total sequences, with sediment samples exhibiting more Euryarchaeota (sediment: 0.153%; biofilm: 0.002%) and less Cyanobacteria (sediment: 0.021%; biofilm: 0.229%) than biofilm samples. The Proteobacteria included Deltaproteobacteria (B: 23.98%; S: 21.30%), Betaproteobacteria (B: 21.86%; S: 4.87%) and Alphaproteobacteria (B: 2.54%; S: 2.63%) (Fig. S2). Among the six phylogenetic nifH clusters [69], the nifH gene sequences in the QTP river mainly included Cluster I (aerobic/facultative anaerobic Cyanobacteria and Proteobacteria) and Cluster III (anaerobic bacteria/archaea). No Cluster II sequences were found in the sediments and they represented less than 1% of the biofilms. At the genus level, the actinobacterial member Frankia, which is crucial for N-fixing symbiosis and prevalent in N-limiting soils [70], was the most abundant (9.45%) in the sediments, followed by Geobacter (4.40%), Dechloromonas (2.39%), Skermanella (1.62%) and Anaeromyxobacter (1.08%) (Fig. 3a). In the biofilms, Dechloromonas was the most abundant genus (12.82%), followed by Desulfomicrobium (2.15%), Anaeromyxobacter (1.86%), Geobacter (1.57%) and Sinorhizobium (1.07%) (Fig. 3a).
Nonmetric multidimensional scaling (NMDS) analysis further revealed significant variations in diazotrophic community composition across altitudinal gradients (0-3000 m, 3000–4000 m, 4000–5000 m; stress = 0.187, p = 0.007; Fig. 3b) in the QTP river sediment and biofilm. With increasing altitude, there was an increase in the relative abundance of diazotrophs affiliated with Deltaproteobacteria, such as Geobacter, Desulfomicrobium and unclassified_o_Desulfuromonadales (Fig. 3c). Furthermore, random forest model analysis revealed that the relative abundances of Skermanella, Herbaspirillum, Azohydromonas, Sideroxydans, Xanthobacter, Sphingomonas, Azotobacter and Nostoc in the QTP rivers were significantly affected by altitude (%IncMSE > 5, p < 0.050; Fig. S3). The indicator species analysis further confirmed that the relative abundances of these diazotrophs can be considered key indicators of the influence of altitude on the composition of diazotrophic communities across the QTP rivers (p < 0.050, Supplementary Table 4).
We further examined the underlying geochemical factors explaining the variations in the diversity and composition of the diazotrophic community in the sediments and biofilms by the Mantel test (Fig. 4a). Among all the geochemical properties, TOC was the most important factor influencing the composition of diazotrophic communities in both biofilms and sediments (p < 0.050; Fig. 4a). In addition, the OC:N ratio (p = 0.036), altitude (p = 0.050), and overlying water temperature (p = 0.008) were other essential factors influencing diazotrophic communities in sediments, while TN (p = 0.007) and TC (p = 0.013) were the key factors shaping diazotrophic communities in biofilms (Fig. 4a).
Molecular ecological networks of the diazotrophic community along altitudinal gradients
Molecular ecological networks (MENs) were constructed for the sediment samples from the three altitudinal gradients (Fig. 4b). The MENs for the different altitudinal gradient samples exhibited the typical topological properties of scale-free (power-law R2 of 0.562 ~ 0.871), small world (average path distance of 4.475 ~ 13.382), and hierarchical (average clustering coefficient of 0.122 ~ 0.331) (Supplementary Table 5). In general, the empirical MENs were significantly different from the random MENs (p < 0.001; Supplementary Table 6), suggesting that the constructed networks were robust. Together, the architecture of these networks enables efficient communication between network members, which has important implications for diazotrophic community dynamics in response to spatial variations. Among the 11 different network topological properties, the total number of nodes and links in the network for the 4000–5000 m samples outnumbered those in the networks for the 0-3000 m and 3000–4000 m samples (Supplementary Table 5). In addition, the highest average path distance (GD) and harmonic geodesic distance (HD) were observed in the MEN for 4000–5000 m samples when compared to those of the 0-3000 m and 3000–4000 m samples. The average degree (avgK), average clustering coefficient and geodesic efficiency (E) decreased with altitude (Supplementary Table 5), revealing a less connected network structure. Moreover, the ratio of negative links to total links also increased with altitude, and even accounted for more than 80% of all links in the 4000–5000 m samples, suggesting that the diazotrophic community in the 4000–5000 m samples tended to be more coexcluding than cooccurring. Consistently, the modularity also presented an increasing trend with altitude, and the number of modules was highest for MENs from 4000–5000 m, suggesting a more stable network structure among diazotrophs from 4000–5000 m. All the above results collectively indicated that the diazotrophic network is more complex and stable in samples from higher altitudes in QTP rivers. Organic carbon and the C:P ratio were identified as the dominant parameters linked with the main module (the module that contained most taxa in the network) of the network in the 0-3000 m samples (p < 0.010; Supplementary Table 7), while altitude and atmospheric pressure were identified as the main factors linked with the main modules of the networks in the 4000–5000 m samples.
N fixation potential in the QTP rivers
The nifH gene frequency ranged from 1.59 × 106 to 8.70 × 108 copies g− 1 in the sediment, with an average of 2.57 ± 2.60 × 108 copies g− 1 (Supplementary Table 8). In the biofilm, the nifH genes varied from 1.18 × 105 to 2.37 × 108 copies g− 1, with an average of 7.76 ± 6.59 × 107 copies g− 1 (Supplementary Table 8). There was a positive correlation between the α-diversity of diazotrophs and nifH gene abundance in the sediment (r = 0.58, p = 0.001; Fig. 5a), confirming the close association between N fixation functions and the phylogeny of diazotrophs. The abundance of the nifH gene in both the sediments and biofilms was positively correlated with altitude (sediment: r = 0.41, p = 0.026; biofilm: r = 0.50, p = 0.019; Fig. 5b). Among the three altitudinal gradients, the nifH gene abundance was greater at 4000–5000 m than at 0-3000 m and 3000–4000 m in both the sediment and biofilm samples, suggesting that the diazotrophic N fixation potential was greater at higher altitudes in QTP rivers (Fig. S4 a-b). In addition, the nifH gene abundance had a positive relationship with TOC concentration in both the sediment and biofilm (sediment: r = 0.41, p = 0.026; biofilm: r = 0.47, p = 0.027; Fig. 5c), and that in the biofilm was also positively correlated with the overlying water DOC concentration (r = 0.48, p = 0.037; Fig. 5d). In addition, the nifH gene abundance in the sediment was positively correlated with the C:P ratio (r = 0.41, p = 0.029; Fig. 5e) and the N:P ratio (r = 0.40, p = 0.039; Fig. 5f).
The potential N fixation rates of both the sediment and biofilm exhibited a considerable range, varying from 0.01 to 14.39 nmol N g− 1 d− 1 in the sediment samples (n = 29), and from 0.22 to 20.47 nmol N g− 1 d− 1 in the biofilm samples (n = 22) (Supplementary Table 9). The average N fixation rate of the sediments (2.29 ± 3.36 nmol N g− 1 d− 1) was similar to that of the biofilms (2.10 ± 4.31 nmol N g− 1 d− 1) (Supplementary Table 9). In accordance with the difference in α diversity and nifH gene abundance, N fixation rates also exhibited a general increase among the altitudinal gradients in both the sediments and biofilms (Fig. S4 c-d). Consequently, the maximum rates of N fixation were recorded at high-altitude sites (> 4000 m), characterized by high organic carbon content but lower dissolved oxygen concentration (Supplementary Table 1).
Linear regression analysis revealed significant correlations between N fixation rates and geochemical factors. The N fixation rates in both the sediment and biofilm samples increased significantly with increasing TC (sediment: r = 0.63, p < 0.001; biofilm: r = 0.48, p = 0.025), TOC (sediment: r = 0.54, p = 0.0026; biofilm: r = 0.74, p < 0.001) and the N: P ratio (sediment: r = 0.56, p = 0.0015; biofilm: r = 0.42, p = 0.049) (Fig. 5g-i). In addition, the overlying water DOC concentration (r = 0.56, p = 0.0014), C:P ratio (r = 0.55, p = 0.0022), and NO3− concentration (r = 0.57, p = 0.0012) were also significantly positively correlated with the N fixation rate in the sediment (Fig. 5j-l).
To further assess the direct and indirect effects of geochemical factors on diazotrophic diversity and biological N fixation potential, we employed structural equation modelling (SEM) to determine the most critical geochemical factor and the interactions between different geochemical factors (Fig. 6a). The results showed that TOC and overlying water DOC had the strongest total effects (direct plus indirect) on N fixation rates. In addition, altitude can indirectly affect N fixation rates through its strong positive effect on TOC. This result corresponded to the highest N fixation rates observed at sites with high altitudes and TOC concentrations (such as sites SLX and LBT). Furthermore, altitude indirectly increased N fixation rates by changing other variables, such as TC concentration, the C:P ratio and the N:P ratio (Fig. 1a, e, f).
To identify specific diazotrophic genera as predictors for predicting nifH gene abundance and N fixation rates, we evaluated the percentage increase in the mean squared error (MSE) of each predictor via a random forest model. In this model, a higher MSE% value underscored the importance of these genera, highlighting their pivotal role in N fixation processes. We found that some diazotrophic genera with high relative abundances, such as Dechloromonas and Geobacter, were key impactors in determining N fixation rates (Fig. S5). Moreover, Geobacter was also sensitive to altitude, and its relative abundances was highest at altitudes ranging from 4000–5000 m (Fig. 3c). However, the relative abundances of some genera did not correlate with N fixation activity. For example, although Frankia had the highest average relative abundance in the sediment samples, its impact on nifH gene abundance and N fixation rates was relatively minor. In contrast, less abundant diazotrophs, such as Desulfovibrio, Pseudodesulfovibrio, and Candidatus_Accumulibacter were critical for affecting N fixation rates (Fig. S5). These results suggested the essential roles of diazotrophic community composition and diversity in controlling nifH gene abundance and N fixation activities in QTP rivers.