Integrating the flow regime and water quality effects into a niche-based metacommunity dynamics model for river ecosystems