Skip to content

Commit

Permalink
Update links to EPA
Browse files Browse the repository at this point in the history
  • Loading branch information
ldecicco-USGS committed Jan 29, 2024
1 parent 18ce619 commit 6f96ea2
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 37 deletions.
42 changes: 21 additions & 21 deletions R/endpoint_hits.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,45 +158,45 @@ endpoint_hits <- function(chemical_summary,
fullData <- fullData_init

if (category == "Chemical") {
chemical_summary <- mutate(chemical_summary, category = chnm)
chemical_summary <- dplyr::mutate(chemical_summary, category = chnm)
} else if (category == "Chemical Class") {
chemical_summary <- mutate(chemical_summary, category = Class)
chemical_summary <- dplyr::mutate(chemical_summary, category = Class)
} else {
chemical_summary <- mutate(chemical_summary, category = Bio_category)
chemical_summary <- dplyr::mutate(chemical_summary, category = Bio_category)
}

if (length(unique(chemical_summary$site)) > 1) {
if (!sum_logic) {
fullData <- chemical_summary %>%
group_by(site, category, endPoint, date) %>%
summarize(sumEAR = max(EAR)) %>%
group_by(site, category, endPoint) %>%
summarize(meanEAR = ifelse(mean_logic, mean(sumEAR), max(sumEAR))) %>%
group_by(category, endPoint) %>%
summarize(nSites = sum(meanEAR > hit_threshold)) %>%
dplyr::group_by(site, category, endPoint, date) %>%
dplyr::summarize(sumEAR = max(EAR)) %>%
dplyr::group_by(site, category, endPoint) %>%
dplyr::summarize(meanEAR = ifelse(mean_logic, mean(sumEAR), max(sumEAR))) %>%
dplyr::group_by(category, endPoint) %>%
dplyr::summarize(nSites = sum(meanEAR > hit_threshold)) %>%
tidyr::spread(category, nSites)
} else {
fullData <- chemical_summary %>%
group_by(site, category, endPoint, date) %>%
summarize(sumEAR = sum(EAR)) %>%
group_by(site, category, endPoint) %>%
summarize(meanEAR = ifelse(mean_logic, mean(sumEAR), max(sumEAR))) %>%
group_by(category, endPoint) %>%
summarize(nSites = sum(meanEAR > hit_threshold)) %>%
dplyr::group_by(site, category, endPoint, date) %>%
dplyr::summarize(sumEAR = sum(EAR)) %>%
dplyr::group_by(site, category, endPoint) %>%
dplyr::summarize(meanEAR = ifelse(mean_logic, mean(sumEAR), max(sumEAR))) %>%
dplyr::group_by(category, endPoint) %>%
dplyr::summarize(nSites = sum(meanEAR > hit_threshold)) %>%
tidyr::spread(category, nSites)
}
} else {
if (!sum_logic) {
fullData <- chemical_summary %>%
group_by(category, endPoint) %>%
summarise(nSites = sum(EAR > hit_threshold)) %>%
dplyr::group_by(category, endPoint) %>%
dplyr::summarise(nSites = sum(EAR > hit_threshold)) %>%
tidyr::spread(category, nSites)
} else {
fullData <- chemical_summary %>%
group_by(category, endPoint, date) %>%
summarize(sumEAR = sum(EAR)) %>%
group_by(category, endPoint) %>%
summarise(nSites = sum(sumEAR > hit_threshold)) %>%
dplyr::group_by(category, endPoint, date) %>%
dplyr::summarize(sumEAR = sum(EAR)) %>%
dplyr::group_by(category, endPoint) %>%
dplyr::summarise(nSites = sum(sumEAR > hit_threshold)) %>%
tidyr::spread(category, nSites)
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/filter_endPoint_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ filter_groups <- function(ep,
assay_source_name <- assay_component_endpoint_name <- ".dplyr"

ep <- ep[, c("assay_component_endpoint_name", groupCol, "assay_source_name")] %>%
rename(
dplyr::rename(
endPoint = assay_component_endpoint_name,
assaysFull = assay_source_name
)
Expand Down
7 changes: 3 additions & 4 deletions R/get_ACC.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#' to units of \eqn{\mu}g/L, and reformat the data as input to toxEval.
#'
#' @param CAS Vector of CAS.
#' @import dplyr
#'
#' @return data frame with columns CAS, chnm, flags, endPoint, ACC, MlWt, and ACC_value
#' @export
Expand All @@ -36,12 +35,12 @@ get_ACC <- function(CAS) {
by = c("CAS" = "casrn")
)

ACC <- mutate(ACC,
ACC <- dplyr::mutate(ACC,
ACC_value = 10^ACC,
ACC_value = ACC_value * MlWt
)
ACC <- filter(ACC, !is.na(ACC_value))
ACC <- left_join(ACC, select(tox_chemicals,
ACC <- dplyr::filter(ACC, !is.na(ACC_value))
ACC <- dplyr::left_join(ACC, select(tox_chemicals,
CAS = Substance_CASRN,
chnm = Substance_Name
), by = "CAS")
Expand Down
4 changes: 2 additions & 2 deletions R/toxEval.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dbVersion <- function() {
#' ToxCast and Tox21 Data Spreadsheet. figshare. Dataset.
#' \doi{10.23645/epacomptox.6062479.v3}.
#'
#' @source \url{https://www.epa.gov/chemical-research/exploring-toxcast-data}
#' @source \url{https://www.epa.gov/comptox-tools/exploring-toxcast-data}
#'
#' @aliases ToxCast_ACC
#' @return data frame with columns CAS, chnm (chemical name), flags, endPoint, and ACC (value).
Expand All @@ -77,7 +77,7 @@ NULL
#' raw data was "assay_annotation_information_invitrodb_v3_5.xlsx" from the zip file
#' "INVITRODB_V3_5_SUMMARY" folder. At the time
#' of the toxEval package release, these data were found at:
#' \url{https://www.epa.gov/chemical-research/exploring-toxcast-data}
#' \url{https://www.epa.gov/comptox-tools/exploring-toxcast-data}
#' in the section marked "Download Assay Information", in the
#' ToxCast & Tox21 high-throughput assay information data set.
#'
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ knitr::opts_chunk$set(
[![](http://cranlogs.r-pkg.org/badges/toxEval)](https://cran.r-project.org/package=toxEval)
[![](http://cranlogs.r-pkg.org/badges/grand-total/toxEval)](https://cran.r-project.org/package=toxEval)

The `toxEval` R-package includes a set of functions to analyze, visualize, and organize measured concentration data as it relates to [https://www.epa.gov/chemical-research/toxicity-forecasting](https://www.epa.gov/chemical-research/toxicity-forecasting) or other user-selected chemical-biological interaction benchmark data such as water quality criteria. The intent of these analyses is to develop a better understanding of the potential biological relevance of environmental chemistry data. Results can be used to prioritize which chemicals at which sites may be of greatest concern. These methods are meant to be used as a screening technique to predict potential for biological influence from chemicals that ultimately need to be validated with direct biological assays.
The `toxEval` R-package includes a set of functions to analyze, visualize, and organize measured concentration data as it relates to [https://www.epa.gov/comptox-tools/toxicity-forecasting-toxcast](https://www.epa.gov/comptox-tools/toxicity-forecasting-toxcast) or other user-selected chemical-biological interaction benchmark data such as water quality criteria. The intent of these analyses is to develop a better understanding of the potential biological relevance of environmental chemistry data. Results can be used to prioritize which chemicals at which sites may be of greatest concern. These methods are meant to be used as a screening technique to predict potential for biological influence from chemicals that ultimately need to be validated with direct biological assays.

The functions within this package allow great flexibly for exploring the potential biological affects of measured chemicals. Also included in the package is a browser-based application made from the `Shiny` R-package (the app). The app is based on functions within the R-package and includes many convenient analyses and visualization options for users to choose. Use of the functions within the R-package allows for additional flexibility within the functions beyond what the app offers and provides options for the user to interact more directly with the data. The overview in this document focuses on the R-package.

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version](http://www.r-pkg.org/badges/version/toxEval)](https://cran.r-project.or

The `toxEval` R-package includes a set of functions to analyze,
visualize, and organize measured concentration data as it relates to
<https://www.epa.gov/chemical-research/toxicity-forecasting> or other
user-selected chemical-biological interaction benchmark data such as
water quality criteria. The intent of these analyses is to develop a
<https://www.epa.gov/comptox-tools/toxicity-forecasting-toxcast> or
other user-selected chemical-biological interaction benchmark data such
as water quality criteria. The intent of these analyses is to develop a
better understanding of the potential biological relevance of
environmental chemistry data. Results can be used to prioritize which
chemicals at which sites may be of greatest concern. These methods are
Expand Down Expand Up @@ -79,7 +79,7 @@ data provided in the package):
``` r
library(toxEval)
#> For more information:
#> https://rconnect.usgs.gov/toxEval_docs/
#> https://doi-usgs.github.io/toxEval/
#> ToxCast database: version 3.5
path_to_file <- file.path(system.file("extdata", package="toxEval"), "OWC_data_fromSup.xlsx")
tox_list <- create_toxEval(path_to_file)
Expand Down Expand Up @@ -181,7 +181,6 @@ explore_endpoints()

``` r
citation(package = "toxEval")
#>
#> To cite toxEval in publications, please use:
#>
#> De Cicco, L.A., Corsi, S.R., Villeneuve D.L, Blackwell, and B.R,
Expand Down
2 changes: 1 addition & 1 deletion man/ToxCast_ACC.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/end_point_info.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/Introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The functions within this package allow great flexibly for exploring the potenti
This vignette provides a general overview of the concepts within `toxEval`, definitions of common terminology used throughout the package, and links to information to help understand fundamentals of the ToxCast database used within `toxEval`.

## What is ToxCast?
The U.S. EPA's Toxicity Forecaster <a href="https://www.epa.gov/chemical-research/toxicity-forecasting" target="_blank">ToxCast</a> includes a database of chemical-biological interactions that contains information from hundreds of assays on thousands of chemicals, providing a means to assess biological relevance to measured concentrations. The `toxEval` package attempts to simplify the workflow for exploring data as it relates to these assay endpoints (benchmark data). The workflow uses ToxCast as a default for evaluation of chemical:biological interactions, but the user may also define alternative benchmarks for a custom or more traditional approach to biological relevance evaluation. This is also a useful capability for efficient comparison of ToxCast evaluation results with those from other toxicity benchmark databases.
The U.S. EPA's Toxicity Forecaster <a href="https://www.epa.gov/comptox-tools/toxicity-forecasting-toxcast" target="_blank">ToxCast</a> includes a database of chemical-biological interactions that contains information from hundreds of assays on thousands of chemicals, providing a means to assess biological relevance to measured concentrations. The `toxEval` package attempts to simplify the workflow for exploring data as it relates to these assay endpoints (benchmark data). The workflow uses ToxCast as a default for evaluation of chemical:biological interactions, but the user may also define alternative benchmarks for a custom or more traditional approach to biological relevance evaluation. This is also a useful capability for efficient comparison of ToxCast evaluation results with those from other toxicity benchmark databases.

When using the ToxCast endPoints for analysis, it is important to have at least a minimal understanding of what ToxCast data is, and which ToxCast data is relevant to any given study. There are many useful resources <a href="https://www.epa.gov/chemical-research/toxicity-forecasting" target="_blank">here</a>. There is also a tool called the <a href="https://comptox.epa.gov/dashboard/" target="_blank">Comptox Dashboard</a> that has a wealth of information on ToxCast data.

Expand Down
Binary file modified vignettes/OWC_custom_bench.xlsx
Binary file not shown.

0 comments on commit 6f96ea2

Please sign in to comment.