scieee AI-readable full text Open interactive document viewer

Codes and data for the article 'Early warning signal for river-borne diseases with almost no data'

Ramazi, Pouria; Bende, Prajwal; Arezoo, Haratian; Greiner, Russell; Lewis, Mark A.

Abstract

Codes and data for the paper "Early warning signal for river-borne diseases with almost no data" in Methods in Ecology and Evolution. This collection includes data on the prevalence of river-borne diseases and related environmental variables.The codes are for extracting the tree structure of the river from the map and using the extended HMM model to predict the presence of contaminated samples in each part of the river. The dataset contains the whilring disease test results of about 113 locations in the Oldman River collected in 2017 and 2018. The dataset additionally includes several environmental variables measured at 164,985 pixels of size 200m x 200m in the Oldman River. The dataset was collected and preprocessed by Alberta Environment and Parks (AEP), with contributions from Alicia Kennedy, Laurie Gallagher, Chad Sherburne, James Clayton, and Marie Veillard. The dataset is being shared with the permission of AEP.

Full text

Supplementary Materials for Early Warning Signal for River-Borne Diseases with Almost No Data Pouria Ramazi, Prajwal Bende, Arezoo Haratian, Russell Greiner, and Mark A. Lewis 1 A step-by-step manual for using the code Here we explain how to obtain the results of this paper for a given river (or tree-structured) system. Step 0. Pixelizing the river. Using QGIS [1], the area of interest can be divided into 100 m x 100 m pixels, which are classified into land and water pixels. The classification can be done using a downloadable hydrology layer and applying the “Select by location” tool to find the pixels having intersection with the water polygons. Step 1. Pre-processing the river-structure data. The input to this step is the coordinates and elevation of the pixels of the area of interest. The coordinates can be in the format of Table 3 below, where the first and second columns are longitude and latitude, the next two columns are the row and column number of the pixels, and the last column is the grid code of the pixel, which is simply 1,. . . ,n, when there are npixels of the water bodies. The grid code of the land pixels is all zero. The table should be saved in CSV format under the name “stream.csv”. Pixel elevations should be saved in TIF format and saved under the name “elevation.tif”. Make sure to locate these two files in the folder “data” under the same working directory. Then run the Python script file “get edge list.py”. The output will be the file “edge list.npy”, which is a vector of pairs of pixels, where in each row, the pixel in the first column is linked to the pixel in the second column, in the river system. Step 2. Pre-processing feature data. We provide the feature data for the pixels as the output of this step. This can be done by software such as GIS, allowing to obtain Table 1: Coordinates input format Xcoord Ycoord Row Col gridcode 518322 5425709 0 0 1 518522 5425709 0 1 0 518722 5425709 0 2 2 . . .. . .. . .. . .. . . 573122 5616309 953 1099 0 1 features such as slope and elevation. Some other relevant features may be obtained by field sampling and then matching the coordinates of the sampling points with the pixels. The result of this step should be a table where the first column is the grid code of the pixels, and the other columns are the values of the features at those pixels. The models in the next steps allow for missing values in the features. However, often best results are obtained when they are imputed using commands such as “KNNImputer” in sklearn package in Python: from sklearn.impute import KNNImputer imputer = KNNImputer(n neighbors=3) data = imputer.fit transform(data) The resulting data table should be saved as the file “features imputed.csv”. Step 3. Pre-processing target variable data. Similar to the previous part, the test results, or more generally, the values of the response variable must be collected over the pixels. Here, it is fine to have, and most likely the majority of the pixels will have, missing values. The result of this part should be saved as the file “labels.csv”. Step 4. Train and evaluate the extended TAN-HMM model. Make sure to locate all the data files in the folder “data” under the same working directory. Instances of the target variable used in the training stage should be different from those used in the evaluation. The indices of the training instances should be saved as a list in the file “train indices.npy” in the folder “data”. Run the Python script file “run.py”. This will output two files: “dbgresult.txt” which includes the prediction accuracy measures such as AUC, accuracy, and F1-score, and “mg.csv” which is the prediction of the target variable over each pixel. References [1] G. Kurt Menke, R. Smith Jr, L. Pirelli, G. John Van Hoesen et al.,Mastering QGIS. Packt Publishing Ltd, 2016. 2