Skip to content

Commit

Permalink
151 cran 310 release (#152)
Browse files Browse the repository at this point in the history
* updated docs

* added github to buildignore

* added documentation for invitrodb_dd data file

* updated version number

* fixes variable binding note

* moved vdiffr from imports to suggests since it is only used in tests and not required to use the package normally

* added default multi for old style plots

* accepted and resolved minor snapshot test difference based on testing environment

* updated news and cran-comments

* added additional rhub to cran comments
  • Loading branch information
brown-jason authored Oct 6, 2023
1 parent fcd4354 commit 8f8a646
Show file tree
Hide file tree
Showing 17 changed files with 276 additions and 194 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ cran-comments.md
^CRAN-SUBMISSION$
^data-raw$
^LICENSE\.md$
^\.github$
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tcpl
Title: ToxCast Data Analysis Pipeline
Version: 3.0.1
Version: 3.1.0
Authors@R: c(
person("Richard S", "Judson",role = c("ctb","ths"), email = "Judson.Richard@epa.gov"),
person("Dayne L", "Filer", role = "aut",email = "dayne.filer@gmail.com"),
Expand Down Expand Up @@ -42,8 +42,7 @@ Imports:
tcplfit2,
ggplot2,
gridExtra,
stringr,
vdiffr
stringr
Suggests:
roxygen2,
knitr,
Expand All @@ -55,7 +54,8 @@ Suggests:
viridis,
kableExtra,
colorspace,
magrittr
magrittr,
vdiffr
License: MIT + file LICENSE
LazyData: true
RoxygenNote: 7.2.3
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ importFrom(dplyr,rowwise)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(dplyr,tibble)
importFrom(dplyr,ungroup)
importFrom(ggplot2,aes)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_text)
Expand Down Expand Up @@ -147,6 +148,7 @@ importFrom(tcplfit2,tcplfit2_core)
importFrom(tcplfit2,tcplhit2_core)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(utils,data)
importFrom(utils,read.csv)
importFrom(utils,read.table)
importFrom(utils,tail)
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
tcpl v3.1.0
==============
*updated vignettes for tcplfit2 fitting
*bidirectional fitting by default
*this is the version used to create invitrodb v4.1

tcpl v3.0.1
==============
*fixes error from ggplot2
Expand Down
11 changes: 11 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,14 @@
#' }
#' }
"sc_vignette"


#' Short descriptions of fields for different tables are stored in a data dictionary.
#' @format A data frame with 44 rows and 3 variables:
#' \describe{
#' \item{invitrodb_table}{Table of the data dictionary}
#' \item{invitrodb_field}{Field of the data dictionary}
#' \item{description}{Description}
#' }
#' @source ToxCast database
"invitrodb_dd"
2 changes: 1 addition & 1 deletion R/mc6.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
mc6 <- function(ae, wr = FALSE) {

## Variable-binding to pass R CMD Check
mthd_id <- m4id <- m5id <- lval <- rval <- J <- mthd <- bmad <- cell_viability_assay <- NULL
modl <- aeid <- mthd_id <- m4id <- m5id <- lval <- rval <- J <- mthd <- bmad <- cell_viability_assay <- NULL

#owarn <- getOption("warn")
#options(warn = 1)
Expand Down
2 changes: 1 addition & 1 deletion R/sc2.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
sc2 <- function(ae, wr = FALSE) {

## Variable-binding to pass R CMD Check
bmad <- resp <- wllt <- tmp <- spid <- logc <- hitc <- max_med <- NULL
max_tmp <- bmad <- resp <- wllt <- tmp <- spid <- logc <- hitc <- max_med <- NULL

owarn <- getOption("warn")
options(warn = 1)
Expand Down
2 changes: 1 addition & 1 deletion R/tcplCytoPt.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ tcplCytoPt <- function(chid = NULL, aeid = NULL, flag = TRUE,

## Variable-binding to pass R CMD Check
ac50var <- hitc <- code <- chnm <- casn <- used_in_global_mad_calc <- nhit <- modl <- NULL
ntst <- global_mad <- cyto_pt <- med <- cyto_pt_um <- lower_bnd_um <- burstpct <- NULL
top <- ntst <- global_mad <- cyto_pt <- med <- cyto_pt_um <- lower_bnd_um <- burstpct <- NULL

cat("1: Checking if aeid or chid is specified\n")
if (!is.null(aeid) & !is.vector(aeid)) {
Expand Down
4 changes: 4 additions & 0 deletions R/tcplDefine.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@
#' parameters.
#'
#' @import data.table
#' @importFrom utils data
#'
#' @export

tcplDefine <- function(val = NULL) {

drvr <- getOption("TCPL_DRVR")
invitrodb_dd <- NULL

# example driver
if (drvr == "example"){
data("invitrodb_dd", envir=environment())

dd <- invitrodb_dd[]

Expand Down
5 changes: 3 additions & 2 deletions R/tcplFit2.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ tcplFit2 <- function(dat,
#'
#'
#' @return Data.table with key value pairs of hitcalling parameters
#' @importFrom dplyr %>% filter group_by summarise left_join inner_join select rowwise mutate pull
#' @importFrom dplyr %>% filter group_by summarise left_join inner_join select rowwise mutate pull ungroup
#' @importFrom tidyr pivot_longer
#' @importFrom tcplfit2 tcplhit2_core
tcplHit2 <- function(mc4, coff) {

#variable binding
top <- a <- b <- ga <- la <- p <- tp <- logc_min <- logc_max <- fitc <- NULL
model <- m4id <-model_param <-model_val <-resp <- NULL
params <-conc <-bmed <-onesd <-df <-aeid <- NULL
fit_method <-hitcall <-cutoff <-top_over_cutoff <-bmd <-hit_val <- NULL
Expand Down Expand Up @@ -103,7 +104,7 @@ tcplHit2 <- function(mc4, coff) {
res <- res %>%
rowwise() %>%
mutate(ac95 = tcplfit2::acy(.95 * top, list(a = a, b = b, ga = ga, la = la, p = p, q = q, tp = tp)[!is.na(list(a = a, b = b, ga = ga, la = la, p = p, q = q, tp = tp))], fit_method)) %>%
ungroup()
dplyr::ungroup()
res <- res %>% mutate(coff_upper = 1.2 * cutoff, coff_lower = .8 * cutoff)
res <- res %>%
left_join(mc4 %>% select(m4id, logc_min, logc_max) %>% unique(), by = "m4id") %>%
Expand Down
5 changes: 4 additions & 1 deletion R/tcplLoadData.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@
#'
#' @import data.table
#' @importFrom tidyr pivot_wider
#' @importFrom utils data
#' @export

tcplLoadData <- function(lvl, fld = NULL, val = NULL, type = "mc", add.fld = TRUE) {
#variable binding
model <- model_param <- model_val <- NULL
hit_param <- hit_val <- NULL
hit_param <- hit_val <- sc_vignette <- mc_vignette <- NULL

if (length(lvl) > 1 | length(type) > 1) {
stop("'lvl' & 'type' must be of length 1.")
Expand All @@ -91,6 +92,7 @@ tcplLoadData <- function(lvl, fld = NULL, val = NULL, type = "mc", add.fld = TRU
drvr <- getOption("TCPL_DRVR")
if (drvr == "example"){
if (type == "sc"){
data("sc_vignette", envir = environment())
if (lvl == 0L) {
sc0 <- sc_vignette[["sc0"]]
sc0 <- sc0[,c("s0id","spid","acid","apid","rowi","coli","wllt","wllq","conc","rval","srcf")]
Expand Down Expand Up @@ -118,6 +120,7 @@ tcplLoadData <- function(lvl, fld = NULL, val = NULL, type = "mc", add.fld = TRU
}

if (type == "mc" ) {
data("mc_vignette", envir = environment())
if (lvl == 0L) {
mc0 <- mc_vignette[["mc0"]]
mc0 <- mc0[,c("m0id","spid","acid","apid","rowi","coli","wllt","wllq","conc","rval","srcf")]
Expand Down
5 changes: 4 additions & 1 deletion R/tcplPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#' options(conf_store)
tcplPlot <- function(lvl = 5, fld = "m4id", val = NULL, type = "mc", by = NULL, output = c("console", "pdf", "png", "jpg", "svg", "tiff"), fileprefix = paste0("tcplPlot_", Sys.Date()), multi = NULL, verbose = FALSE, nrow = NULL, ncol = NULL, dpi = 600) {
#variable binding
resp <- NULL
conc_unit <- bmd <- resp <- NULL
# check_tcpl_db_schema is a user-defined function found in v3_schema_functions.R file
if (check_tcpl_db_schema()) {
# check that input combination is unique
Expand Down Expand Up @@ -148,6 +148,9 @@ tcplPlot <- function(lvl = 5, fld = "m4id", val = NULL, type = "mc", by = NULL,
}

} else {
if(is.null(multi)){
multi <- FALSE
}
if (length(lvl) > 1 | !lvl %in% 4:7) stop("invalid lvl input.")
if (length(output) > 1) output <- output[1]

Expand Down
30 changes: 24 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
Minor release for fixing errors on CRAN
Some small bug fixes included
3.1.0 Release integrates package tcplfit2 bidirectional fitting a major update that impacts resulting invitrodb database

## Test environments

* local Windows 10 install, R 4.2.1
* R Under development (unstable) (2022-10-11 r83083 ucrt)
* local Windows 10 install, R 4.2.2
* R Under development (unstable) (2023-10-04 r85267 ucrt)
* Rhub Windows Server 2022, R-devel, 64 bit
* Rhub Fedora Linux, R-devel, clang, gfortran
* Rhub Ubuntu Linux 20.04.1 LTS, R-release, GCC
* Rhub Windows Server 2022, R-devel, 64 bit

## rhub CMD check results
- Note appears to be related to testing environment
- All notes appear to be related to testing (rhub) environment
Found the following (possibly) invalid URLs:
URL: https://www.epa.gov/chemical-research/exploring-toxcast-data-downloadable-data
From: inst/doc/Data_retrieval.html
inst/doc/Introduction_Appendices.html
Status: 403
Message: Forbidden
URL: https://www.epa.gov/chemical-research/toxicity-forecasting
From: inst/doc/Introduction_Appendices.html
Status: 403
Message: Forbidden
* checking HTML version of manual ... [13s] NOTE
Skipping checking math rendering: package 'V8' unavailable
* checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
''NULL''
* checking for detritus in the temp directory ... NOTE
Found the following files/directories:
'lastMiKTeXException'

## win devel check results
1 NOTE - Found the following (possibly) invalid URLs...
All links appear to work correctly when hyperlinked from the vignette, similar note to the rhub testing

## local R CMD check results

0 ERRORs | 0 WARNINGs | 0 NOTES.
Expand Down
4 changes: 4 additions & 0 deletions man/MC2_Methods.Rd

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

5 changes: 5 additions & 0 deletions man/MC4_Methods.Rd

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

24 changes: 24 additions & 0 deletions man/invitrodb_dd.Rd

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

Loading

0 comments on commit 8f8a646

Please sign in to comment.