-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
7,856 additions
and
3,378 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
@@ -34,7 +34,7 @@ Imports: | |
Rdpack, | ||
readr, | ||
tibble, | ||
tidyr, | ||
tidyr, | ||
utils, | ||
webchem | ||
Suggests: | ||
|
@@ -43,7 +43,9 @@ Suggests: | |
knitr, | ||
markdown, | ||
rmarkdown, | ||
testthat | ||
testthat, | ||
kableExtra, | ||
tidyverse | ||
VignetteBuilder: | ||
knitr | ||
RdMacros: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
Oops, something went wrong.