Skip to main content
Dryad logo

Scripts from: A framework to diagnose the causes of river ecosystem deterioration using biological symptoms


Feld, Christian K.; Saeedghalati, Mohammadkarim; Hering, Daniel (2020), Scripts from: A framework to diagnose the causes of river ecosystem deterioration using biological symptoms, Dryad, Dataset,


  1. River assessments are predominantly based upon biological metrics and indices selected or designed to integrate the impact of multiple causes of deterioration (stressors) operating at various spatial scales. Yet, the integrative nature of many bioassessment systems does not allow for tracing back individual stressors and their influence on the overall assessment result. Thus, river managers often fail to link bioassessment with programmes of management measures, to improve ecological quality.
  2. Here, we present a novel diagnostic approach that allows to estimate the probability of individual stressors being causal for biological degradation at the scale of individual riverine ecosystems. Similar to medical diagnosis, we use various symptoms (macroinvertebrate metrics) and probabilistically link them to various potential causes of ecological status degradation (stressors). Symptoms and causes are informed by a training dataset of 157 samples (stressors, taxa lists) from central European lowland rivers and are linked through a Bayesian Network (BN). Three separate BNs addressing three different spatial scales (catchment, reach and site) are presented. 
  3. Water quality-related causes are most influential at the catchment scale, while hydromorphological causes prevail at finer scales. Causes indicating riparian degradation are most influential at the reach scale. Many symptoms show strong linkages to causes and reveal ecologically meaningful relationships, thus pointing at the potential diagnostic utility of the symptoms selected. BNs are validated using an independent dataset of 47 samples. Overall, model accuracies range 53–58% for the three BNs, while for individual nodes (causes and symptoms) up to 100% concordance of predicted and actual node states in the validation data is achieved. The BNs are implemented as interactive online diagnostic tools to allow end users an easy application. 
  4. Synthesis and applications. Our results confirm that Bayesian inference can greatly assist the diagnosis of potential causes of river deterioration based upon a selection of diagnostic biological metrics. If integrated into a Bayesian Network, symptoms and potential causes can be linked and inform management decisions on appropriate measures, to improve ecological quality. Diagnostic Bayesian Networks thus support end users bridge the gap between biological monitoring and appropriate programmes of management measures. 28 July 2020


The .zip archive contains a selection of files and data required to calculate the catchment Bayesian Network and to implement the network as an interactive online application. 

The selection includes the following files and folders:
- file app.R: R script to run the online application via Shiny 
- file code_for_shiny.R: R script to calculate the conditional probabilities in the catchment Bayesian Network (BN)
- file data_for_shiny_catchment.Rdata: R data file containing the catchment model's data
- folder data and text: collection of .csv files containing numerical and textual information required to run the online application
- folder network file: contains the .net version of the BN file as exported from the GUI "GeNie"; this allows to develop (and illustrate) a BN via a GUI (e.g. GeNie or Netica);
the resulting network file can be directly imported into R and used to calculate the posterior probabilities for the online application

Usage Notes

The reach and the site scale Diagnostic Tools run accordingly and are not covered here. We also do not present here the additional information provided,
when a user selects a candidate cause's name in the online application. This information can be easily included via .html files (one file per cause to be 
stored in a folder named html_files) and an illustration or photo (to be stored in a folder named www).

The three online applications are available at: 

Additonal information is available in the attached Readme.txt


Seventh Framework Programme, Award: Contract No: 603378