The Ecotox database is updated quarterly by the US EPA. Updating this database within wqbench involves several steps including downloading the new database, reviewing and updating reference files in the package, and updating and redeploying the shiny app. The process below outlines the steps necessary to update the wqbench package. The instructions to update and redeploy the shinyapp can be found here.
Download (clone or pull) the wqbench
repo and open
in RStudio. The best practice is to open a new git branch, called
something like update-[date-of-new-ecotox]
. In Rstudio, git
pane -> New branch -> give it a name, and check “Sync branch with
remote”.
Ensure you have the most recent copy of the database with the
reference files added. To do this, load the package, and run the
function wqb_create_data_set()
:
devtools::load_all()
wqb_create_data_set(
file_path = "~/Ecotoxicology/ecotox",
version = 1,
folder_path = "~/Ecotoxicology/ecotox_db/"
)
"~/Poisson/Data/wqbench/[current-year]/review/to-be-reviewed/"
"~/Poisson/Data/wqbench/[current-year]/review/completed/"
completed
folder.The package needs to be re-built for the files to be part of the
package. Run devtools::load_all()
.
Run the wqb_create_data_set()
function to create the
database with the new reference data.
To review/update the life stage codes, repeat steps 2 through 6 but run scripts/review-reference-datasets-02.R, review the file, and run scripts/update-reference-datasets-02.R.The trophic groups need to be updated before life stage codes can be reviewed.
Run the wqb_create_data_set()
function again to
create the database with the new reference data.
These steps will have caused changes to several files in
inst/extdata
. The changes will be shown in the Git pane in
RStudio. Commit these files to Git, and push it to GitHub. Go to the
GitHub repository, and open a pull request from your branch (created in
step 1). Best practice is to have someone review the PR, but if you know
the changes are good, you can merge it yourself. At the very least,
ensure that all of the automated checks pass before you merge.
9a. In rare cases, the “Add Data” templates may also need to be updated after the reference files are updated. See the “Update the Add Data Templates article for instructions.
Once your update is merged, install the new version:
devtools::install_github("bcgov/wqbench")
.
Below are instructions for how to fill out and complete each of the reference files.
This data set should be reviewed each time a new version of the database is downloaded.
0
) indicates the concentration cannot be
converted to mg/L or ppm.
0
in the row.0
in the conc_conversion_flag
column.1
) indicates the concentration can be converted
to mg/L or ppm.
1
in the row.
mg/L
or ppm
."completed"
subfolder in the review folder.If any incorrect conversions are found, then those rows can be updated.
This data set should be reviewed each time a new version of the database is downloaded.
0
) indicates the duration cannot be converted
to hours.
0
in the row.0
in the duration_units_to_keep
column.1
) indicates the duration can be converted to
hours.
1
in the row.
"completed"
subfolder in the review folder.If any incorrect conversions are found, then those rows can be updated.
This data set should be reviewed each time a new version of the database is downloaded.
1
in the exclude_from_db column. Otherwise leave it
blank.1
in the exclude_from_db column so that
this phylum/division won’t appear for you to review again, but lower
levels within that phylum/division will."completed"
subfolder in the review folder.This data set should be reviewed each time a new version of the database is downloaded.
This data set will be sent separately after the first round of files is reviewed because this data depends on the updates to the trophic group data. Only fish and amphibian groups need the life stage categorized into simple groups, so this file only contains fish and amphibians.
lifestage-code-review.csv: - If there is no value in the
simple_lifestage column this indicates it is a new life
stage that was not in the previous coding of the database. - The goal of
the review is to ensure all cells in the
simple_lifestage are filled in. - In the
simple_lifestage column fill in any empty cells with
either els
(early life stage), juvenile
or
adult
.
Once completed, this file should be saved in the
"completed"
subfolder in the review folder.
This reference dataset has not been included in the review-reference-datasets.R script as it should not vary from year to year.
This data set is a comprehensive list that was generated from B.C. Conservation Data Centre.
Any species that is in ECOTOX, but not listed in the bc-species.csv reference file is treated as not present in BC.
This reference dataset has not been included in the review-reference-datasets.R script as it should not vary from year to year.
There is a comprehensive list that should not need to be adjusted.
The list of concentration endpoints are generated in the scripts/concentration-endpoints.R script.
If updates are required then update the concentration-endpoints.R script.