Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ready for CRAN update #407

Merged
merged 5 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ test-out.xml
^pkgdown$
.lintr
inst/extdata/toxEval35_endpoint_summary_DLV.xlsx
inst/shiny/www/footer.html
vignettes/basicWorkflow.Rmd
vignettes/shinyApp.Rmd
vignettes/sidebar.png
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rocker/geospatial:latest
image: code.usgs.gov:5001/water/wsc/umid/docker_images:latest

stages:
- getready
Expand Down Expand Up @@ -35,8 +35,8 @@ getready:
- mkdir -p $R_LIBS_USER
- mkdir -p $APT_CACHE
- echo "options(Ncpus=$(nproc --all), repos=c(CRAN='$CRAN'))" >> $R_PROFILE
- Rscript -e "install.packages(c('devtools', 'connectapi'))"
- Rscript -e "install.packages(c('tibble', 'vctrs', 'dplyr', 'tidyr'))"
- Rscript -e "install.packages(c( 'connectapi'))"
- Rscript -e "devtools::install_deps()"
cache:
paths:
- $R_LIBS_USER
Expand Down
3 changes: 3 additions & 0 deletions CRAN_reminders.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CRAN submissions:
1. Turn off DT tables in basicWorkflow
2. Turn dontrun to donttest in explore_endpoints
(nevermind...removed the example altogether)
3. Remove badge links from readme
(badges made it in last update, so maybe they are OK)
4. Remove most extraneous links from readme (especially installation)
5. Figure out what do to with inst/shiny/www/footer.html
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: toxEval
Type: Package
Title: Exploring Biological Relevance of Environmental Chemistry Observations
Version: 1.3.1
Version: 1.3.2
Authors@R: c(person("Laura", "DeCicco",
role = c("aut","cre"),
email = "[email protected]",
Expand All @@ -25,7 +25,7 @@ Authors@R: c(person("Laura", "DeCicco",
person("Dalma", "Martinovic",
role = "rev",
comment = "Reviewed for USGS"))
Description: Data analysis package for estimating potential biological effects from chemical concentrations in environmental samples. Included are a set of functions to analyze, visualize, and organize measured concentration data as it relates to 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. A description of the analysis can be found in Blackwell et al. (2017) <doi:10.1021/acs.est.7b01613>.
Description: Data analysis package for estimating potential biological effects from chemical concentrations in environmental samples. Included are a set of functions to analyze, visualize, and organize measured concentration data as it relates to 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. A description of the analysis can be found in Blackwell (2017) <doi:10.1021/acs.est.7b01613>.
License: CC0
Copyright: This software is in the public domain because it contains materials
that originally came from the United States Geological Survey, an agency of
Expand Down Expand Up @@ -61,3 +61,4 @@ VignetteBuilder: knitr
BuildVignettes: true
LazyLoad: yes
RoxygenNote: 7.3.1

2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,4 @@ importFrom(magrittr,"%>%")
importFrom(shinyAce,aceEditor)
importFrom(shinyAce,updateAceEditor)
importFrom(shinycssloaders,withSpinner)
importFrom(stats,median)
importFrom(stats,quantile)
importFrom(tools,file_ext)
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ toxEval 1.3.1
===========
* Made "Chemical" a required column in the Chemical tab. Now all plot names will key off that column instead of the names listed in tox_chemicals.
* Updated documentation to remove some notes.
* Removed dplyr from NAMESPACE.

toxEval 1.3.0
===========
Expand Down
1 change: 0 additions & 1 deletion R/endpoint_hits.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#' @return data frame with one row per endpoint that had a hit (based on the
#' hit_threshold). The columns are based on the category.
#' @rdname endpoint_hits_DT
#' @importFrom stats median
#' @examples
#' # This is the example workflow:
#' path_to_tox <- system.file("extdata", package = "toxEval")
Expand Down
5 changes: 2 additions & 3 deletions R/filter_endPoint_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
#'
#' The default category ('groupCol') is 'intended_target_family'. Depending
#' on the study, other categories may be more relevant. The best resource on these
#' groupings is the "ToxCast Assay Annotation Data User Guide" directly from
#' EPA \url{https://www.epa.gov/chemical-research/toxcast-assay-annotation-data-user-guide}.
#' Following that link, it defines "intended_target_family" as "the target family of the
#' groupings is the "ToxCast Assay Annotation Data User Guide".
#' It defines "intended_target_family" as "the target family of the
#' objective target for the assay". Much more detail can be discovered in that documentation.
#'
#' @param ep Data frame containing Endpoint information from ToxCast
Expand Down
6 changes: 3 additions & 3 deletions R/get_chemical_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ orderClass <- function(graphData) {
orderClass_df <- graphData %>%
dplyr::mutate(logEAR = log(meanEAR)) %>%
dplyr::group_by(chnm, Class) %>%
dplyr::summarise(median = quantile(logEAR[logEAR != 0], 0.5, na.rm = TRUE)) %>%
dplyr::summarise(median = stats::quantile(logEAR[logEAR != 0], 0.5, na.rm = TRUE)) %>%
dplyr::group_by(Class) %>%
dplyr::summarise(max_med = max(median, na.rm = TRUE)) %>%
dplyr::arrange(dplyr::desc(max_med))
Expand All @@ -168,7 +168,7 @@ orderChem <- function(graphData, orderClass_df) {
orderChem_df <- graphData %>%
dplyr::mutate(logEAR = log(meanEAR)) %>%
dplyr::group_by(chnm, Class) %>%
dplyr::summarise(median = quantile(logEAR[logEAR != 0], 0.5, na.rm = TRUE)) %>%
dplyr::summarise(median = stats::quantile(logEAR[logEAR != 0], 0.5, na.rm = TRUE)) %>%
dplyr::ungroup() %>%
dplyr::mutate(Class = factor(Class, levels = rev(as.character(orderClass_df$Class))))

Expand All @@ -187,7 +187,7 @@ orderEP <- function(graphData) {
orderEP_df <- graphData %>%
dplyr::mutate(logEAR = log(meanEAR)) %>%
dplyr::group_by(endPoint) %>%
dplyr::summarise(median = quantile(logEAR[logEAR != 0], 0.5, na.rm = TRUE)) %>%
dplyr::summarise(median = stats::quantile(logEAR[logEAR != 0], 0.5, na.rm = TRUE)) %>%
dplyr::ungroup()

orderEP_df$median[is.na(orderEP_df$median)] <- min(orderEP_df$median, na.rm = TRUE) - 1
Expand Down
1 change: 0 additions & 1 deletion R/hits_by_groupings.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#' @export
#' @return data frame with one row per category, and one column per Biological grouping.
#' @rdname hits_by_groupings_DT
#' @importFrom stats median
#' @examples
#' # This is the example workflow:
#' path_to_tox <- system.file("extdata", package = "toxEval")
Expand Down
1 change: 0 additions & 1 deletion R/hits_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#' @rdname hits_summary_DT
#' @return data frame with with one row per unique site/category combination. The columns
#' are site, category, Samples with Hits, and Number of Samples.
#' @importFrom stats median
#' @examples
#' # This is the example workflow:
#' path_to_tox <- system.file("extdata", package = "toxEval")
Expand Down
11 changes: 5 additions & 6 deletions R/makeMap.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#' Short Name, dec_lon, and dec_lat.
#' @export
#' @rdname make_tox_map
#' @importFrom stats quantile
#' @examples
#' # This is the example workflow:
#' path_to_tox <- system.file("extdata", package = "toxEval")
Expand Down Expand Up @@ -63,9 +62,9 @@ make_tox_map <- function(chemical_summary,
if (length(siteToFind) == 1) {
mapData <- dplyr::filter(chem_site, SiteID == siteToFind) %>%
dplyr::mutate(
nSamples = median(mapData$count),
meanMax = median(mapData$meanMax),
sizes = median(mapData$sizes)
nSamples = stats::median(mapData$count),
meanMax = stats::median(mapData$meanMax),
sizes = stats::median(mapData$sizes)
)
}
map <- leaflet::leaflet(height = "500px", data = mapData) %>%
Expand Down Expand Up @@ -174,7 +173,7 @@ map_tox_data <- function(chemical_summary,
counts <- mapData$count

if (length(siteToFind) > 1) {
leg_vals <- unique(as.numeric(quantile(mapData$meanMax, probs = c(0, 0.01, 0.1, 0.25, 0.5, 0.75, 0.9, .99, 1), na.rm = TRUE)))
leg_vals <- unique(as.numeric(stats::quantile(mapData$meanMax, probs = c(0, 0.01, 0.1, 0.25, 0.5, 0.75, 0.9, .99, 1), na.rm = TRUE)))
pal <- leaflet::colorBin(col_types, mapData$meanMax, bins = leg_vals)
rad <- 3 * seq(1, 4, length.out = 16)

Expand All @@ -184,7 +183,7 @@ map_tox_data <- function(chemical_summary,
mapData$sizes <- rad[as.numeric(cut(mapData$count, breaks = 16))]
}
} else {
leg_vals <- unique(as.numeric(quantile(c(0, mapData$meanMax), probs = c(0, 0.01, 0.1, 0.25, 0.5, 0.75, 0.9, .99, 1), na.rm = TRUE)))
leg_vals <- unique(as.numeric(stats::quantile(c(0, mapData$meanMax), probs = c(0, 0.01, 0.1, 0.25, 0.5, 0.75, 0.9, .99, 1), na.rm = TRUE)))
pal <- leaflet::colorBin(col_types, c(0, mapData$meanMax), bins = leg_vals)
mapData$sizes <- 3
}
Expand Down
4 changes: 2 additions & 2 deletions R/plot_chemical_boxplots.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ plot_chemical_boxplots <- function(chemical_summary, ...,
orderColsBy <- chemical_summary %>%
dplyr::mutate(logEAR = log(EAR)) %>%
dplyr::group_by(chnm, Class, ...) %>%
dplyr::summarise(median = median(logEAR[!is.na(logEAR)], na.rm = TRUE)) %>%
dplyr::summarise(median = stats::median(logEAR[!is.na(logEAR)], na.rm = TRUE)) %>%
dplyr::arrange(median) %>%
dplyr::ungroup()

Expand All @@ -101,7 +101,7 @@ plot_chemical_boxplots <- function(chemical_summary, ...,
orderedLevels <- chemical_summary %>%
dplyr::mutate(logEAR = log(EAR)) %>%
dplyr::group_by(chnm, Class, ...) %>%
dplyr::summarise(median = median(logEAR[!is.na(logEAR)])) %>%
dplyr::summarise(median = stats::median(logEAR[!is.na(logEAR)])) %>%
dplyr::ungroup() %>%
dplyr::mutate(
Class = factor(Class, levels = rev(class_order)),
Expand Down
5 changes: 2 additions & 3 deletions R/plot_group_boxplots.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#' @export
#' @rdname plot_tox_boxplots
#' @import ggplot2
#' @importFrom stats median
#' @examples
#' # This is the example workflow:
#' path_to_tox <- system.file("extdata", package = "toxEval")
Expand Down Expand Up @@ -170,7 +169,7 @@ plot_tox_boxplots <- function(chemical_summary,
orderColsBy <- chemical_summary %>%
dplyr::mutate(logEAR = log(EAR)) %>%
dplyr::group_by(category) %>%
dplyr::summarise(median = median(logEAR[logEAR != 0], na.rm = TRUE)) %>%
dplyr::summarise(median = stats::median(logEAR[logEAR != 0], na.rm = TRUE)) %>%
dplyr::ungroup() %>%
dplyr::arrange(median)

Expand Down Expand Up @@ -402,7 +401,7 @@ tox_boxplot_data <- function(chemical_summary,

orderColsBy <- tox_boxplot_data %>%
dplyr::group_by(category) %>%
dplyr::summarise(median = median(meanEAR[meanEAR != 0], na.rm = TRUE)) %>%
dplyr::summarise(median = stats::median(meanEAR[meanEAR != 0], na.rm = TRUE)) %>%
dplyr::ungroup() %>%
dplyr::arrange(median)

Expand Down
1 change: 0 additions & 1 deletion R/plot_heat_chemical.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#' @export
#' @rdname plot_tox_heatmap
#' @import ggplot2
#' @importFrom stats median
#' @examples
#' path_to_tox <- system.file("extdata", package = "toxEval")
#' file_name <- "OWC_data_fromSup.xlsx"
Expand Down
1 change: 0 additions & 1 deletion R/plot_tox_endpoints.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#' endpoints will be included.
#' @export
#' @import ggplot2
#' @importFrom stats median
#' @examples
#' # This is the example workflow:
#' path_to_tox <- system.file("extdata", package = "toxEval")
Expand Down
1 change: 0 additions & 1 deletion R/plot_tox_endpoints2.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#' @param ... Additional group_by arguments. This can be handy for creating facet graphs.
#' @export
#' @import ggplot2
#' @importFrom stats median
#' @examples
#'
#' \donttest{
Expand Down
1 change: 0 additions & 1 deletion R/plot_tox_stacks.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#' data will be included.
#' @export
#' @import ggplot2
#' @importFrom stats median
#' @importFrom grDevices colorRampPalette
#' @examples
#' # This is the example workflow:
Expand Down
1 change: 0 additions & 1 deletion R/rank_sites.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#' hits based on the category.
#'
#' @rdname rank_sites_DT
#' @importFrom stats median
#' @examples
#' # This is the example workflow:
#' path_to_tox <- system.file("extdata", package = "toxEval")
Expand Down
2 changes: 1 addition & 1 deletion R/side_by_side.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ side_by_side_data <- function(gd_left,

orderChem_1_2 <- chem_data_no_factors %>%
dplyr::group_by(chnm, Class) %>%
dplyr::summarise(median = quantile(meanEAR[meanEAR != 0], 0.5)) %>%
dplyr::summarise(median = stats::quantile(meanEAR[meanEAR != 0], 0.5)) %>%
dplyr::ungroup()

class_order <- orderClass(chem_data_no_factors)
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
14 changes: 9 additions & 5 deletions R/toxEval.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ToxCast database: version", dbVersion()), width = 40),
}

dbVersion <- function() {
"3.5"
"4.0"
}

#' Analyze ToxCast data in relation to measured concentrations.
Expand Down Expand Up @@ -50,7 +50,7 @@ dbVersion <- function() {
#' Downloaded on October 2022 from ToxCast. The data were
#' combined from files in the "INVITRODB_V3_5_LEVEL5" folder.
#' At the time of toxEval package release, this information was found:
#' \url{https://www.epa.gov/chemical-research/exploring-toxcast-data}
#' \url{https://www.epa.gov/comptox-tools/exploring-toxcast-data}
#' in the "ToxCast & Tox21 Data Spreadsheet" data set.
#' ACC values are the in the "ACC" column (winning model) and units are
#' log micro-Molarity (log \eqn{\mu}M).
Expand Down Expand Up @@ -87,11 +87,10 @@ NULL
#' @docType data
#' @keywords datasets
#' @references U.S. EPA. 2014. ToxCast Assay Annotation Data User Guide.
#' \url{https://www.epa.gov/chemical-research/toxcast-assay-annotation-data-user-guide}.
#'
#' @source \doi{10.23645/epacomptox.6062479.v3}
#' @export end_point_info
#' @return data frame with 86 columns. The columns and definitions
#' @return data frame with 72 columns. The columns and definitions
#' are discussed in the "ToxCast Assay Annotation Version 1.0 Data User Guide (PDF)" (see source).
#' The column "Relevance Category" was included for consideration of
#' grouping/filtering endpoints based on user goals.
Expand All @@ -105,7 +104,12 @@ NULL
# end_point_info <- end_point_info |>
# dplyr::select(-reagent_reagent_name_value_type,
# -reagent_reagent_name_value,
# -citations_citation)
# -citations_citation,
# -citations_title,
# -citations_author,
# -assay_source_desc,
# -assay_component_endpoint_desc)
# save(end_point_info, tox_chemicals, ToxCast_ACC, file = "sysdata.rda", compress = "xz")

#' ToxCast Chemical Information
#'
Expand Down
6 changes: 3 additions & 3 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ bibentry(bibtype = "Manual",
as.person("Gerald T. Ankley")),
title = "toxEval: Evaluation of measured concentration data using the ToxCast high-throughput screening database or a user-defined set of concentration benchmarks.",
publisher = "U.S. Geological Survey",
version = "1.3.0",
version = "1.3.2",
address="Reston, VA",
institution = "U.S. Geological Survey",
year = 2023,
year = 2024,
doi = "10.5066/P906UQ5I",
url = "https://code.usgs.gov/water/toxEval",
textVersion = "De Cicco, L.A., Corsi, S.R., Villeneuve D.L, Blackwell, and B.R, Ankley, G.T., 2023, toxEval: Evaluation of measured concentration data using the ToxCast high-throughput screening database or a user-defined set of concentration benchmarks. R package version 1.3.0., https://code.usgs.gov/water/toxEval, doi:10.5066/P906UQ5I"
textVersion = "De Cicco, L.A., Corsi, S.R., Villeneuve D.L, Blackwell, and B.R, Ankley, G.T., 2024, toxEval: Evaluation of measured concentration data using the ToxCast high-throughput screening database or a user-defined set of concentration benchmarks. R package version 1.3.1., https://code.usgs.gov/water/toxEval, doi:10.5066/P906UQ5I"
)
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.

3 changes: 1 addition & 2 deletions man/end_point_info.Rd

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

5 changes: 2 additions & 3 deletions man/filter_groups.Rd

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

Loading
Loading