Understanding how environmental gradients shape the spatial patterns of intraspecific genetic diversity is a central issue in ecological and evolutionary sciences. In riverine ecosystems, there is generally an increase in neutral genetic diversity downstream, as well as an increase in genetic differentiation among upstream populations. However, selective pressures may vary markedly along the upstream–downstream gradient, which could modify these patterns, but this has rarely been tested empirically. Here, we investigated how environmental gradients in a river network could shape the spatial patterns of intraspecific genetic diversity and differentiation in both neutral SNP markers and functional genetic markers putatively under natural sele...