Large-scale spatial patterns of riverine communities: niche versus geographical distance

Freshwater ecosystems are among the most threatened ecosystems on Earth. Effective conservation strategies are essential to reverse this trend and should be based on sound knowledge of biodiversity patterns and the main drivers structuring them. In this study, we investigated the role of environmental and dispersal-connectivity controls on freshwater diatom and fish communities’ variability. We used 441 biological samples obtained from Spanish biomonitoring datasets, which cover a highly variable environmental gradient across the national river network. We compared the taxonomic and trait-based spatial dependency of the two biotic groups using distance-decay relationships and variation partitioning with spatially constrained randomisations. Our findings showed that most of the diatoms and fish biological variation was attributed to pure spatial and spatially structured environmental variation. Compared to diatoms, fish community composition presented a stronger spatial dependency, likely because of their weaker dispersal ability. In addition, broad-scale environmental characteristics showed a higher predictive capacity for fish assemblages’ variation. Trait-based similarities presented lower spatial dependency than taxonomic datasets, indicating that they are less susceptible to dispersal-connectivity effects. These findings contribute to understand the mechanisms underlying river community assembly at large spatial scales (i.e., at and beyond the river network) and point out the importance of dispersal-connectivity processes, which are usually neglected in traditional niche-based biomonitoring programmes but can influence their outcomes (e.g., masking the detection of anthropogenic impacts). Therefore, the integration of the dispersal-connectivity component, as well as information on organisms’ dispersal abilities, are crucial when establishing effective conservation objectives and designing biomonitoring strategies.


Introduction
Streams and rivers sustain a broad range of habitats and biodiversity, supporting the delivery of valuable ecosystem services for human societies (Harrison et al. 2010;Vörösmarty et al. 2010;Grizzetti et al. 2016). Despite this, they face severe anthropogenic threats worldwide, such as effluent discharge, introduction of exotic species, and flow regime alteration with dams and reservoirs (Dudgeon et al. 2006;Reid et al. 2019). These increasing pressures do not change only the primary drivers defining riverine species' niche (e.g., temperature, water chemistry, benthic substrate, river morphology), but also lead to alterations in the connectivity of habitats, affecting their spatial dynamics at large spatial scales (McCluney et al. 2014).
To date, global trends in riverine ecosystem degradation call for urgent implementation of sustainable resource management, which should be underpinned by the most updated understanding of cause-effect relationships between anthropogenic impacts, biodiversity, and ecological processes (Dudgeon et al. 2006). In this regard, water management decisions are informed by cost-effective biological assessments (Bonada et al. 2006), which are required by the European Water Framework Directive (WFD; European Commission 2000) and environmental legislation elsewhere (e.g., National Water Initiative in Australia, Clean Water Act in the USA).
Recent advances in spatial ecology look at the influence of the riverine network structure on biological patterns and processes shaping metacommunities (Altermatt and Fronhofer 2018;Tonkin et al. 2018;Erős and Lowe 2019), and new techniques (e.g., virtual watersheds; Barquín et al. 2015) facilitate the design and improvement of monitoring approaches (Siqueira et al. 2014;Heino et al. 2015). Riverine biological assemblages differ in their dispersal abilities and ecological preferences, and, at large spatial extents (i.e., scale at which most monitoring programmes are designed), they can be shaped by different factors. For example, good dispersers (e.g., diatoms, flying macroinvertebrates) are usually driven by their niche (i.e., environmental characteristics; Hájek et al. 2011;Astorga et al. 2012), while weak dispersers (e.g., fish) are more constrained by geographical distances and connectivity among river reaches (Shurin et al. 2009). In this context, body size seems to be a good proxy of the dispersal capacity and, as such, an important biological characteristic to evaluate the contribution of environmental versus dispersal-connectivity factors in determining riverine assemblages (Astorga et al. 2012;De Bie et al. 2012). Moreover, functional traits have been recognised as an alternative to taxonomy, as they should be more dependent on the niche than on dispersal-connectivity constraints and allow a deeper understanding of stressor's impacts and mechanisms (Gayraud et al. 2003;Menezes et al. 2010;Vandewalle et al. 2010;Chen and Olden 2018).
Despite the rapid development of metacommunity concepts and the recognised importance of dispersal-connectivity processes structuring biological communities in rivers (Leibold et al. 2004), the vast majority of biological assessment programmes and biotic indices consider that abiotic environmental conditions (i.e., species sorting) are the main, if not solely, factors controlling community assembly (Heino 2013; but see Cid et al. 2020). Thus, anthropogenic impacts are detected based on the deviation from reference conditions (Downes et al. 2002;Siqueira et al. 2014). However, at large spatial extents (i.e., multiple drainage basins), the importance of dispersal-connectivity processes will likely increase (Verleyen et al. 2009), potentially masking anthropogenic environmental impacts (Heino 2013;Vilmi et al. 2016).

3
The distance-decay relationships (DDR; Nekola and White 1999) have been applied in a range of environments, organisms, and spatial extents (Brown and Swan 2010;Soininen et al. 2007) to investigate geographical distance effects on communities, and provide important insights on spatial dynamics, especially for fragmented and highly dynamic freshwater habitats (Cañedo-Argüelles et al. 2015;Cid et al. 2020). The decay of community similarities over geographical distances can be first attributed to niche differences, as environmental variables tend to be spatially autocorrelated (Legendre and Fortin 1989;Nekola and White 1999), and with spatial processes (e.g., organisms' dispersal, spatial configuration, isolation of habitats, mass effect ;Hubbell 2001;Soininen et al. 2007) also contributing to it. Likewise, variation partitioning is a quantitative method frequently used in ecology to assess the likelihood of predictors (e.g., environment, geographical distances) in explaining community patterns . It allows partitioning the variance into uniquely and jointly explained fractions and inferring underlying community assembly processes (Diniz-Filho et al. 2012;Brown et al. 2017). However, since dependency between biological communities' distribution, environment, and space is extremely common, the method should be applied carefully, as it can fail to control for spatial autocorrelation biases, generating spurious correlations (Gilbert and Bennett 2010;Tuomisto et al. 2012).
To our knowledge, the importance of environmental and dispersal-connectivity factors in determining the taxonomic and functional structure of multiple river biological communities at large spatial scales (i.e., multiple neighbouring river networks) has been rarely evaluated simultaneously (but see Henriques-Silva et al. 2019;Keck et al. 2018). In this study, we selected diatoms and fish, organisms with contrasting dispersal abilities, to investigate the relative importance of environmental-(i.e., niche) and spatial-related (i.e., dispersal-connectivity) mechanisms on community composition based on taxonomy (C-TX) and community structure based on functional traits (C-FT) across continental Spain. We expect that (1) the importance of environmental and dispersal-connectivity processes will differ between diatoms and fish, with (2) dispersal-connectivity processes being a key determinant for fish C-TX while (3) environmental factors being more relevant for diatom C-TX (i.e., dispersal ability and spatial control inferred from body size; De Bie et al. 2012). In addition, we expect that (4) C-FT will have a lower spatial dependency in comparison to C-TX, as functional traits should be more responsive to niche characteristics than to dispersal-connectivity dynamics (Hoeinghaus et al. 2007). Finally, we will highlight the implications of our findings for riverine biomonitoring programmes.

Study area
The study area comprises continental Spain ( Fig. 1; 40° 23′ N, 3° 33′ E), a country with great environmental variability within the Atlantic and the Mediterranean zones. The relief is characterised by an extensive high inland plateau (average of 650 m.a.s.l.) surrounded by relatively high mountain ranges: the Cantabrian Range in the north, the Iberian system in the east, and the Sierra Morena in the south. Outside this central plateau, the Pyrenees on the north-eastern border, and the Betico system in the southeast, are the highest mountain ranges, with peaks reaching 3,400 m.a.s.l. (Rivas-Martínez et al. 2004;Peñas and Barquín 2019).

3
This complex orography plays a crucial role in defining the climate and hydrography. Five Köppen-Geiger climate zones are distributed along the area: mountain climate in high altitudes, with cold winters and abundant precipitations (annual averages reaching 3000 mm); the oceanic climate in the northwest region; hot steppe climate in the southeast, with minimum rainfall in Spain (annual averages lower than 150 mm); and several Mediterranean climate variations, with dry and hot summers (Rivas-Martínez et al. 2004;AEMET and IMP 2011). Thus, the twelve main catchments in the study area are conditioned by the combination of relief and climatic features, causing high variability in hydrological patterns (Peñas et al. 2014).

Characterisation of biological communities and functional traits
In this study, we used the national information exchange system on the status and quality of continental waters, called NABIA (Spanish Royal Decree 817/2015 on Water Policy; BOE 2015), compiled and provided by the Spanish Ministry for the Ecological Transition (MITECO). This database provides information on biological indicators from monitoring campaigns carried out since 2008 for assessing the ecological status and water quality of all water bodies in the country in compliance with the WFD (European Commission 2000).
From the NABIA database, we selected diatom and fish samples collected between May and October to maximise the spatial coverage while reducing "noise" caused by intraannual variability, as done in previous studies (e.g., Leathwick et al. 2005). The communities were surveyed annually between summer and early autumn depending on meteorological and hydrological conditions. Regarding diatoms, following the standard procedure UNE-EN13946:2014 (CEN 2014a), five to ten cobbles were selected randomly from the 100 100km 0 A tla nt ic O ce an Fig. 1 Study area (505,000 km 2 ) and sampling site selection, comprising a total of 441 samples benthos (ca. 100 cm 2 of exposed surface area) at a depth of ca. 10 cm to ensure that they were not exposed to air in the previous 4 weeks and that they were placed in the euphotic zone. Areas of heavy shade and close to the bank were avoided, as well as zones of slow current (approx. ≤ 20 cm s −1 ). Then, the upper part of the substratum was scrubbed with a dishwasher brush. Aliquots of the diatom samples collected were digested with hydrogen peroxide and permanent slides were mounted with Naphrax®. The material was decanted in a sample bottle and preserved using formaldehyde. From each sample, 400 diatom valves were identified in laboratory using a microscope (×1000 magnification) at the lowest feasible taxonomic level, according to the standard procedure UNE-EN 14407:2014 (CEN 2014b). Taxonomic identification was based on Delgado et al. (2013), Delgado and Pardo (2015), Lange-Bertalot (1986-1991), (2004), Krammer (1997a, b), Lange-Bertalot (1993, 2001, Lange-Bertalot and Krammer (1989), Levkov (2009), Novais et al. (2009), Prygiel and Coste (2000, and Trobajo et al. (2013).
For fish communities, a single-pass sampling was performed using a portable electric fishing device (current generation 300-600 V, up to 1.5 A) in a representative area of the wadeable stream (ten times the average width of the stream and a minimum of 100 m 2 ), following the standard procedure UNE-EN 14011:2003(CEN 2003. After the pass removal, the captured fish were kept in oxygenated boxes, anaesthetised, counted, and identified at the species level. The fish were then released back to the stream alive after a recovery period. Although macroinvertebrates are also widely used in the Spanish bioassessment programmes, we did not include them in our analysis due to their coarse taxonomic resolution (i.e., mainly at the family level) required for computing the Iberian Biological Monitoring Working Party (IBMWP) index (Alba-Tercedor et al. 2002).
Only samples surveyed in river reaches catalogued as 'good' or 'very good' ecological status were retained. The ecological status was determined using biological, physico-chemical, and hydromorphological characteristics and reference conditions for surface waters, as specified in the Spanish Hydrological Plan 2015-2021 within the European WFD (BOE 2015). Further, only sites unaffected by local anthropogenic pressures such as dams, embankments, or significant water abstractions upstream were kept for subsequent analyses. This site selection, covering only minimally disturbed streams, reduced the confounding effect of other factors (e.g., stressors), such as water pollution, hydromorphological pressures, or the presence of dams and reservoirs. After applying these criteria, we retained 177 sampling sites for diatoms and 264 for fish ( Fig. 1).
Diatoms and fish were identified at the species level (see Tables S1 and S3 in Supplementary Information). The abundance of taxa was averaged in sites surveyed for multiple years to obtain a site-specific assemblage composition, following previous studies (Paavola et al. 2003;Filker et al. 2016). Due to the high number of diatom species identified, we eliminated rare taxa (those representing less than 2% of total sampled individuals when taking into account the total number of occurrences; Lavoie et al. 2009). Then, in the two biotic groups, C-TX was determined based on the presence/absence of each taxon.
To characterise C-FT, we assigned diatoms' species to ecological guilds, size (biovolume), and life forms according to Rimet and Bouchez (2012) (see Table S2 in Supplementary Information). For fish, we assigned the species to trait categories describing body size, feeding habits, tolerance to stressors, habitat use, and migration (see Table S4 in Supplementary Information), based on Iberian species information obtained from Doadrio (2002), Schmidt-Kloiber and Hering (2015), and Cano- Barbacil et al. (2020). It is important to note that trait categories can overlap and species may belong to multiple trait categories (e.g., Amphora pediculus is considered, at the same time, a low profile, pioneer, adnate, 1 3 and non-colonial species; Phoxinus bigerri is a non-migratory, omnivorous, rheophilic fish species inhabiting the water column). Then, for both organisms, the relative abundance corresponding to each trait category was calculated based on the abundance of the taxa contributing to it.

River network and environmental information
River reaches were characterised using hydrological and environmental information integrated within the virtual watersheds composing the Spanish river network (Barquín et al. 2015), constructed using flow direction inferred from a 10-m digital elevation model. Environmental variables describing topography, climate, land use and land cover, and geology (Table 1) were obtained from national and regional databases (Peñas and Barquín 2019).

3
To characterise the flow regime, we used a set of non-correlated synthetic hydrological indices (SI NAT ). They were calculated based on the normalised daily flow series recorded in natural flow gauges and predicted to all river reaches in the country using Random Forest models (Peñas and Barquín 2019). The four SI NAT (Table 1) explained 84% of the total hydrological variance and set the critical natural hydrological patterns in continental Spain (Peñas and Barquín 2019).

Data analyses
We used DDR (Nekola and White 1999;Soininen et al. 2007) to assess the effects of geographical distances and environmental characteristics on diatoms and fish assemblages. We analysed the dispersal-connectivity and environmental control in both biotic groups and their C-TX and C-FT using the DDR linear regression coefficients (slope), which described the rate of species turnover, and the initial similarities (intercept), which described the species turnover at small spatial extents (Astorga et al. 2012).
The DDR was estimated regressing biological similarities as a function of geographical and environmental distances, with the Jaccard index for C-TX pairwise biological communities similarities and Bray-Curtis distances for C-FT. Since our study area was composed of multiple unconnected river networks, we computed Euclidean distances based on samples' latitude and longitude, ranging from 1 to 1,031 km. Similarly, to compute environmental distances, the environmental (topography, climate, geology, and LULC) and hydrological variables (Table 1) were first standardised (zero mean and unit variance), as they had different measurement units and ranges, and pairwise Euclidean distances between all sites were calculated. We used partial correlation analysis (Legendre and Legendre 1998) to factor out the effect of the geographical distances on environmental variables and test for independent correlations between environmental distances and the biological similarities. Given the different ranges described by geographical and environmental distances, we rescaled both distances to values between 0 and 1.
Then, to quantify and compare the relative contribution of environmental and geographical distance-related processes to the diatom and fish C-TX and C-FT variability, we used variation partitioning ). The biological variation was decomposed into four fractions: the variation explained (1) uniquely by non-spatial environmental variation, i.e., species variation explained by the environmental dataset (Table 1: topography, climate, geology, LULC and hydrology) independently of any spatial structure, (2) uniquely by spatial patterns (i.e., geographical distance among sites) that are not shared by the environmental dataset, (3) by the spatial patterns in community data that are shared by the environmental dataset (i.e., shared or spatially structured environmental variation), and (4) the unexplained variation (Borcard et al. 1992). We used Moran's eigenvector maps (MEMs; Dray et al. 2006) as a proxy for the diatom and fish C-TX and C-FT spatial distribution patterns (i.e., geographical distances). The MEMs are linearly independent vectors capable of describing a wide range of spatial scales (Griffith and Peres-Neto 2006) and are linked to a spatial weighting matrix (SWM), which determines the spatial relationships between the sampled sites (Bauman et al. 2018a). We tested three graph-based schemes (Gabriel graph, relative neighbourhood graph, and minimum spanning tree) with two weighting matrices (binary and linearly decreasing as a function of pairwise-site distances) as potential SWM (Benone et al. 2020). All positively spatially correlated MEMs for all SWM candidates were computed, as a subset of MEMs is not able to remove the spatial autocorrelation from model residuals and may lead to inflated type I error of the 1 3 pure spatial fraction (Peres-Neto and Legendre 2010; Clappe et al. 2018). Then, an optimisation procedure (Bauman et al. 2018b) selected the SWM which MEMs yield to the maximisation of the adjusted R 2 (see detailed explanation in Table S7 in Supplementary  Information). Regarding environmental predictors, we ran a forward selection procedure to retain the relevant environmental variables with a double-stopping criterion (Blanchet et al. 2008) to avoid overestimation of explained variance.
Finally, Moran Spectral Randomisation (MSR; Wagner and Dray 2015; Clappe et al. 2018) was applied to correctly account for spatial autocorrelation in the variation partitioning. This method performs spatially constrained randomisations in variation partitioning and maintains the data's spatial characteristics, avoiding type I error inflation and removing spurious correlations (Clappe et al. 2018).
All statistical analyses were performed in R software (R Core Team 2020) using the packages vegan (Oksanen et al. 2019) and adespatial (Dray et al. 2020).

Similarity decay over geographical and environmental distances
The biological similarities decreased with geographical and environmental distances in both fish and diatom communities ( Fig. 2 and Table S5 in Supplementary Information). Diatoms presented lower initial similarities compared to fish, indicating higher beta diversity at small spatial scales. Fish biological similarities showed steeper decay rates when compared to diatoms (1.5 and 2.5 times steeper over geographical distances for C-TX and C-FT, respectively; Fig. 2a, d), indicating a higher explanatory capacity of the environmental variables and spatial patterns for fish. Fish C-TX similarities presented a large number of "zero" (24% of samples) or "one" (5% of samples) values, showing that these assemblages had no species in common or shared all species, respectively. In both organisms, the C-FT (Fig. 2, in grey) showed lower decay rates (-57% in diatoms and -38% in fish), higher initial similarities and higher scattering over geographical distances when compared to the 1 3 C-TX, indicating that geographical distances exerted a lower control on community similarity when using functional traits.
The geographical and environmental distances among samples showed positive correlations (see Fig. S1 in Supplementary Information), suggesting that environmental characteristics were spatially correlated. In both organisms, the DDR over environmental distances (Fig. 2b, e), compared to the DDR over geographical distances, showed higher initial similarities and decay rates (an increase of 100% for diatoms and 60% for fish, on average). In contrast, after splitting out the spatial component (Fig. 2c, f), the decay rates were 54% higher for diatoms and 7% lower for fish in relation to the DDR over geographical distances, indicating that spatial patterns exerted an important control on fish assemblage variation.

Contribution of environment versus dispersal-connectivity factors
The variation partitioning (Fig. 3 and Table S6 in Supplementary Information) showed that environmental variables and MEMs explained larger fractions of the biological variation in fish assemblages (50.4%, on average) when compared to diatoms (31.1%), in agreement with the DDR analysis. The shared fraction between environment and spatial patterns (i.e., spatially structured environmental fraction) corresponded to the major proportion of explained variation in most cases (see also Fig. S2 in Supplementary Information).
Environmental variables and MEMs, together, accounted for 25.5% and 36.7% of the diatoms' taxonomical and functional variability, respectively (Fig. 3a, b). The Fig. 2 Biological similarity decay for diatoms (a to c) and fish (d to f) over geographical distances, environmental distances, and environmental partial residuals after removing the spatial component. We used Jaccard index among pairs of samples for taxonomical community composition (in blue) and Bray-Curtis similarities for functional community structure (in grey). Equations were obtained with simple linear regression (see also Table S5 in Supplementary Information) contribution of the pure spatial component was similar in both cases, corresponding to 52.4% of the total explained variation in diatom C-TX and 52.8% in C-FT. The spatially structured environmental contribution was slightly higher when C-FT was considered (47.2% of the total explained variation, in comparison to 45.7% for C-TX). The fraction of community variability attributed to the non-spatialized environment was negligible in both cases.
Environmental variables and MEMs, together, accounted for 54.3% and 46.6% of the explained variation in fish C-TX and C-FT, respectively (Fig. 3c, d). In contrast to diatoms, the pure environmental fraction had small but significant contributions to fish C-TX and C-FT variability. When considering fish C-TX, the contributions of pure spatial and spatially structured environmental fractions were similar. In fish C-FT, the spatially structured environmental fraction explained twice the variation of the pure spatial fraction, suggesting that fish functional traits are less subject to dispersal-connectivity processes and are more responsive to environmental characteristics. 0.5% 13.4%*** 11.7% Env Spatial (n.s.) 0% Fig. 3 Variation partitioning of the environmental and spatial components driving the taxonomical community composition and functional traits of diatoms (a, b) and fish (c, d). Fractions represent pure environmental (Env), spatialized environmental (shared fraction), and pure spatial (Spatial) fraction after MSR corrections. Significance of testable fractions was determined with ANOVA of RDA models; p-values are represented as *** ≤ 0.001; ** ≤ 0.01; * ≤ 0.05; n.s. not significant (see also

Discussion
This study indicates that environmental and spatial controls differ in their contribution to structuring riverine biological communities. Geographical distances exerted a higher control on fish (low dispersal ability) than on diatom (high dispersal ability) community similarities, while the non-spatially structured environment showed minimal contributions to both organisms' variability. Finally, community similarity based on functional traits showed a higher influence of environmental factors than geographical distances.

Differences between biotic groups: the effects of distance and dispersal capacity on biological assemblages
Our findings showed a decrease in biological similarities over geographical and environmental distances, suggesting that diatom and fish assemblages are jointly driven by niche (e.g., environmental filtering; Leibold et al. 2004) and dispersal (Hubbell 2001) processes. The differences observed in initial similarities, decay rates, and the fraction of variation attributed to environment and space indicated that environmental and distance-related dynamics share the controlling the biological variation in the two communities, in agreement with our first hypothesis and previous studies (Brown and Swan 2010;Astorga et al. 2012;Keck et al. 2018;Leibold and Chase 2018). Geographical distances in the DDRs and MEMs in the variation partitioning showed a higher control on fish assemblages in comparison to the non-spatialized environment, supporting our second hypothesis. The obligated aquatic dispersion through the river network and larger body size have been suggested to limit fish propagation and settlement along a larger range of habitat conditions (Cohen et al. 2003). These characteristics could contribute to the higher spatial control on fish C-TX found in this study and elsewhere (Shurin et al. 2009;Astorga et al. 2012). Besides, suitable environmental conditions in distant river reaches would not assure the colonisation by specific fish species, as connectivity (e.g., unconnected river basins, dams forming dispersal barriers) or the past biogeographical history have a key role in determining fish community patterns at large spatial scales (Leibold et al. 2010;Mazaris et al. 2010). These factors seem to be plausible explanations for the lower beta diversity and higher distance decay of fish communities.
Diatom C-TX showed a lower spatial control in comparison to fish, as demonstrated in the DDRs and variation partitioning analyses. These results agree with previous research (Finlay 2002;Vilmi et al. 2016) and could be linked to the ecological characteristics of diatoms (i.e., smaller size, shorter generation times, larger populations, and aerial dispersion), which allow them to overcome geographical barriers and colonise sites with favourable conditions. However, since environmental variables and MEMs together explained relatively low amounts of diatom community similarities, and the contribution of the pure environmental fraction was negligible, our findings could not support our third hypothesis. The low explanatory capacity of environmental variables for diatom C-TX, which has also been reported elsewhere (Liu et al. 2013;Keck et al. 2018), could be attributed to the large-scale definition of our environmental variables. Relevant local variables (e.g., water quality, physico-chemical characteristics, hydraulic and riparian conditions) that could be critical for determining diatom community composition (Soininen et al. , 2016Hájek et al. 2011) were not covered in our dataset. Furthermore, the complexity of diatom communities (i.e., a higher number of rare species in comparison to fish), biotic interactions, 1 3 and random and stochastic processes (e.g., ecological drift), which cannot be captured in our analyses, may also influence the community assembly dynamics (Hubbell 2001;Vellend et al. 2014;Vilmi et al. 2017).
Community similarities based on functional trait dominance were less spatially dependent than community similarities based on taxonomic data. C-FT showed lower decay rates and higher scattering in both fish and diatom DDRs, and fish C-FT pure spatial contribution had a decrease of 16.5% in the total variation explained in relation to C-TX. These findings support our last hypothesis and suggest that trait-based approaches are more stable across large spatial extents and multiple biogeographical units, grouping the complexity of species composition into a reduced number of traits. Therefore, functional trait community structure should be less subject to geographical distances since trait filters act in a similar way across large ecoregions (Statzner and Bêche 2010) and thus could provide more consistent ecological responses to environmental variation (i.e., niche) regardless of spatial distribution (Hoeinghaus et al. 2007). Our diatoms C-FT showed a higher contribution of pure spatial fraction when compared to C-TX; however, in relation to the total explained variation, their spatial control was similar. Previous studies (Passy 2007;Liu et al. 2013;Jamoneau et al. 2018) also reported important spatial control on diatom C-FT, e.g., strongly attached growth forms predominant in headwaters, while weakly attached forms predominant in higher-order streams. However, rather than indicating the effect of spatial structuring in the species distribution, high pure spatial fractions can also be inflated by missing relevant spatially structured environmental variables (Diniz-Filho et al. 2012).

Implications for biomonitoring and conservation programmes
Our study supports the idea that geographical distance and environmental spatial autocorrelation (closer river reaches are more environmentally similar), which are rarely taken into account in riverine biomonitoring programmes Cid et al. 2020), contributed significantly to explaining the variation in diatom and fish (i.e., organisms commonly used in biomonitoring) assemblages. Our analyses incorporate river networks from 12 distinct river basins in Spain, suggesting that riverine communities have not only an important spatial dependency on the river network structure itself (Altermatt 2013;Tonkin et al. 2018) but also across the multiple neighbouring river networks. Our results support the view that regional species pool and dispersal seem to be fundamental factors determining taxonomic differences in river biological assemblages, as has been shown in other studies (Leibold and Chase 2018; Viana and Chase 2019).
These findings have important consequences for river biomonitoring and conservation. For example, the use of organisms with higher dispersal limitation (e.g., fish) in biomonitoring might be relevant to capture connectivity issues caused by human activities (e.g., dam construction), but might not be as promising for detecting changes in niche characteristics (e.g., hydro-morphological changes), as not all potential species may be present and, therefore, accurate detection of anthropogenic impacts can be compromised (Siqueira et al. 2014). Another important implication of our results is that biomonitoring programmes may fail to detect restoration benefits if desired taxa are unable to reach new suitable locations; thus, the presence of protected or unaltered river reaches with source populations in the immediate vicinity of the restored sites (e.g., within a 5-km radius for potential recolonization of macroinvertebrates; Sundermann et al. 2011) is crucial (Siqueira et al. 2014;Swan and Brown 2017). This later issue reflects the need to incorporate multiple and wellconnected river reaches in relatively good ecological status across the landscape matrix, so 1 3 that investment in recovery is actually successful. Finally, the spatial configuration of river typologies might also affect the establishment of reference conditions (e.g., 37 different river typologies and reference conditions identified over the Spanish river network; BOE 2015). Reference conditions should cover relatively small geographical areas in order to reduce the effects of dispersal-connectivity processes on taxonomic differences, ensuring that the targeted organisms are able to reach and persist at all sites and allowing proper detection of species sorting dynamics .
Thus, dispersal-connectivity processes can have important effects on the performance of bioindicators and biomonitoring efforts, as different organisms' dispersal abilities and mass effects (intense dispersion) can mask anthropogenic disturbances or environmental factors controlling species distribution (Smucker and Vis 2011;Siqueira et al. 2012;Cid et al. 2020). In order to reinforce river biomonitoring programmes and the design of effective conservation strategies, we encourage that potential spatial-related factors such as organism's dispersal and habitat connectivity, acting at and beyond the river network, should be considered in the selection of reference sites, targeted organisms, grain extent, and spatial scales (Bonada et al. 2006;Seymour et al. 2016;Cid et al. 2020).
The functional traits, compared to taxonomic approaches, showed a lower spatial dependency in our study. This result suggests that functional traits would be more stable across biogeographical regions or multiple river networks, as they can provide valuable insights into the processes and mechanisms structuring biological assemblages (Usseglio-Polatera et al. 2000;Vandewalle et al. 2010), while species composition tends to respond to historical and spatial factors (Soininen et al. 2016). Functional traits could also facilitate the development of river typologies and reference conditions often used in biomonitoring, as they are responsive to niche characteristics (McGill et al. 2006;Culp et al. 2011). Moreover, functional approaches would allow a better understanding of biodiversity, which is usually limited to taxonomic richness (Bêche and Statzner 2009), and the development of holistic assessments of anthropogenic impacts (e.g., taking into account biotic interactions in a multi-trophic perspective; Aubin et al. 2013).
In summary, our findings indicate that environmental and dispersal-connectivity processes contributed to determining the structure and composition of the riverine biota in continental Spain. Both environmental and spatial aspects should be considered in national multi-scale biomonitoring programmes to assess riverine ecosystem health accurately. Functional approaches, besides their known advantages over taxonomy-based methods, can also complement biomonitoring efforts with consistent responses across broad spatial scales (i.e., when incorporating multiple ecoregions and biogeographic areas).