Skip to content

Commit 6f9223e

Browse files
committed
Add vignette and bump to 0.4.1
1 parent 26473ae commit 6f9223e

File tree

11 files changed

+7856
-3378
lines changed

11 files changed

+7856
-3378
lines changed

CITATION.cff

Lines changed: 297 additions & 297 deletions
Large diffs are not rendered by default.

DESCRIPTION

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Package: REcoTox
22
Type: Package
33
Title: REcoTox - a workflow to process US EPA ECOTOX Knowledgebase ASCII files
4-
Version: 0.4.0
5-
Date: 2023-5-2
4+
Version: 0.4.1
5+
Date: 2023-4-11
66
Authors@R:
77
c(person(given = "Tobias",
88
family = "Schulze",
99
role = c("aut", "cre"),
10-
email = "tobias.schulze@ufz.de",
10+
email = "tsufz1@gmail.com",
1111
comment = c(ORCID = "0000-0002-9744-8914")),
1212
person(given = "Wibke",
1313
family = "Busch",
@@ -34,7 +34,7 @@ Imports:
3434
Rdpack,
3535
readr,
3636
tibble,
37-
tidyr,
37+
tidyr,
3838
utils,
3939
webchem
4040
Suggests:
@@ -43,7 +43,9 @@ Suggests:
4343
knitr,
4444
markdown,
4545
rmarkdown,
46-
testthat
46+
testthat,
47+
kableExtra,
48+
tidyverse
4749
VignetteBuilder:
4850
knitr
4951
RdMacros:

inst/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
*Version 0.4.1 (4 November 2023)*
4+
5+
- Add vignette
6+
37
*Version 0.4.0 (2 May 2023)*
48

59
- Refactorization of the chemical list and the final results schemes
100 KB
Binary file not shown.

inst/extdata/database_folder/tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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
1+
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
22
1000494|95|1912249|||PU|||||99.9|||||||58471|Water|||EX|||||||||||||||||||||||||||||||||||||||LAB||||S||S||FW|||||||||RECOVERY||1|||||X|||||||||||||||||||||||||||||||||| |10/06/1992||
33
1000495|95|1912249|||PU|||||99.9|||||||58471|Water|||EX|||||||||||||||||||||||||||||||||||||||LAB||||S||S||FW|||||||||RECOVERY||1|||||X|||||||||||||||||||||||||||||||||| |10/06/1992||
44
1000496|95|1912249|||PU|||||99.9|||||||58471|Water|||EX|||||||||||||||||||||||||||||||||||||||LAB||||S||S||FW|||||||||RECOVERY||1|||||X|||||||||||||||||||||||||||||||||| |10/06/1992||

vignettes/REcoTox.R

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
## ----biocstyle, echo = FALSE, messages = FALSE, results = "hide"--------------
2+
BiocStyle::markdown()
3+
4+
## ----init, message = FALSE, echo = FALSE, results = "hide"--------------------
5+
## Silently loading all packages
6+
library(BiocStyle)
7+
library(desc)
8+
library(kableExtra)
9+
library(tidyverse)
10+
11+
## ----load REcoTox package, eval = FALSE, echo = TRUE, message = FALSE, warning = FALSE----
12+
# # Load the REcoTox package
13+
# library(REcoTox)
14+
15+
## ----R Documentation, echo = TRUE, eval = FALSE-------------------------------
16+
# # Documentation of REcoTox
17+
# help(package = "REcoTox")
18+
19+
## ----initialize folders, echo = TRUE, message = FALSE, warning = FALSE, eval = TRUE----
20+
# Path of the project folder
21+
project_folder <- "REcoTox_demo"
22+
23+
database_folder <- system.file("extdata/database_folder", package="REcoTox")
24+
# The project folder is created in the home directory
25+
project_path <- normalizePath(ifelse(.Platform$OS.type == "unix",
26+
paste0("~/", project_folder),
27+
paste0(
28+
Sys.getenv("HOMEPATH"),
29+
"\\",
30+
project_folder
31+
)
32+
))
33+
34+
# An existing folder is deleted
35+
if (dir.exists(project_folder)) {
36+
unlink(project_folder, recursive = TRUE)
37+
}
38+
39+
## ----create project, echo = TRUE, message = FALSE, warning = FALSE, eval = TRUE----
40+
project <- REcoTox::create_project(database_path = database_folder,
41+
project_path,
42+
initalise_database_project = TRUE, # create the basic project from current ASCII files in DB folder
43+
initalise_project = TRUE, # initializes the project folder
44+
load_default = FALSE) # loads the default project in the project folder in the memoryfault_example = TRUE
45+
46+
file.copy(
47+
from = system.file(
48+
"extdata",
49+
"Query_EcoTox_DB.R",
50+
package = "REcoTox"
51+
),
52+
to = normalizePath(
53+
path = file.path(
54+
project_folder,
55+
"Query_EcoTox_DB.R"
56+
),
57+
winslash = "\\",
58+
mustWork = FALSE
59+
),
60+
overwrite = TRUE
61+
)
62+
63+
64+
## ----list project folder------------------------------------------------------
65+
# List files and directories in project_folder
66+
list.files(project_folder, recursive = TRUE, include.dirs = TRUE)
67+
68+
## ----list database folder-----------------------------------------------------
69+
# List files and directories in project_folder
70+
list.files(database_folder, recursive = TRUE, include.dirs = TRUE)
71+
72+
## ----view chemical_properties, echo = TRUE, eval = TRUE, message = TRUE-------
73+
# Review of the chemical properties
74+
chemical_properties <- readr::read_csv(file = normalizePath(path = file.path(
75+
database_folder,
76+
"chemical_properties.csv"
77+
), ), show_col_types = FALSE)
78+
79+
kable(
80+
chemical_properties %>%
81+
head(5),
82+
format = "html",
83+
digits = 2
84+
) %>%
85+
kable_styling("striped", full_width = TRUE) %>%
86+
scroll_box(width = "700px", height = "300px")
87+
88+
## ----view results, echo = TRUE, eval = TRUE, message = TRUE-------------------
89+
# Review of the result table
90+
results <-
91+
readr::read_delim(
92+
file = normalizePath(
93+
path = file.path(
94+
database_folder,
95+
"results.txt"
96+
),
97+
),
98+
show_col_types = FALSE,
99+
delim = "|"
100+
101+
)
102+
103+
kable(
104+
results %>%
105+
head(5),
106+
format = "html", digits = 2
107+
) %>%
108+
kable_styling("striped", full_width = TRUE) %>%
109+
scroll_box(width = "700px", height = "300px")
110+
111+
## ----view chemicals, echo = TRUE, eval = TRUE, message = TRUE-----------------
112+
# Review of the substance_table
113+
substances <-
114+
readr::read_delim(
115+
file = normalizePath(
116+
path = file.path(
117+
database_folder,
118+
"validation",
119+
"chemicals.txt"
120+
),
121+
),
122+
show_col_types = FALSE,
123+
delim = "|"
124+
125+
)
126+
127+
kable(
128+
substances %>%
129+
head(5),
130+
format = "html", digits = 2
131+
) %>%
132+
kable_styling("striped", full_width = TRUE) %>%
133+
scroll_box(width = "700px", height = "300px")
134+
135+
## ----view references, echo = TRUE, eval = TRUE, message = TRUE----------------
136+
# Review of the substance_table
137+
references <-
138+
readr::read_delim(
139+
file = normalizePath(
140+
path = file.path(
141+
database_folder,
142+
"validation",
143+
"references.txt"
144+
),
145+
),
146+
show_col_types = FALSE,
147+
delim = "|"
148+
149+
)
150+
151+
kable(
152+
references %>%
153+
head(5),
154+
format = "html", digits = 2
155+
) %>%
156+
kable_styling("striped", full_width = TRUE) %>%
157+
scroll_box(width = "700px", height = "300px")
158+
159+
## ----view species, echo = TRUE, eval = TRUE, message = TRUE-------------------
160+
# Review of the substance_table
161+
species <-
162+
readr::read_delim(
163+
file = normalizePath(
164+
path = file.path(
165+
database_folder,
166+
"validation",
167+
"species.txt"
168+
),
169+
),
170+
show_col_types = FALSE,
171+
delim = "|"
172+
173+
)
174+
175+
kable(
176+
species %>%
177+
head(5),
178+
format = "html", digits = 2
179+
) %>%
180+
kable_styling("striped", full_width = TRUE) %>%
181+
scroll_box(width = "700px", height = "300px")
182+
183+
## ----initialize databases, echo = TRUE, message = FALSE, warning = FALSE, eval = FALSE----
184+
# project <- REcoTox::create_project(database_path = database_folder,
185+
# project_path,
186+
# initalise_database_project = TRUE,
187+
# initalise_project = TRUE,
188+
# load_default = FALSE)
189+
190+
## ----initialize project, echo = TRUE, message = FALSE, warning = FALSE, eval = FALSE----
191+
# project <- REcoTox::prepare_data(project = project,
192+
# load_initial_project = FALSE,
193+
# new_project_path = NA,
194+
# save_project = TRUE
195+
# )
196+
197+
## ----view pivot tables, echo = FALSE, eval = TRUE, message = TRUE-------------
198+
# Review of the privot table
199+
pivot <-
200+
project$object$results_pivot
201+
202+
kable(
203+
pivot %>%
204+
head(5),
205+
format = "html", digits = 2
206+
) %>%
207+
kable_styling("striped", full_width = TRUE) %>%
208+
scroll_box(width = "700px", height = "300px")
209+
210+
## ----sessioninfo, echo = TRUE, eval = TRUE, message = FALSE-------------------
211+
sessionInfo()
212+
213+
## ----clean_up, echo = FALSE, results = "asis", eval = FALSE-------------------
214+
# unlink(project_folder, recursive = TRUE)
215+

0 commit comments

Comments
 (0)