diff --git a/DESCRIPTION b/DESCRIPTION index 13f31c8..921069b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,9 +4,14 @@ Version: 0.1.4 Authors@R: c( person("Skylar", "Marvel", , "skylar.marvel@nih.gov", role = c("aut", "ctb"), comment = c(ORCID = "0000-0002-2971-9743")), person("David", "Reif", , "david.reif@nih.gov", role = c("aut", "ctb"), comment = c(ORCID = "0000-0001-7815-6767")), - person("Kyle", "Messier", , "kyle.messier@nih.gov", role = c("cre", "aut", "ctb"), comment = c(ORCID = "0000-0001-9508-9623")) + person("Kyle", "Messier", , "kyle.messier@nih.gov", role = c("cre", "aut", "ctb"), comment = c(ORCID = "0000-0001-9508-9623")), + person("Spatiotemporal Exposures and Toxicology Group", role = c("cph")) ) -Description: Connecting spatiotemporal exposure to individual and population-level risk via source-to-outcome continuum modeling. +Description: Connecting spatiotemporal exposure to individual and + population-level risk via source-to-outcome continuum modeling. The package, + methods, and case-studies are described in Messier, Reif, and Marvel (2024) + and Eccles et al. (2023) + . License: MIT + file LICENSE URL: https://niehs.github.io/GeoTox/, https://github.com/NIEHS/GeoTox Depends: diff --git a/NAMESPACE b/NAMESPACE index 18996f5..a71bf6a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -15,6 +15,8 @@ export(get_fixed_css) export(get_fixed_obesity) export(get_fixed_other) export(get_fixed_params) +export(hill_conc) +export(hill_val) export(plot_exposure) export(plot_hill) export(plot_resp) diff --git a/R/check_lengths.R b/R/check_lengths.R index 20637e2..67e1d29 100644 --- a/R/check_lengths.R +++ b/R/check_lengths.R @@ -4,6 +4,7 @@ #' @param y list of arrays #' #' @keywords internal +#' @noRd #' #' @return boolean, TRUE for error .check_lengths <- function(x, y) { diff --git a/R/check_names.R b/R/check_names.R index 3742040..d0ac737 100644 --- a/R/check_names.R +++ b/R/check_names.R @@ -4,6 +4,7 @@ #' @param names names to look for #' #' @keywords internal +#' @noRd #' #' @return boolean, TRUE for error .check_names <- function(x, names) { diff --git a/R/check_types.R b/R/check_types.R index 207e910..99e3acd 100644 --- a/R/check_types.R +++ b/R/check_types.R @@ -5,6 +5,7 @@ #' @param msg error message #' #' @keywords internal +#' @noRd #' #' @return list version of input .check_types <- function(x, types, msg = "Incorrect type") { diff --git a/R/hill_conc.R b/R/hill_conc.R index d4255a9..0d51382 100644 --- a/R/hill_conc.R +++ b/R/hill_conc.R @@ -8,9 +8,8 @@ #' @param AC50 concentration of half-maximal response #' @param n Hill coefficient (slope) #' -#' @keywords internal -#' #' @return concentration in regular space +#' @export #' #' @details #' This is a regular space version of @@ -20,6 +19,10 @@ #' \deqn{conc = AC50 * (\frac{max}{resp} - 1)^{-1 / n}} #' #' @seealso \code{\link{hill_val}} +#' +#' @examples +#' hill_conc(c(0.2, 0.5, 0.75), 1, 0.01, 1) +#' hill_conc(c(0.2, 0.5, 0.9), 1, c(0.1, 0.01, 0.001), 2) hill_conc <- function(resp, max, AC50, n) { if (any(AC50 < 0)) { diff --git a/R/hill_val.R b/R/hill_val.R index 45472d6..7f9ad61 100644 --- a/R/hill_val.R +++ b/R/hill_val.R @@ -8,9 +8,8 @@ #' @param AC50 concentration of half-maximal response #' @param n Hill coefficient (slope) #' -#' @keywords internal -#' #' @return response value +#' @export #' #' @details #' This is a regular space version of @@ -20,6 +19,10 @@ #' \deqn{resp = \frac{max}{1 + (\frac{AC50}{conc})^{n}}} #' #' @seealso \code{\link{hill_conc}} +#' +#' @examples +#' hill_val(c(0.0025, 0.01, 0.03), 1, 0.01, 1) +#' hill_val(c(0.05, 0.01, 0.003), 1, c(0.1, 0.01, 0.001), 2) hill_val <- function(conc, max, AC50, n) { if (any(conc < 0) || any(AC50 < 0)) { diff --git a/R/obj_ECx.R b/R/obj_ECx.R index c9dd7cb..e30046b 100644 --- a/R/obj_ECx.R +++ b/R/obj_ECx.R @@ -12,6 +12,7 @@ #' @param AC50 concentrations of half-maximal response #' #' @keywords internal +#' @noRd #' #' @return objective value obj_ECx <- function(conc_mix, resp, conc, max, AC50) { diff --git a/R/obj_GCA.R b/R/obj_GCA.R index 8973b76..294f5f0 100644 --- a/R/obj_GCA.R +++ b/R/obj_GCA.R @@ -10,6 +10,7 @@ #' @param AC50 concentrations of half-maximal response #' #' @keywords internal +#' @noRd #' #' @return objective value obj_GCA <- function(ln_resp, conc, max, AC50) { diff --git a/R/obj_hill.R b/R/obj_hill.R index 555594d..d0e54e7 100644 --- a/R/obj_hill.R +++ b/R/obj_hill.R @@ -5,6 +5,7 @@ #' @param resp response #' #' @keywords internal +#' @noRd #' #' @return value of the objective function obj_hill <- function(par, log10_conc, resp) { diff --git a/README.Rmd b/README.Rmd index f30d800..4feb133 100644 --- a/README.Rmd +++ b/README.Rmd @@ -22,22 +22,30 @@ knitr::opts_chunk$set( [![pkgdown](https://github.com/NIEHS/GeoTox/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/NIEHS/GeoTox/actions/workflows/pkgdown.yaml) [![cov](https://NIEHS.github.io/GeoTox/badges/coverage.svg)](https://github.com/NIEHS/GeoTox/actions) [![CRAN status](https://www.r-pkg.org/badges/version/GeoTox)](https://CRAN.R-project.org/package=GeoTox) - + -`GeoTox` open-source R software package for characterizing the risk of perturbing molecular targets involved in adverse human health outcomes based on exposure to spatially-referenced stressor mixtures via the GeoTox framework - otherwise known as source-to-outcome-continuum modeling. The package, methods, and case-studies are described in [Messier, Reif, and Marvel, 2024, medRxiv-Preprint](https://www.medrxiv.org/content/10.1101/2024.09.23.24314096v1). +`GeoTox` open-source R software package for characterizing the risk of perturbing molecular targets involved in adverse human health outcomes based on exposure to spatially-referenced stressor mixtures via the GeoTox framework - otherwise known as source-to-outcome-continuum modeling. The package, methods, and case-studies are described in [Messier, Reif, and Marvel, 2024, medRxiv-Preprint](https://www.medrxiv.org/content/10.1101/2024.09.23.24314096). The GeoTox framework was first described in [Eccles et al. A geospatial modeling approach to quantifying the risk of exposure to environmental chemical mixtures via a common molecular target. Sci Total Environ. 2023 Jan 10;855:158905.](https://pubmed.ncbi.nlm.nih.gov/36152849/) ## Installation -The package will be on CRAN in the near future - please stay tuned. You can install the development version of GeoTox from -[GitHub](https://github.com/NIEHS/GeoTox) with: +The package will be on CRAN in the near future - please stay tuned. + + +## Development Version + +The development version can be installed from [GitHub](https://github.com/NIEHS/GeoTox) with: ```{r, eval=FALSE} -install.packages("pak") -pak::pkg_install("NIEHS/GeoTox") +#install.packages("pak") +pak::pak("NIEHS/GeoTox") ``` ## Overview diff --git a/README.md b/README.md index 12a950b..ad8b295 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.re [![cov](https://NIEHS.github.io/GeoTox/badges/coverage.svg)](https://github.com/NIEHS/GeoTox/actions) [![CRAN status](https://www.r-pkg.org/badges/version/GeoTox)](https://CRAN.R-project.org/package=GeoTox) + `GeoTox` open-source R software package for characterizing the risk of @@ -21,7 +22,7 @@ based on exposure to spatially-referenced stressor mixtures via the GeoTox framework - otherwise known as source-to-outcome-continuum modeling. The package, methods, and case-studies are described in [Messier, Reif, and Marvel, 2024, -medRxiv-Preprint](https://www.medrxiv.org/content/10.1101/2024.09.23.24314096v1). +medRxiv-Preprint](https://www.medrxiv.org/content/10.1101/2024.09.23.24314096). The GeoTox framework was first described in [Eccles et al. A geospatial modeling approach to quantifying the risk of exposure to environmental @@ -30,13 +31,21 @@ Jan 10;855:158905.](https://pubmed.ncbi.nlm.nih.gov/36152849/) ## Installation -The package will be on CRAN in the near future - please stay tuned. You -can install the development version of GeoTox from +The package will be on CRAN in the near future - please stay tuned. + +## Development Version + +The development version can be installed from [GitHub](https://github.com/NIEHS/GeoTox) with: ``` r -install.packages("pak") -pak::pkg_install("NIEHS/GeoTox") +#install.packages("pak") +pak::pak("NIEHS/GeoTox") ``` ## Overview diff --git a/_pkgdown.yml b/_pkgdown.yml index 07d6d43..b55d9f1 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -44,6 +44,8 @@ reference: desc: Auxillary and helper functions - contents: - fit_hill + - hill_conc + - hill_val - starts_with("get_") - subtitle: Datasets desc: Package datasets diff --git a/man/GeoTox-package.Rd b/man/GeoTox-package.Rd index edff2be..3158cff 100644 --- a/man/GeoTox-package.Rd +++ b/man/GeoTox-package.Rd @@ -7,7 +7,7 @@ \description{ \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} -Connecting spatiotemporal exposure to individual and population-level risk via source-to-outcome continuum modeling. +Connecting spatiotemporal exposure to individual and population-level risk via source-to-outcome continuum modeling. The package, methods, and case-studies are described in Messier, Reif, and Marvel (2024) \doi{10.1101/2024.09.23.24314096} and Eccles et al. (2023) \doi{10.1016/j.scitotenv.2022.158905}. } \seealso{ Useful links: @@ -26,5 +26,10 @@ Authors: \item David Reif \email{david.reif@nih.gov} (\href{https://orcid.org/0000-0001-7815-6767}{ORCID}) [contributor] } +Other contributors: +\itemize{ + \item Spatiotemporal Exposures and Toxicology Group [copyright holder] +} + } \keyword{internal} diff --git a/man/dot-check_lengths.Rd b/man/dot-check_lengths.Rd deleted file mode 100644 index 730eca0..0000000 --- a/man/dot-check_lengths.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/check_lengths.R -\name{.check_lengths} -\alias{.check_lengths} -\title{Check for matching lengths} -\usage{ -.check_lengths(x, y) -} -\arguments{ -\item{x}{list of arrays} - -\item{y}{list of arrays} -} -\value{ -boolean, TRUE for error -} -\description{ -Check for matching lengths -} -\keyword{internal} diff --git a/man/dot-check_names.Rd b/man/dot-check_names.Rd deleted file mode 100644 index f5c3cae..0000000 --- a/man/dot-check_names.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/check_names.R -\name{.check_names} -\alias{.check_names} -\title{Check for names} -\usage{ -.check_names(x, names) -} -\arguments{ -\item{x}{object to check} - -\item{names}{names to look for} -} -\value{ -boolean, TRUE for error -} -\description{ -Check for names -} -\keyword{internal} diff --git a/man/dot-check_types.Rd b/man/dot-check_types.Rd deleted file mode 100644 index 69beeb7..0000000 --- a/man/dot-check_types.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/check_types.R -\name{.check_types} -\alias{.check_types} -\title{Check types} -\usage{ -.check_types(x, types, msg = "Incorrect type") -} -\arguments{ -\item{x}{object to check} - -\item{types}{allowed types} - -\item{msg}{error message} -} -\value{ -list version of input -} -\description{ -Check types -} -\keyword{internal} diff --git a/man/hill_conc.Rd b/man/hill_conc.Rd index 6bcaf3f..60c1e3c 100644 --- a/man/hill_conc.Rd +++ b/man/hill_conc.Rd @@ -28,7 +28,10 @@ This is a regular space version of The concentration is computed as: \deqn{conc = AC50 * (\frac{max}{resp} - 1)^{-1 / n}} } +\examples{ +hill_conc(c(0.2, 0.5, 0.75), 1, 0.01, 1) +hill_conc(c(0.2, 0.5, 0.9), 1, c(0.1, 0.01, 0.001), 2) +} \seealso{ \code{\link{hill_val}} } -\keyword{internal} diff --git a/man/hill_val.Rd b/man/hill_val.Rd index 9005034..6da703e 100644 --- a/man/hill_val.Rd +++ b/man/hill_val.Rd @@ -28,7 +28,10 @@ This is a regular space version of The Hill model is defined as: \deqn{resp = \frac{max}{1 + (\frac{AC50}{conc})^{n}}} } +\examples{ +hill_val(c(0.0025, 0.01, 0.03), 1, 0.01, 1) +hill_val(c(0.05, 0.01, 0.003), 1, c(0.1, 0.01, 0.001), 2) +} \seealso{ \code{\link{hill_conc}} } -\keyword{internal} diff --git a/man/obj_ECx.Rd b/man/obj_ECx.Rd deleted file mode 100644 index fd8a642..0000000 --- a/man/obj_ECx.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/obj_ECx.R -\name{obj_ECx} -\alias{obj_ECx} -\title{A Generalized concentration addition style solution} -\usage{ -obj_ECx(conc_mix, resp, conc, max, AC50) -} -\arguments{ -\item{conc_mix}{effective concentration of the mixture in regular space} - -\item{resp}{individual chemical responses} - -\item{conc}{individual chemical concentrations in regular space} - -\item{max}{maximal (asymtotic) response} - -\item{AC50}{concentrations of half-maximal response} -} -\value{ -objective value -} -\description{ -Find the effective concentration of a mixture via an objective function -given the concentrations and inverse, based on a regular space AC50 and -concentrations. -} -\keyword{internal} diff --git a/man/obj_GCA.Rd b/man/obj_GCA.Rd deleted file mode 100644 index 1de2a8a..0000000 --- a/man/obj_GCA.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/obj_GCA.R -\name{obj_GCA} -\alias{obj_GCA} -\title{Generalized concentration addition objective function} -\usage{ -obj_GCA(ln_resp, conc, max, AC50) -} -\arguments{ -\item{ln_resp}{natural log of individual chemical responses} - -\item{conc}{individual chemical concentrations in regular space} - -\item{max}{maximal (asymtotic) responses} - -\item{AC50}{concentrations of half-maximal response} -} -\value{ -objective value -} -\description{ -Use to find the optimal efficacy value based on a regular space AC50 and -concentrations. -} -\keyword{internal} diff --git a/man/obj_hill.Rd b/man/obj_hill.Rd deleted file mode 100644 index 647ff58..0000000 --- a/man/obj_hill.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/obj_hill.R -\name{obj_hill} -\alias{obj_hill} -\title{Objective function for 2- or 3-parameter Hill model} -\usage{ -obj_hill(par, log10_conc, resp) -} -\arguments{ -\item{par}{parameters} - -\item{log10_conc}{base-10 log scale concentration} - -\item{resp}{response} -} -\value{ -value of the objective function -} -\description{ -Objective function for 2- or 3-parameter Hill model -} -\keyword{internal}