Skip to content

Commit

Permalink
Add vignette and bump to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tsufz committed Nov 4, 2023
1 parent 26473ae commit 6f9223e
Show file tree
Hide file tree
Showing 11 changed files with 7,856 additions and 3,378 deletions.
594 changes: 297 additions & 297 deletions CITATION.cff

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: REcoTox
Type: Package
Title: REcoTox - a workflow to process US EPA ECOTOX Knowledgebase ASCII files
Version: 0.4.0
Date: 2023-5-2
Version: 0.4.1
Date: 2023-4-11
Authors@R:
c(person(given = "Tobias",
family = "Schulze",
role = c("aut", "cre"),
email = "[email protected]",
email = "[email protected]",
comment = c(ORCID = "0000-0002-9744-8914")),
person(given = "Wibke",
family = "Busch",
Expand All @@ -34,7 +34,7 @@ Imports:
Rdpack,
readr,
tibble,
tidyr,
tidyr,
utils,
webchem
Suggests:
Expand All @@ -43,7 +43,9 @@ Suggests:
knitr,
markdown,
rmarkdown,
testthat
testthat,
kableExtra,
tidyverse
VignetteBuilder:
knitr
RdMacros:
Expand Down
4 changes: 4 additions & 0 deletions inst/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

*Version 0.4.1 (4 November 2023)*

- Add vignette

*Version 0.4.0 (2 May 2023)*

- Refactorization of the chemical list and the final results schemes
Expand Down
Binary file added inst/extdata/database_folder/project.RData
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/extdata/database_folder/tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test_id|reference_number|cas_number|test_grade|test_grade_comments|test_formulation|test_formulation_comments|test_radiolabel|test_radiolabel_comments|test_purity_mean_op|test_purity_mean|test_purity_min_op|test_purity_min|test_purity_max_op|test_purity_max|test_purity_comments|test_characteristics|species_number|organism_habitat|organism_source|organism_source_comments|organism_lifestage|organism_lifestage_comments|organism_age_mean_op|organism_age_mean|organism_age_min_op|organism_age_min|organism_age_max_op|organism_age_max|organism_age_unit|organism_init_wt_mean_op|organism_init_wt_mean|organism_init_wt_min_op|organism_init_wt_min|organism_init_wt_max_op|organism_init_wt_max|organism_init_wt_unit|organism_characteristics|organism_gender|experimental_design|study_duration_mean_op|study_duration_mean|study_duration_min_op|study_duration_min|study_duration_max_op|study_duration_max|study_duration_unit|study_duration_comments|exposure_duration_mean_op|exposure_duration_mean|exposure_duration_min_op|exposure_duration_min|exposure_duration_max_op|exposure_duration_max|exposure_duration_unit|exposure_duration_comments|study_type|study_type_comments|test_type|test_type_comments|test_location|test_location_comments|test_method|test_method_comments|exposure_type|exposure_type_comments|control_type|control_type_comments|media_type|media_type_comments|num_doses_mean_op|num_doses_mean|num_doses_min_op|num_doses_min|num_doses_max_op|num_doses_max|num_doses_comments|other_effect_comments|application_freq_mean_op|application_freq_mean|application_freq_min_op|application_freq_min|application_freq_max_op|application_freq_max|application_freq_unit|application_freq_comments|application_type|application_type_comments|application_rate|application_rate_unit|application_date|application_date_comments|application_season|application_season_comments|subhabitat|subhabitat_description|substrate|substrate_description|water_depth_mean_op|water_depth_mean|water_depth_min_op|water_depth_min|water_depth_max_op|water_depth_max|water_depth_unit|water_depth_comments|geographic_code|geographic_location|latitude|longitude|halflife_mean_op|halflife_mean|halflife_min_op|halflife_min|halflife_max_op|halflife_max|halflife_unit|halflife_comments|additional_comments|created_date|modified_date|published_date
test_id|reference_number|test_cas|test_grade|test_grade_comments|test_formulation|test_formulation_comments|test_radiolabel|test_radiolabel_comments|test_purity_mean_op|test_purity_mean|test_purity_min_op|test_purity_min|test_purity_max_op|test_purity_max|test_purity_comments|test_characteristics|species_number|organism_habitat|organism_source|organism_source_comments|organism_lifestage|organism_lifestage_comments|organism_age_mean_op|organism_age_mean|organism_age_min_op|organism_age_min|organism_age_max_op|organism_age_max|organism_age_unit|organism_init_wt_mean_op|organism_init_wt_mean|organism_init_wt_min_op|organism_init_wt_min|organism_init_wt_max_op|organism_init_wt_max|organism_init_wt_unit|organism_characteristics|organism_gender|experimental_design|study_duration_mean_op|study_duration_mean|study_duration_min_op|study_duration_min|study_duration_max_op|study_duration_max|study_duration_unit|study_duration_comments|exposure_duration_mean_op|exposure_duration_mean|exposure_duration_min_op|exposure_duration_min|exposure_duration_max_op|exposure_duration_max|exposure_duration_unit|exposure_duration_comments|study_type|study_type_comments|test_type|test_type_comments|test_location|test_location_comments|test_method|test_method_comments|exposure_type|exposure_type_comments|control_type|control_type_comments|media_type|media_type_comments|num_doses_mean_op|num_doses_mean|num_doses_min_op|num_doses_min|num_doses_max_op|num_doses_max|num_doses_comments|other_effect_comments|application_freq_mean_op|application_freq_mean|application_freq_min_op|application_freq_min|application_freq_max_op|application_freq_max|application_freq_unit|application_freq_comments|application_type|application_type_comments|application_rate|application_rate_unit|application_date|application_date_comments|application_season|application_season_comments|subhabitat|subhabitat_description|substrate|substrate_description|water_depth_mean_op|water_depth_mean|water_depth_min_op|water_depth_min|water_depth_max_op|water_depth_max|water_depth_unit|water_depth_comments|geographic_code|geographic_location|latitude|longitude|halflife_mean_op|halflife_mean|halflife_min_op|halflife_min|halflife_max_op|halflife_max|halflife_unit|halflife_comments|additional_comments|created_date|modified_date|published_date
1000494|95|1912249|||PU|||||99.9|||||||58471|Water|||EX|||||||||||||||||||||||||||||||||||||||LAB||||S||S||FW|||||||||RECOVERY||1|||||X|||||||||||||||||||||||||||||||||| |10/06/1992||
1000495|95|1912249|||PU|||||99.9|||||||58471|Water|||EX|||||||||||||||||||||||||||||||||||||||LAB||||S||S||FW|||||||||RECOVERY||1|||||X|||||||||||||||||||||||||||||||||| |10/06/1992||
1000496|95|1912249|||PU|||||99.9|||||||58471|Water|||EX|||||||||||||||||||||||||||||||||||||||LAB||||S||S||FW|||||||||RECOVERY||1|||||X|||||||||||||||||||||||||||||||||| |10/06/1992||
Expand Down
215 changes: 215 additions & 0 deletions vignettes/REcoTox.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
## ----biocstyle, echo = FALSE, messages = FALSE, results = "hide"--------------
BiocStyle::markdown()

## ----init, message = FALSE, echo = FALSE, results = "hide"--------------------
## Silently loading all packages
library(BiocStyle)
library(desc)
library(kableExtra)
library(tidyverse)

## ----load REcoTox package, eval = FALSE, echo = TRUE, message = FALSE, warning = FALSE----
# # Load the REcoTox package
# library(REcoTox)

## ----R Documentation, echo = TRUE, eval = FALSE-------------------------------
# # Documentation of REcoTox
# help(package = "REcoTox")

## ----initialize folders, echo = TRUE, message = FALSE, warning = FALSE, eval = TRUE----
# Path of the project folder
project_folder <- "REcoTox_demo"

database_folder <- system.file("extdata/database_folder", package="REcoTox")
# The project folder is created in the home directory
project_path <- normalizePath(ifelse(.Platform$OS.type == "unix",
paste0("~/", project_folder),
paste0(
Sys.getenv("HOMEPATH"),
"\\",
project_folder
)
))

# An existing folder is deleted
if (dir.exists(project_folder)) {
unlink(project_folder, recursive = TRUE)
}

## ----create project, echo = TRUE, message = FALSE, warning = FALSE, eval = TRUE----
project <- REcoTox::create_project(database_path = database_folder,
project_path,
initalise_database_project = TRUE, # create the basic project from current ASCII files in DB folder
initalise_project = TRUE, # initializes the project folder
load_default = FALSE) # loads the default project in the project folder in the memoryfault_example = TRUE

file.copy(
from = system.file(
"extdata",
"Query_EcoTox_DB.R",
package = "REcoTox"
),
to = normalizePath(
path = file.path(
project_folder,
"Query_EcoTox_DB.R"
),
winslash = "\\",
mustWork = FALSE
),
overwrite = TRUE
)


## ----list project folder------------------------------------------------------
# List files and directories in project_folder
list.files(project_folder, recursive = TRUE, include.dirs = TRUE)

## ----list database folder-----------------------------------------------------
# List files and directories in project_folder
list.files(database_folder, recursive = TRUE, include.dirs = TRUE)

## ----view chemical_properties, echo = TRUE, eval = TRUE, message = TRUE-------
# Review of the chemical properties
chemical_properties <- readr::read_csv(file = normalizePath(path = file.path(
database_folder,
"chemical_properties.csv"
), ), show_col_types = FALSE)

kable(
chemical_properties %>%
head(5),
format = "html",
digits = 2
) %>%
kable_styling("striped", full_width = TRUE) %>%
scroll_box(width = "700px", height = "300px")

## ----view results, echo = TRUE, eval = TRUE, message = TRUE-------------------
# Review of the result table
results <-
readr::read_delim(
file = normalizePath(
path = file.path(
database_folder,
"results.txt"
),
),
show_col_types = FALSE,
delim = "|"

)

kable(
results %>%
head(5),
format = "html", digits = 2
) %>%
kable_styling("striped", full_width = TRUE) %>%
scroll_box(width = "700px", height = "300px")

## ----view chemicals, echo = TRUE, eval = TRUE, message = TRUE-----------------
# Review of the substance_table
substances <-
readr::read_delim(
file = normalizePath(
path = file.path(
database_folder,
"validation",
"chemicals.txt"
),
),
show_col_types = FALSE,
delim = "|"

)

kable(
substances %>%
head(5),
format = "html", digits = 2
) %>%
kable_styling("striped", full_width = TRUE) %>%
scroll_box(width = "700px", height = "300px")

## ----view references, echo = TRUE, eval = TRUE, message = TRUE----------------
# Review of the substance_table
references <-
readr::read_delim(
file = normalizePath(
path = file.path(
database_folder,
"validation",
"references.txt"
),
),
show_col_types = FALSE,
delim = "|"

)

kable(
references %>%
head(5),
format = "html", digits = 2
) %>%
kable_styling("striped", full_width = TRUE) %>%
scroll_box(width = "700px", height = "300px")

## ----view species, echo = TRUE, eval = TRUE, message = TRUE-------------------
# Review of the substance_table
species <-
readr::read_delim(
file = normalizePath(
path = file.path(
database_folder,
"validation",
"species.txt"
),
),
show_col_types = FALSE,
delim = "|"

)

kable(
species %>%
head(5),
format = "html", digits = 2
) %>%
kable_styling("striped", full_width = TRUE) %>%
scroll_box(width = "700px", height = "300px")

## ----initialize databases, echo = TRUE, message = FALSE, warning = FALSE, eval = FALSE----
# project <- REcoTox::create_project(database_path = database_folder,
# project_path,
# initalise_database_project = TRUE,
# initalise_project = TRUE,
# load_default = FALSE)

## ----initialize project, echo = TRUE, message = FALSE, warning = FALSE, eval = FALSE----
# project <- REcoTox::prepare_data(project = project,
# load_initial_project = FALSE,
# new_project_path = NA,
# save_project = TRUE
# )

## ----view pivot tables, echo = FALSE, eval = TRUE, message = TRUE-------------
# Review of the privot table
pivot <-
project$object$results_pivot

kable(
pivot %>%
head(5),
format = "html", digits = 2
) %>%
kable_styling("striped", full_width = TRUE) %>%
scroll_box(width = "700px", height = "300px")

## ----sessioninfo, echo = TRUE, eval = TRUE, message = FALSE-------------------
sessionInfo()

## ----clean_up, echo = FALSE, results = "asis", eval = FALSE-------------------
# unlink(project_folder, recursive = TRUE)

Loading

0 comments on commit 6f9223e

Please sign in to comment.