Introduction
Understanding how species assemble into communities is one of the most fundamental themes in ecology (Weiher et al. 2011; Götzenberger, et al. 2012; Gerhold et al. 2015). Key postulates are that evolutionary forces, environmental conditions and inter-species interactions combine to structure local communities (Cavender-Bares et al. 2009; Webb et al. 2002), with prominent theories proposing either neutral or deterministic processes (Swenson and Enquist 2009; Kembel 2010; Chase and Myers 2011). Neutral theory holds that species initially have quasi- identical requirements, and communities become structured by some dynamic balance between species loss through extinction, immigration and speciation through genetic drift (Kimura 1991). Conversely, niche-based concepts emphasize how environmental factors determine assembly through filtering mechanisms that limit the occurrence of species with similar traits (Kraft et al. 2015). While niche overlap – also known as limiting similarity – is expected to exclude similar species from co-existing (Macarthur and Levin 1975), environmental filtering and niche shifts act to moderate the extent to which similar species co-occur in similar habitat conditions (Weiher et al. 2011; Gerhold et al. 2015; Ulrich et al. 2018).
An important proviso in studying species and trait assembly in communities is that species relatedness should be controlled or represented in order to eliminate phylogeny as a potential confound (Mayfield and Levine, 2010; Kraft et al., 2015; Cadotte and Tucker, 2017). Phylogenetic analyses can account for trait expression at the species level thus enabling insights into the evolution of habitat preferences, species function and distribution patterns (Webb et al., 2002; McGill et al., 2006). Typical analyses attempt to understand whether ecologically relevant traits are conserved or modified along any given phylogeny thereby providing evidence about the roles environmental filtering and competitive segregation in assembly processes (Cavender-Bares et al. 2009; Pavoine et al. 2008; He et al. 2018; reviewed in Cadotte et al., 2017). Ideally, investigations aimed at understanding communities should blend field observations with some assessment of the functional and phylogenetic identities of the component species (McGill et al. 2006; Winemiller et al. 2015; Xu et al. 2017).
Given that ecosystem character changes in time and space, conditions under which species assemble and co-exist must also vary (McGill et al. 2006). Such environmental gradients offer a means to test competing assembly theories, for example by revealing relationships between environmental conditions and the morphological, physiological or behavioural traits of the species involved (Cavender-Bares et al. 2004; Dehling et al. 2014). Traits also reflect species’ roles or functions within communities and can reveal mechanisms that affect distributional patterns along habitat gradients (Kraft et al. 2007). In terrestrial ecosystems, for example, competition, trait expression and environmental filtering along elevational gradients can have marked effects on bird communities (McCain 2009; Machac et al. 2011; Dehling et al. 2014; He et al. 2018; Ulrich et al. 2018; Ding et al. 2019; Chiu et al. 2020).
Among all ecosystems, rivers have received considerable emphasis in community ecology (Ward et al. 1998; Robinson et al. 2002; Altermatt et al. 2020), including seminal assessments of assembly rules, environmental filtering and trait-based studies (Poff 1997; Heino et al. 2015). In part, this interest reflects the pronounced environmental gradients represented by rivers both longitudinally and among contrasting river basins that together have created a diverse habitat template into which species have proliferated (Townsend and Hildrew 1994; Terui et al. 2021). Growing concern about the global status of freshwater ecosystems is also prompting interest in interactions between natural biodiversity patterns in rivers and the effects of environmental change (see Dudgeon et al. 2006).
So far, little of the research effort into community assembly has focussed on high-energy river systems in mountain landscapes, where large altitudinal ranges, complex topography and geomorphological dynamism give rise to pronounced ecological gradients with large species turnover (Ormerod et al. 1994; Jacobsen et al. 1997). Moreover, despite being conspicuous components of the global riverine fauna, river birds have been neglected in fundamental studies of mechanisms structuring communities, especially in mountainous areas (Manel et al. 2000; Sinha et al. 2019). One such region, the Himalayan Mountains, has the most diverse communities of specialist river birds on Earth (Buckton and Ormerod 2002) – thus prompting questions about evolutionary mechanisms that have allowed their coexistence. Marked diversity and distinctness in habitat use has led to some speculation about the roles of environmental filtering and niche partitioning, but there has been no formal analysis using current methods, and no attempts to assess phylogenetic effects in community assembly (Buckton and Ormerod 2008).
In this paper, we use specialist river birds to examine Southwood’s original premise (1977, 1988), restated for rivers by Townsend & Hildrew (1994), that habitats provide the templet through which evolutionary forces act with phylogeny to determine species’ life-history. In turn, the resulting contrasts in species’ traits act to determine how communities can contain multiple species while also influencing how communities change along environmental gradients. Specifically, we investigated river birds along multiple headstreams in the north-west Himalayan mountains of India, hypothesizing that river bird communities reflect detectable trait–environment relationships arising from environmental filtering. We asked (1) are there non-random patterns in species distribution and species’ traits that reflect trait-environment relationships? and (2) are local species pools a result of com­mon phylogenetic ancestry or convergence in response to environmental or biotic filters acting on regional communities? Addressing the first of these questions allowed us to quantify community change largely in relation to elevation while the second helped to identify how trait expression along this elevation gradient reflected filtering beyond the constraints of phylogeny.