Datasets for manuscript: The impact of legacy nutrient loading from lake sediments on cyanobacteria bloom severity

The GitHub site contains the code and data to run two methods as shown in the manuscript. The first quantifies external load, internal load, and source attributed impact on cyanoHAB severity. This method was written using R language (version 4.2.2). The second method maps potential legacy P stores in upstream watersheds of Lake Mendota, WI (USA) and estimates the total P load per contributing area across watersheds. This method was written using Python language (version 3.8.5) & GeoPandas (version 0.8.2).
1. Impact_model_method
The impact model method is a series of sequential programs that take original source data, performs quality control checks and re-formats the data as new data files for input into the impact model. The Impact_model_method folder has all programs used in this method. All code is written in R Markdown format (.Rmd). Here's the order to run the R programs and achieve the same results as shown in the manuscript:
cyanoHAB_severity.Rmd - calculates cyanoHAB severity (as Chl-a and cyanobacteria density)
TotalP_external_atmdep.Rmd - calculates external total P loads from atmospheric deposition
TotalP_external_inflows.Rmd - calculates external total P loads from inflows (streams)
TotalP_external_all.Rmd - calculates the sum of external total P loads (streams + atmospheric deposition)
EpiVolume.Rmd - calculates the change in volume of the epilimnion using temperature profiles
TotalP_water.Rmd - calculates the total P concentration in the epilimnion, total P concentration in the hypolimnion, and ratio of total P in hypolimnion to epilimnion (as alternative indicator of internal P load)
TotalP_internal.Rmd - calculates internal total P loads (or alternatively the ratio of totalP_hypo:totalP_epi)
Model_inputs.Rmd - prepares the data as input for impact modeling (defines predictor and response variables)
Impact_model.Rmd - performs the statistical modeling for impact analysis on cyanoHAB severity by source (external vs internal) and outputs the partitioned sum of squares for each predictor term
2. Spatial_model_method
The spatial model method takes original source data, performs quality control checks and re-formats the data as new data files for input into the spatial model. The model maps potential legacy P stores in upstream sub-watersheds, and quantify total P load per contributing area across sub-watersheds. All programs used in this method are provided in the Spatial_model_method folder. All code is written in Python language (.py or .ipynb). The specific order in which programs should be run to achieve the same results as shown in the manuscript is as follows:
HydroGraph_functios.py - performs the network mapping of sub-watersheds upstream of the inflows to the lake
watershed_analysis.ipynb - calculates the P export per contributing area for each of the upstream sub-watersheds
OHSA.py - performs the optimized hot spot analysis for determining statistically clustered stream monitoring sites with consistently high P concentrations. 

This dataset is associated with the following publication:
Knose, L.A., D.L. Cole, E. Martin-Hernandez, V.M. Zavala, M.A. Gonzalez, C. Vaneeckhaute, and G.J. Ruiz-Mercado. The Impact of Legacy Nutrient Loading from Lake Sediments on Cyanobacteria Bloom Severity.   ACS ES&T Water. American Chemical Society, Washington, DC, USA, 5(9): 4997-5010, (2025).

Tags: cyanobacteria-blooms, data-science, legacy-nutrients, phosphorus-and-nitrogen
Organization: U.S. Environmental Protection Agency