diff options
| author | Johannes Ranke <johannes.ranke@jrwb.de> | 2026-03-13 13:19:36 +0100 |
|---|---|---|
| committer | Johannes Ranke <johannes.ranke@jrwb.de> | 2026-03-13 13:19:36 +0100 |
| commit | a5e851a5d81194bef25c3f3a32e355e5795cdde1 (patch) | |
| tree | f5a1441b7663239d56f55129907f97eb9f35c349 | |
| parent | 3612fcc80c900d95a539a7fa228eecd4429e7c72 (diff) | |
Small improvements, see NEWS.md
In the README, improve the scaling of the graphs
| -rw-r--r-- | NEWS.md | 4 | ||||
| -rw-r--r-- | R/chent.R | 4 | ||||
| -rw-r--r-- | README.md | 54 | ||||
| -rw-r--r-- | README.rmd | 35 | ||||
| -rw-r--r-- | docs/authors.html | 4 | ||||
| -rw-r--r-- | docs/authors.md | 4 | ||||
| -rw-r--r-- | docs/index.html | 30 | ||||
| -rw-r--r-- | docs/index.md | 40 | ||||
| -rw-r--r-- | docs/llms.txt | 40 | ||||
| -rw-r--r-- | docs/news/index.html | 3 | ||||
| -rw-r--r-- | docs/news/index.md | 4 | ||||
| -rw-r--r-- | docs/reference/figures/README-unnamed-chunk-4-1.png | bin | 6346 -> 5369 bytes | |||
| -rw-r--r-- | docs/reference/figures/README-unnamed-chunk-5-1.png | bin | 7461 -> 6451 bytes | |||
| -rw-r--r-- | docs/reference/ppp.html | 4 | ||||
| -rw-r--r-- | docs/search.json | 2 | ||||
| -rw-r--r-- | log/check.log | 10 | ||||
| -rw-r--r-- | man/figures/README-unnamed-chunk-4-1.png | bin | 6346 -> 15109 bytes | |||
| -rw-r--r-- | man/figures/README-unnamed-chunk-5-1.png | bin | 7461 -> 39123 bytes |
18 files changed, 135 insertions, 103 deletions
@@ -1,6 +1,8 @@ ## version 0.4.1 -- R/chent.R: Improve print method for `pai` objects. +- Improve print method for `pai` objects +- `chent` plot method: Pass dots argument to `grid.picture()` as documented +- `chent` plot method: Use preferred SMILES. If PubChem information was retrieved, this will now be the SMILES including stereochemical information ## version 0.4.0 @@ -235,7 +235,7 @@ chent <- R6Class("chent", smiles_preferred, " SMILES\n", self$smiles[smiles_preferred]) self$rdkit <- list() - self$mol <- rdkit_module$Chem$MolFromSmiles(self$smiles[1]) + self$mol <- rdkit_module$Chem$MolFromSmiles(self$smiles[smiles_preferred]) self$rdkit$mw <- rdkit_module$Chem$Descriptors$MolWt(self$mol) if (!is.null(self$mw) && !is.na(self$mw)) { if (round(self$rdkit$mw, 1) != round(self$mw, 1)) { @@ -643,7 +643,7 @@ draw_svg.chent = function(x, width = 300, height = 150, #' } plot.chent = function(x, ...) { if (is.null(x$Picture)) stop("No Picture object in chent, was RDKit available during creation?") - grid.picture(x$Picture) + grid.picture(x$Picture, ...) } #' @title An R6 class for pesticidal active ingredients and associated data @@ -10,8 +10,11 @@ status](https://jranke.r-universe.dev/badges/chents)](https://jranke.r-universe. [](https://pkgdown.jrwb.de/chents/coverage/coverage.html) -The R package **chents** provides some utilities for working with -chemical entities in R. +When working with data on chemical substances, we often need a reliable +link between the data and the chemical identity of the substances. The R +package **chents** provides a way to define and check the identity of +chemically defined substances (“chemical entities”) and to collect +related information. When first defining a chemical entity, some chemical information is retrieved from the [PubChem](https://pubchem.ncbi.nlm.nih.gov/) website @@ -20,8 +23,8 @@ using the [webchem](https://docs.ropensci.org/webchem/) package. ``` r library(chents) caffeine <- chent$new("caffeine") -#> Querying PubChem ... -#> Trying to get chemical information from RDKit using PubChem SMILES +#> Querying PubChem for name caffeine ... +#> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C ``` @@ -47,7 +50,7 @@ print(caffeine) #> [3] "Guaranine" "1,3,7-Trimethylxanthine" #> [5] "Methyltheobromine" "Theine" #> [7] "Thein" "Cafeina" -#> [9] "Koffein" "Mateina" +#> [9] "Caffein" "Cafipel" ``` There is a very simple plotting method for the chemical structure. @@ -58,41 +61,46 @@ plot(caffeine) <!-- --> -Additional information can be (but is rarely ever) read from a local -.yaml file. This information can be leveraged e.g. by the -[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function -of the ‘pfm’ package. - If you have a so-called ISO common name of a pesticide active ingredient, you can use the ‘pai’ class derived from the ‘chent’ class, which starts with querying the [BCPC compendium](http://www.bcpcpesticidecompendium.org/) first. ``` r -lambda <- pai$new("lambda-cyhalothrin") -#> Querying BCPC for lambda-cyhalothrin ... -#> Querying PubChem ... -#> Trying to get chemical information from RDKit using PubChem SMILES -#> CC1([C@@H]([C@@H]1C(=O)O[C@@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)/C=C(/C(F)(F)F)\Cl)C -#> RDKit mw is 449.856 -#> mw is 449.8 -plot(lambda) +delta <- pai$new("deltamethrin") +#> Querying BCPC for deltamethrin ... +#> Querying PubChem for inchikey OWZREIFADZCYQD-NSHGMRRFSA-N ... +#> Get chemical information from RDKit using PubChem SMILES +#> CC1([C@H]([C@H]1C(=O)O[C@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)C=C(Br)Br)C +plot(delta) ``` <!-- --> +Additional information can be read from a local .yaml file. This +information can be leveraged e.g. by the +[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function +of the ‘pfm’ package. However, this functionality is to be superseded by +a dedicated package, defining data for the environmental risk assessment +on chemicals, in particular on active ingredients of plant protection +products. + ## Installation You can conveniently install chents from the repository kindly made available by the R-Universe project: - install.packages("chents", - repos = c("https://jranke.r-universe.dev", "https://cran.r-project.org")) +``` r +install.packages("chents", + repos = c("https://jranke.r-universe.dev", "https://cran.r-project.org")) +``` In order to profit from the chemoinformatics, you need to install RDKit and its python bindings. On a Debian type Linux distribution, just use - sudo apt install python3-rdkit +``` sh +sudo apt install python3-rdkit +``` If you use this package on Windows or MacOS, I would be happy to include installation instructions here if you share them with me, e.g. via a @@ -105,4 +113,6 @@ your global or project specific `.Rprofile` file to tell the `reticulate` package to use the system Python version that will find the RDKit installed in the system location. - Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") +``` r +Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") +``` @@ -14,8 +14,12 @@ knitr::opts_chunk$set( [](https://jranke.r-universe.dev/chents) [](https://pkgdown.jrwb.de/chents/coverage/coverage.html) -The R package **chents** provides some utilities for working with chemical -entities in R. +When working with data on chemical substances, we often need a reliable link between +the data and the chemical identity of the substances. The R package **chents** +provides a way to define and check the identity of chemically defined substances +("chemical entities") and to collect related information. + + When first defining a chemical entity, some chemical information is retrieved from the [PubChem](https://pubchem.ncbi.nlm.nih.gov/) website using @@ -39,31 +43,33 @@ print(caffeine) There is a very simple plotting method for the chemical structure. -```{r fig.width = 2} +```{r fig.height = 2} plot(caffeine) ``` -Additional information can be (but is rarely ever) read from a local .yaml -file. This information can be leveraged e.g. by the -[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function of the -'pfm' package. - If you have a so-called ISO common name of a pesticide active ingredient, you can use the 'pai' class derived from the 'chent' class, which starts with querying the [BCPC compendium](http://www.bcpcpesticidecompendium.org/) first. -```{r fig.width = 2} -lambda <- pai$new("lambda-cyhalothrin") -plot(lambda) +```{r fig.height = 3.5} +delta <- pai$new("deltamethrin") +plot(delta) ``` +Additional information can be read from a local .yaml file. This information +can be leveraged e.g. by the +[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function of the +'pfm' package. However, this functionality is to be superseded by a dedicated +package, defining data for the environmental risk assessment on chemicals, +in particular on active ingredients of plant protection products. + ## Installation You can conveniently install chents from the repository kindly made available by the R-Universe project: -``` +```{r, eval = FALSE} install.packages("chents", repos = c("https://jranke.r-universe.dev", "https://cran.r-project.org")) ``` @@ -71,9 +77,10 @@ install.packages("chents", In order to profit from the chemoinformatics, you need to install RDKit and its python bindings. On a Debian type Linux distribution, just use -``` +```{sh, eval = FALSE} sudo apt install python3-rdkit ``` + If you use this package on Windows or MacOS, I would be happy to include installation instructions here if you share them with me, e.g. via a Pull Request. @@ -85,7 +92,7 @@ global or project specific `.Rprofile` file to tell the `reticulate` package to use the system Python version that will find the RDKit installed in the system location. -``` +```{r, eval = FALSE} Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") ``` diff --git a/docs/authors.html b/docs/authors.html index a11c70d..162162f 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -46,14 +46,14 @@ <p>Ranke J (2026). <em>chents: Chemical Entities as R Objects</em>. -R package version 0.4.1, <a href="https://pkgdown.jrwb.de/chents">https://pkgdown.jrwb.de/chents</a>. +R package version 0.4.1, <a href="https://pkgdown.jrwb.de/chents/">https://pkgdown.jrwb.de/chents/</a>. </p> <pre>@Manual{, title = {chents: Chemical Entities as R Objects}, author = {Johannes Ranke}, year = {2026}, note = {R package version 0.4.1}, - url = {https://pkgdown.jrwb.de/chents}, + url = {https://pkgdown.jrwb.de/chents/}, }</pre> </div> diff --git a/docs/authors.md b/docs/authors.md index e297afa..ff9ca2d 100644 --- a/docs/authors.md +++ b/docs/authors.md @@ -10,12 +10,12 @@ Source: [`DESCRIPTION`](https://github.com/jranke/chents/blob/HEAD/DESCRIPTION) Ranke J (2026). *chents: Chemical Entities as R Objects*. R package -version 0.4.1, <https://pkgdown.jrwb.de/chents>. +version 0.4.1, <https://pkgdown.jrwb.de/chents/>. @Manual{, title = {chents: Chemical Entities as R Objects}, author = {Johannes Ranke}, year = {2026}, note = {R package version 0.4.1}, - url = {https://pkgdown.jrwb.de/chents}, + url = {https://pkgdown.jrwb.de/chents/}, } diff --git a/docs/index.html b/docs/index.html index 6623b75..aec7d06 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,13 +50,13 @@ <div class="page-header"><h1 id="chents">chents<a class="anchor" aria-label="anchor" href="#chents"></a> </h1></div> <p><a href="https://pkgdown.jrwb.de/chents/"><img src="https://img.shields.io/badge/docs-jrwb.de-blue.svg" alt="Online documentation"></a> <a href="https://jranke.r-universe.dev/chents" class="external-link"><img src="https://jranke.r-universe.dev/badges/chents" alt="R-Universe status"></a> <a href="https://pkgdown.jrwb.de/chents/coverage/coverage.html"><img src="https://img.shields.io/badge/coverage-jrwb.de-blue.svg" alt="Code coverage"></a></p> -<p>The R package <strong>chents</strong> provides some utilities for working with chemical entities in R.</p> +<p>When working with data on chemical substances, we often need a reliable link between the data and the chemical identity of the substances. The R package <strong>chents</strong> provides a way to define and check the identity of chemically defined substances (“chemical entities”) and to collect related information.</p> <p>When first defining a chemical entity, some chemical information is retrieved from the <a href="https://pubchem.ncbi.nlm.nih.gov/" class="external-link">PubChem</a> website using the <a href="https://docs.ropensci.org/webchem/" class="external-link">webchem</a> package.</p> <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/chents">chents</a></span><span class="op">)</span></span> +<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/chents/">chents</a></span><span class="op">)</span></span> <span><span class="va">caffeine</span> <span class="op"><-</span> <span class="va"><a href="reference/chent.html">chent</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="st">"caffeine"</span><span class="op">)</span></span> -<span><span class="co">#> Querying PubChem ...</span></span> -<span><span class="co">#> Trying to get chemical information from RDKit using PubChem SMILES</span></span> +<span><span class="co">#> Querying PubChem for name caffeine ...</span></span> +<span><span class="co">#> Get chemical information from RDKit using PubChem SMILES</span></span> <span><span class="co">#> CN1C=NC2=C1C(=O)N(C(=O)N2C)C</span></span></code></pre></div> <p>If Python and <a href="https://rdkit.org" class="external-link">RDKit</a> (> 2015.03) are installed and configured for use with the <a href="https://rstudio.github.io/reticulate/" class="external-link">reticulate</a> package, some additional chemical information including a 2D graph are computed.</p> <p>The print method gives an overview of the information that was collected.</p> @@ -74,38 +74,40 @@ <span><span class="co">#> [3] "Guaranine" "1,3,7-Trimethylxanthine"</span></span> <span><span class="co">#> [5] "Methyltheobromine" "Theine" </span></span> <span><span class="co">#> [7] "Thein" "Cafeina" </span></span> -<span><span class="co">#> [9] "Koffein" "Mateina"</span></span></code></pre></div> +<span><span class="co">#> [9] "Caffein" "Cafipel"</span></span></code></pre></div> <p>There is a very simple plotting method for the chemical structure.</p> <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">caffeine</span><span class="op">)</span></span></code></pre></div> <p><img src="reference/figures/README-unnamed-chunk-4-1.png"><!-- --></p> -<p>Additional information can be (but is rarely ever) read from a local .yaml file. This information can be leveraged e.g. by the <a href="https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html" class="external-link">PEC_soil</a> function of the ‘pfm’ package.</p> <p>If you have a so-called ISO common name of a pesticide active ingredient, you can use the ‘pai’ class derived from the ‘chent’ class, which starts with querying the <a href="http://www.bcpcpesticidecompendium.org/" class="external-link">BCPC compendium</a> first.</p> <div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span><span class="va">lambda</span> <span class="op"><-</span> <span class="va"><a href="reference/pai.html">pai</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="st">"lambda-cyhalothrin"</span><span class="op">)</span></span> <span><span class="co">#> Querying BCPC for lambda-cyhalothrin ...</span></span> -<span><span class="co">#> Querying PubChem ...</span></span> -<span><span class="co">#> Trying to get chemical information from RDKit using PubChem SMILES</span></span> +<span><span class="co">#> Querying PubChem for name lambda-cyhalothrin ...</span></span> +<span><span class="co">#> Get chemical information from RDKit using PubChem SMILES</span></span> <span><span class="co">#> CC1([C@@H]([C@@H]1C(=O)O[C@@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)/C=C(/C(F)(F)F)\Cl)C</span></span> -<span><span class="co">#> RDKit mw is 449.856</span></span> -<span><span class="co">#> mw is 449.8</span></span> +<span><span class="co">#> Warning in self$get_rdkit(template = template): RDKit mw is 449.856 while mw is</span></span> +<span><span class="co">#> 449.8</span></span> <span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">lambda</span><span class="op">)</span></span></code></pre></div> <p><img src="reference/figures/README-unnamed-chunk-5-1.png"><!-- --></p> +<p>Additional information can be read from a local .yaml file. This information can be leveraged e.g. by the <a href="https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html" class="external-link">PEC_soil</a> function of the ‘pfm’ package. However, this functionality is to be superseded by a dedicated package, defining data for the environmental risk assessment on chemicals, in particular on active ingredients of plant protection products.</p> <div class="section level2"> <h2 id="installation">Installation<a class="anchor" aria-label="anchor" href="#installation"></a> </h2> <p>You can conveniently install chents from the repository kindly made available by the R-Universe project:</p> -<div class="sourceCode" id="cb5"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="fu">install.packages</span>(<span class="st">"chents"</span>,</span> -<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a> <span class="at">repos =</span> <span class="fu">c</span>(<span class="st">"https://jranke.r-universe.dev"</span>, <span class="st">"https://cran.r-project.org"</span>))</span></code></pre></div> +<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"chents"</span>,</span> +<span> repos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"https://jranke.r-universe.dev"</span>, <span class="st">"https://cran.r-project.org"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div> <p>In order to profit from the chemoinformatics, you need to install RDKit and its python bindings. On a Debian type Linux distribution, just use</p> -<div class="sourceCode" id="cb6"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" tabindex="-1"></a>sudo apt install python3<span class="sc">-</span>rdkit</span></code></pre></div> +<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" tabindex="-1"></a><span class="fu">sudo</span> apt install python3-rdkit</span></code></pre></div> <p>If you use this package on Windows or MacOS, I would be happy to include installation instructions here if you share them with me, e.g. via a Pull Request.</p> </div> <div class="section level2"> <h2 id="configuration-of-the-python-version-to-use">Configuration of the Python version to use<a class="anchor" aria-label="anchor" href="#configuration-of-the-python-version-to-use"></a> </h2> <p>On Debian type Linux distributions, you can use the following line in your global or project specific <code>.Rprofile</code> file to tell the <code>reticulate</code> package to use the system Python version that will find the RDKit installed in the system location.</p> -<div class="sourceCode" id="cb7"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" tabindex="-1"></a><span class="fu">Sys.setenv</span>(<span class="at">RETICULATE_PYTHON=</span><span class="st">"/usr/bin/python3"</span>)</span></code></pre></div> +<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/base/Sys.setenv.html" class="external-link">Sys.setenv</a></span><span class="op">(</span>RETICULATE_PYTHON<span class="op">=</span><span class="st">"/usr/bin/python3"</span><span class="op">)</span></span></code></pre></div> </div> </div> </main><aside class="col-md-3"><div class="links"> diff --git a/docs/index.md b/docs/index.md index 199ad78..7861205 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,8 +7,11 @@ status](https://jranke.r-universe.dev/badges/chents)](https://jranke.r-universe. [](https://pkgdown.jrwb.de/chents/coverage/coverage.html) -The R package **chents** provides some utilities for working with -chemical entities in R. +When working with data on chemical substances, we often need a reliable +link between the data and the chemical identity of the substances. The R +package **chents** provides a way to define and check the identity of +chemically defined substances (“chemical entities”) and to collect +related information. When first defining a chemical entity, some chemical information is retrieved from the [PubChem](https://pubchem.ncbi.nlm.nih.gov/) website @@ -17,8 +20,8 @@ using the [webchem](https://docs.ropensci.org/webchem/) package. ``` r library(chents) caffeine <- chent$new("caffeine") -#> Querying PubChem ... -#> Trying to get chemical information from RDKit using PubChem SMILES +#> Querying PubChem for name caffeine ... +#> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C ``` @@ -44,7 +47,7 @@ print(caffeine) #> [3] "Guaranine" "1,3,7-Trimethylxanthine" #> [5] "Methyltheobromine" "Theine" #> [7] "Thein" "Cafeina" -#> [9] "Koffein" "Mateina" +#> [9] "Caffein" "Cafipel" ``` There is a very simple plotting method for the chemical structure. @@ -55,11 +58,6 @@ plot(caffeine)  -Additional information can be (but is rarely ever) read from a local -.yaml file. This information can be leveraged e.g. by the -[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function -of the ‘pfm’ package. - If you have a so-called ISO common name of a pesticide active ingredient, you can use the ‘pai’ class derived from the ‘chent’ class, which starts with querying the [BCPC @@ -68,22 +66,30 @@ compendium](http://www.bcpcpesticidecompendium.org/) first. ``` r lambda <- pai$new("lambda-cyhalothrin") #> Querying BCPC for lambda-cyhalothrin ... -#> Querying PubChem ... -#> Trying to get chemical information from RDKit using PubChem SMILES +#> Querying PubChem for name lambda-cyhalothrin ... +#> Get chemical information from RDKit using PubChem SMILES #> CC1([C@@H]([C@@H]1C(=O)O[C@@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)/C=C(/C(F)(F)F)\Cl)C -#> RDKit mw is 449.856 -#> mw is 449.8 +#> Warning in self$get_rdkit(template = template): RDKit mw is 449.856 while mw is +#> 449.8 plot(lambda) ```  +Additional information can be read from a local .yaml file. This +information can be leveraged e.g. by the +[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function +of the ‘pfm’ package. However, this functionality is to be superseded by +a dedicated package, defining data for the environmental risk assessment +on chemicals, in particular on active ingredients of plant protection +products. + ## Installation You can conveniently install chents from the repository kindly made available by the R-Universe project: -``` R +``` r install.packages("chents", repos = c("https://jranke.r-universe.dev", "https://cran.r-project.org")) ``` @@ -91,7 +97,7 @@ install.packages("chents", In order to profit from the chemoinformatics, you need to install RDKit and its python bindings. On a Debian type Linux distribution, just use -``` R +``` sh sudo apt install python3-rdkit ``` @@ -106,6 +112,6 @@ your global or project specific `.Rprofile` file to tell the `reticulate` package to use the system Python version that will find the RDKit installed in the system location. -``` R +``` r Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") ``` diff --git a/docs/llms.txt b/docs/llms.txt index 60135e4..28cceea 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -7,8 +7,11 @@ status](https://jranke.r-universe.dev/badges/chents)](https://jranke.r-universe. [](https://pkgdown.jrwb.de/chents/coverage/coverage.html) -The R package **chents** provides some utilities for working with -chemical entities in R. +When working with data on chemical substances, we often need a reliable +link between the data and the chemical identity of the substances. The R +package **chents** provides a way to define and check the identity of +chemically defined substances (“chemical entities”) and to collect +related information. When first defining a chemical entity, some chemical information is retrieved from the [PubChem](https://pubchem.ncbi.nlm.nih.gov/) website @@ -17,8 +20,8 @@ using the [webchem](https://docs.ropensci.org/webchem/) package. ``` r library(chents) caffeine <- chent$new("caffeine") -#> Querying PubChem ... -#> Trying to get chemical information from RDKit using PubChem SMILES +#> Querying PubChem for name caffeine ... +#> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C ``` @@ -44,7 +47,7 @@ print(caffeine) #> [3] "Guaranine" "1,3,7-Trimethylxanthine" #> [5] "Methyltheobromine" "Theine" #> [7] "Thein" "Cafeina" -#> [9] "Koffein" "Mateina" +#> [9] "Caffein" "Cafipel" ``` There is a very simple plotting method for the chemical structure. @@ -55,11 +58,6 @@ plot(caffeine)  -Additional information can be (but is rarely ever) read from a local -.yaml file. This information can be leveraged e.g. by the -[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function -of the ‘pfm’ package. - If you have a so-called ISO common name of a pesticide active ingredient, you can use the ‘pai’ class derived from the ‘chent’ class, which starts with querying the [BCPC @@ -68,22 +66,30 @@ compendium](http://www.bcpcpesticidecompendium.org/) first. ``` r lambda <- pai$new("lambda-cyhalothrin") #> Querying BCPC for lambda-cyhalothrin ... -#> Querying PubChem ... -#> Trying to get chemical information from RDKit using PubChem SMILES +#> Querying PubChem for name lambda-cyhalothrin ... +#> Get chemical information from RDKit using PubChem SMILES #> CC1([C@@H]([C@@H]1C(=O)O[C@@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)/C=C(/C(F)(F)F)\Cl)C -#> RDKit mw is 449.856 -#> mw is 449.8 +#> Warning in self$get_rdkit(template = template): RDKit mw is 449.856 while mw is +#> 449.8 plot(lambda) ```  +Additional information can be read from a local .yaml file. This +information can be leveraged e.g. by the +[PEC_soil](https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html) function +of the ‘pfm’ package. However, this functionality is to be superseded by +a dedicated package, defining data for the environmental risk assessment +on chemicals, in particular on active ingredients of plant protection +products. + ## Installation You can conveniently install chents from the repository kindly made available by the R-Universe project: -``` R +``` r install.packages("chents", repos = c("https://jranke.r-universe.dev", "https://cran.r-project.org")) ``` @@ -91,7 +97,7 @@ install.packages("chents", In order to profit from the chemoinformatics, you need to install RDKit and its python bindings. On a Debian type Linux distribution, just use -``` R +``` sh sudo apt install python3-rdkit ``` @@ -106,7 +112,7 @@ your global or project specific `.Rprofile` file to tell the `reticulate` package to use the system Python version that will find the RDKit installed in the system location. -``` R +``` r Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") ``` diff --git a/docs/news/index.html b/docs/news/index.html index 1020efc..fe076cb 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -34,7 +34,8 @@ <div class="section level2"> <h2 class="pkg-version" data-toc-text="0.4.1" id="version-041">version 0.4.1<a class="anchor" aria-label="anchor" href="#version-041"></a></h2> -<ul><li>R/chent.R: Improve print method for <code>pai</code> objects.</li> +<ul><li>R/chent.R: Improve print method for <code>pai</code> objects</li> +<li>plot method for chents: Pass dots argument to <code>grid.picture()</code> as documented.</li> </ul></div> <div class="section level2"> <h2 class="pkg-version" data-toc-text="0.4.0" id="version-040">version 0.4.0<a class="anchor" aria-label="anchor" href="#version-040"></a></h2> diff --git a/docs/news/index.md b/docs/news/index.md index 32ad5c9..f56826b 100644 --- a/docs/news/index.md +++ b/docs/news/index.md @@ -2,7 +2,9 @@ ## version 0.4.1 -- R/chent.R: Improve print method for `pai` objects. +- R/chent.R: Improve print method for `pai` objects +- plot method for chents: Pass dots argument to `grid.picture()` as + documented. ## version 0.4.0 diff --git a/docs/reference/figures/README-unnamed-chunk-4-1.png b/docs/reference/figures/README-unnamed-chunk-4-1.png Binary files differindex 21caae7..d93b539 100644 --- a/docs/reference/figures/README-unnamed-chunk-4-1.png +++ b/docs/reference/figures/README-unnamed-chunk-4-1.png diff --git a/docs/reference/figures/README-unnamed-chunk-5-1.png b/docs/reference/figures/README-unnamed-chunk-5-1.png Binary files differindex d54f3a0..571d02d 100644 --- a/docs/reference/figures/README-unnamed-chunk-5-1.png +++ b/docs/reference/figures/README-unnamed-chunk-5-1.png diff --git a/docs/reference/ppp.html b/docs/reference/ppp.html index 98bc8e1..29ce898 100644 --- a/docs/reference/ppp.html +++ b/docs/reference/ppp.html @@ -9,7 +9,7 @@ product"></head><body> <a class="navbar-brand me-2" href="../index.html">chents</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.4.0</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.4.1</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> @@ -153,7 +153,7 @@ product</p> </div> <div class="pkgdown-footer-right"> - <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.3.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.2.0.</p> </div> </footer></div> diff --git a/docs/search.json b/docs/search.json index 0312572..be963e3 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"https://pkgdown.jrwb.de/chents/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Johannes Ranke. Author, maintainer, copyright holder.","code":""},{"path":"https://pkgdown.jrwb.de/chents/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Ranke J (2026). chents: Chemical Entities R Objects. R package version 0.4.1, https://pkgdown.jrwb.de/chents.","code":"@Manual{, title = {chents: Chemical Entities as R Objects}, author = {Johannes Ranke}, year = {2026}, note = {R package version 0.4.1}, url = {https://pkgdown.jrwb.de/chents}, }"},{"path":"https://pkgdown.jrwb.de/chents/index.html","id":"chents","dir":"","previous_headings":"","what":"Chemical Entities as R Objects","title":"Chemical Entities as R Objects","text":"R package chents provides utilities working chemical entities R. first defining chemical entity, chemical information retrieved PubChem website using webchem package. Python RDKit (> 2015.03) installed configured use reticulate package, additional chemical information including 2D graph computed. print method gives overview information collected. simple plotting method chemical structure. Additional information can (rarely ever) read local .yaml file. information can leveraged e.g. PEC_soil function ‘pfm’ package. -called ISO common name pesticide active ingredient, can use ‘pai’ class derived ‘chent’ class, starts querying BCPC compendium first.","code":"library(chents) caffeine <- chent$new(\"caffeine\") #> Querying PubChem ... #> Trying to get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C print(caffeine) #> <chent> #> Identifier $identifier caffeine #> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" #> Molecular weight $mw: 194.2 #> PubChem synonyms (up to 10): #> [1] \"caffeine\" \"58-08-2\" #> [3] \"Guaranine\" \"1,3,7-Trimethylxanthine\" #> [5] \"Methyltheobromine\" \"Theine\" #> [7] \"Thein\" \"Cafeina\" #> [9] \"Koffein\" \"Mateina\" plot(caffeine) lambda <- pai$new(\"lambda-cyhalothrin\") #> Querying BCPC for lambda-cyhalothrin ... #> Querying PubChem ... #> Trying to get chemical information from RDKit using PubChem SMILES #> CC1([C@@H]([C@@H]1C(=O)O[C@@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)/C=C(/C(F)(F)F)\\Cl)C #> RDKit mw is 449.856 #> mw is 449.8 plot(lambda)"},{"path":"https://pkgdown.jrwb.de/chents/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Chemical Entities as R Objects","text":"can conveniently install chents repository kindly made available R-Universe project: order profit chemoinformatics, need install RDKit python bindings. Debian type Linux distribution, just use use package Windows MacOS, happy include installation instructions share , e.g. via Pull Request.","code":"install.packages(\"chents\", repos = c(\"https://jranke.r-universe.dev\", \"https://cran.r-project.org\")) sudo apt install python3-rdkit"},{"path":"https://pkgdown.jrwb.de/chents/index.html","id":"configuration-of-the-python-version-to-use","dir":"","previous_headings":"","what":"Configuration of the Python version to use","title":"Chemical Entities as R Objects","text":"Debian type Linux distributions, can use following line global project specific .Rprofile file tell reticulate package use system Python version find RDKit installed system location.","code":"Sys.setenv(RETICULATE_PYTHON=\"/usr/bin/python3\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":null,"dir":"Reference","previous_headings":"","what":"An R6 class for chemical entities with associated data — chent","title":"An R6 class for chemical entities with associated data — chent","text":"class initialised identifier. Chemical information retrieved internet. Additionally, can generated using RDKit RDKit python bindings installed.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"An R6 class for chemical entities with associated data — chent","text":"R6::R6Class generator object","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"An R6 class for chemical entities with associated data — chent","text":"identifier (character(1)) identifier used initiate object, attribute 'source' inchikey (character(1)) InChI Key, attribute 'source' smiles (character()) SMILES code(s), attribute 'source' mw (numeric(1)) Molecular weight, attribute 'source' pubchem (list()) List information retrieved PubChem rdkit List information obtained RDKit mol <rdkit.Chem.rdchem.Mol> object svg SVG code Picture Graph grImport::Picture object obtained using grImport package Pict_font_size Font size extracted intermediate PostScript file pdf_height Height MediaBox pdf cropping p0 Vapour pressure Pa cwsat Water solubility mg/L PUF Plant uptake factor chyaml List information obtained YAML file TPs List transformation products chent objects transformations Data frame observed transformations soil_degradation Dataframe modelling DT50 values soil_ff Dataframe formation fractions soil_sorption Dataframe soil sorption data","code":""},{"path":[]},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"An R6 class for chemical entities with associated data — chent","text":"chent$new() chent$try_pubchem() chent$get_pubchem() chent$get_rdkit() chent$get_chyaml() chent$add_p0() chent$add_cwsat() chent$add_PUF() chent$add_TP() chent$add_transformation() chent$add_soil_degradation() chent$add_soil_ff() chent$add_soil_sorption() chent$pdf() chent$png() chent$emf() chent$clone()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"An R6 class for chemical entities with associated data — chent","text":"Creates new instance R6 class.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$new( identifier, smiles = NULL, inchikey = NULL, pubchem = TRUE, pubchem_from = c(\"name\", \"smiles\", \"inchikey\"), rdkit = TRUE, template = NULL, chyaml = FALSE )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"identifier Identifier stored object smiles Optional user provided SMILES code inchikey Optional user provided InChI Key pubchem attempt made retrieve chemical information PubChem via webchem package? pubchem_from Possibility select argument used query pubchem rdkit attempt made retrieve chemical information local rdkit installation via python reticulate package? template optional SMILES code used template RDKit chyaml look identifier.yaml file working directory?","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-try-pubchem-","dir":"Reference","previous_headings":"","what":"Method try_pubchem()","title":"An R6 class for chemical entities with associated data — chent","text":"Try get chemical information PubChem","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$try_pubchem(query = self$identifier, from = \"name\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"query Query string passed get_cid Passed get_cid","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-get-pubchem-","dir":"Reference","previous_headings":"","what":"Method get_pubchem()","title":"An R6 class for chemical entities with associated data — chent","text":"Get chemical information PubChem known PubChem CID","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$get_pubchem(pubchem_cid)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"pubchem_cid CID","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-get-rdkit-","dir":"Reference","previous_headings":"","what":"Method get_rdkit()","title":"An R6 class for chemical entities with associated data — chent","text":"Get chemical information RDKit available","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$get_rdkit(template = NULL)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"template optional SMILES code used template RDKit","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-get-chyaml-","dir":"Reference","previous_headings":"","what":"Method get_chyaml()","title":"An R6 class for chemical entities with associated data — chent","text":"Obtain information YAML file","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$get_chyaml( repo = c(\"wd\", \"local\", \"web\"), chyaml = paste0(URLencode(self$identifier), \".yaml\") )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"repo file looked current working directory, local git repository ~/git/chyaml, web (implemented). chyaml filename looked ","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-p-","dir":"Reference","previous_headings":"","what":"Method add_p0()","title":"An R6 class for chemical entities with associated data — chent","text":"Add vapour pressure","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_p0(p0, T = NA, source = NA, page = NA, remark = \"\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"p0 vapour pressure Pa T Temperature source acronym specifying source information page page information taken remark remark","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-cwsat-","dir":"Reference","previous_headings":"","what":"Method add_cwsat()","title":"An R6 class for chemical entities with associated data — chent","text":"Add water solubility","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_cwsat(cwsat, T = NA, pH = NA, source = NA, page = NA, remark = \"\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"cwsat water solubility mg/L T Temperature pH pH value source acronym specifying source information page page information taken remark remark","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-puf-","dir":"Reference","previous_headings":"","what":"Method add_PUF()","title":"An R6 class for chemical entities with associated data — chent","text":"Add plant uptake factor","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_PUF( PUF = 0, source = \"focus_generic_gw_2014\", page = 41, remark = \"Conservative default value\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"PUF plant uptake factor, number 0 1 source acronym specifying source information page page information taken remark remark","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-tp-","dir":"Reference","previous_headings":"","what":"Method add_TP()","title":"An R6 class for chemical entities with associated data — chent","text":"Add transformation product internal list","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_TP(x, smiles = NULL, pubchem = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"x chent object, identifier generate chent object smiles Optional user provided SMILES code pubchem chemical information obtained PubChem?","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-transformation-","dir":"Reference","previous_headings":"","what":"Method add_transformation()","title":"An R6 class for chemical entities with associated data — chent","text":"Add line internal dataframe holding observed transformations","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_transformation( study_type, TP_identifier, max_occurrence, remark = \"\", source = NA, pages = NA )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"study_type characterisation study type TP_identifier identifier one transformation products self$TPs max_occurrence maximum observed occurrence transformation product, expressed fraction amount result stochiometric transformation remark remark source acronym specifying source information pages pages information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-soil-degradation-","dir":"Reference","previous_headings":"","what":"Method add_soil_degradation()","title":"An R6 class for chemical entities with associated data — chent","text":"Add line internal dataframe holding modelling DT50 values","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_soil_degradation( soils, DT50_mod, DT50_mod_ref, type = NA, country = NA, pH_orig = NA, pH_medium = NA, pH_H2O = NA, perc_OC = NA, temperature = NA, moisture = NA, category = \"lab\", formulation = NA, model = NA, chi2 = NA, remark = \"\", source, page = NA )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"soils Names soils DT50_mod modelling DT50 sense regulatory pesticide fate modelling DT50_mod_ref normalised modelling DT50 sense regulatory pesticide fate modelling type soil type country country (mainly field studies) pH_orig pH stated study pH_medium medium pH measured pH_H2O pH extrapolated pure water perc_OC percentage organic carbon soil temperature temperature study degrees Celsius moisture moisture study category laboratory ('lab') field study ('field') formulation Name formulation applied, technical active ingredient model degradation model used deriving DT50_mod chi2 relative error defined FOCUS kinetics remark remark source acronym specifying source information page page information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-soil-ff-","dir":"Reference","previous_headings":"","what":"Method add_soil_ff()","title":"An R6 class for chemical entities with associated data — chent","text":"Add one formation fractions degradation soil","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_soil_ff(target, soils, ff = 1, remark = \"\", source, page = NA)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"target identifier(s) transformation product soils soil name(s) transformation observed ff formation fraction(s) remark remark source acronym specifying source information page page information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-soil-sorption-","dir":"Reference","previous_headings":"","what":"Method add_soil_sorption()","title":"An R6 class for chemical entities with associated data — chent","text":"Add soil sorption data","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_soil_sorption( soils, Kf, Kfoc, N, type = NA, pH_orig = NA, pH_medium = NA, pH_H2O = NA, perc_OC = NA, perc_clay = NA, CEC = NA, remark = \"\", source, page = NA )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-12","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"soils Names soils Kf sorption constant L/kg, either linear (N 1) according Freundlich Kfoc constant , normalised soil organic carbon N Freundlich exponent type soil type pH_orig pH stated study pH_medium medium pH measured pH_H2O pH extrapolated pure water perc_OC percentage organic carbon soil perc_clay percentage clay soil CEC cation exchange capacity remark remark source acronym specifying source information page page information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-pdf-","dir":"Reference","previous_headings":"","what":"Method pdf()","title":"An R6 class for chemical entities with associated data — chent","text":"Write PDF image structure","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$pdf( file = paste0(self$identifier, \".pdf\"), dir = \"structures/pdf\", template = NULL )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-13","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"file file write dir directory write file template optional SMILES code used template RDKit","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-png-","dir":"Reference","previous_headings":"","what":"Method png()","title":"An R6 class for chemical entities with associated data — chent","text":"Write PNG image structure","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-14","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$png( file = paste0(self$identifier, \".png\"), dir = \"structures/png\", antialias = \"gray\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-14","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"file file write dir directory write file antialias Passed png","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-emf-","dir":"Reference","previous_headings":"","what":"Method emf()","title":"An R6 class for chemical entities with associated data — chent","text":"Write EMF image structure using emf","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-15","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$emf(file = paste0(self$identifier, \".emf\"), dir = \"structures/emf\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-15","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"file file write dir directory write file ","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"An R6 class for chemical entities with associated data — chent","text":"objects class cloneable method.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-16","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$clone(deep = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-16","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"deep Whether make deep clone.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"# Don't run examples per default, as PubChem may be unavailable # \\dontrun{ caffeine <- chent$new(\"caffeine\") #> Querying PubChem for name caffeine ... #> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C print(caffeine) #> <chent> #> Identifier $identifier caffeine #> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" #> Molecular weight $mw: 194.2 #> PubChem synonyms (up to 10): #> [1] \"caffeine\" \"58-08-2\" #> [3] \"Guaranine\" \"1,3,7-Trimethylxanthine\" #> [5] \"Methyltheobromine\" \"Theine\" #> [7] \"Thein\" \"Cafeina\" #> [9] \"Caffein\" \"Cafipel\" if (!is.null(caffeine$Picture)) { plot(caffeine) } oct <- chent$new(\"1-octanol\", smiles = \"CCCCCCCCO\", pubchem = FALSE) #> Get chemical information from RDKit using user SMILES #> CCCCCCCCO print(oct) #> <chent> #> Identifier $identifier 1-octanol #> InChI Key $inchikey NA #> SMILES string $smiles: #> user #> \"CCCCCCCCO\" #> Molecular weight $mw: 130.2 # }"},{"path":"https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","title":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","text":"Draw SVG graph chent object using RDKit","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","text":"","code":"draw_svg.chent( x, width = 300, height = 150, filename = paste0(names(x$identifier), \".svg\"), subdir = \"svg\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","text":"x chent object plotted width desired width pixels height desired height pixels filename filename subdir path file written","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":null,"dir":"Reference","previous_headings":"","what":"An R6 class for pesticidal active ingredients and associated data — pai","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"class derived chent. makes easy create chent ISO common name pesticide active ingredient, additionally stores ISO name well complete result querying BCPC compendium using bcpc_query.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"R6::R6Class generator object","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"chents::chent -> pai","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"iso ISO common name active ingredient according ISO 1750 bcpc Information retrieved BCPC compendium available online <pesticidecompendium.bcpc.org>","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"chents::chent$add_PUF() chents::chent$add_TP() chents::chent$add_cwsat() chents::chent$add_p0() chents::chent$add_soil_degradation() chents::chent$add_soil_ff() chents::chent$add_soil_sorption() chents::chent$add_transformation() chents::chent$emf() chents::chent$get_chyaml() chents::chent$get_pubchem() chents::chent$get_rdkit() chents::chent$pdf() chents::chent$png() chents::chent$try_pubchem()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"pai$new() pai$clone()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"Create new pai object","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"","code":"pai$new( iso, identifier = iso, smiles = NULL, inchikey = NULL, bcpc = TRUE, pubchem = TRUE, pubchem_from = \"auto\", rdkit = TRUE, template = NULL, chyaml = FALSE )"},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"iso ISO common name used query BCPC compendium identifier Alternative identifier used querying pubchem smiles Optional user provided SMILES code inchikey Optional user provided InChI Key bcpc BCPC compendium queried? pubchem attempt made retrieve chemical information PubChem via webchem package? pubchem_from Possibility select argument used query pubchem rdkit attempt made retrieve chemical information local rdkit installation via python reticulate package? template optional SMILES code used template RDKit chyaml look identifier.yaml file working","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"objects class cloneable method.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"","code":"pai$clone(deep = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"deep Whether make deep clone.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"","code":"# Don't run examples per default, as PubChem may be unavailable # \\dontrun{ atr <- pai$new(\"atrazine\") #> Querying BCPC for atrazine ... #> Querying PubChem for inchikey MXWJVTOOROXGIU-UHFFFAOYSA-N ... #> Get chemical information from RDKit using PubChem SMILES #> CCNC1=NC(=NC(=N1)Cl)NC(C)C print(atr) #> <pai> with ISO common name $iso atrazine #> <chent> #> Identifier $identifier atrazine #> InChI Key $inchikey MXWJVTOOROXGIU-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CCNC1=NC(=NC(=N1)Cl)NC(C)C\" #> Molecular weight $mw: 215.7 #> PubChem synonyms (up to 10): #> [1] \"atrazine\" \"1912-24-9\" \"Gesaprim\" \"Aatrex\" \"Atranex\" #> [6] \"Atrazin\" \"Oleogesaprim\" \"Atazinax\" \"Atrasine\" \"Chromozin\" if (!is.null(atr$Picture)) { plot(atr) } # We can also define pais that are not found on the BCPC site decanol <- pai$new(\"1-Decanol\") #> Querying BCPC for 1-Decanol ... #> Common name 1-Decanol is not known at the BCPC compendium, trying PubChem #> Querying PubChem for name 1-Decanol ... #> Get chemical information from RDKit using PubChem SMILES #> CCCCCCCCCCO print(decanol) #> <pai> without ISO common name #> <chent> #> Identifier $identifier 1-Decanol #> InChI Key $inchikey MWKFXSUHUHTGQN-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CCCCCCCCCCO\" #> Molecular weight $mw: 158.3 #> PubChem synonyms (up to 10): #> [1] \"1-DECANOL\" \"Decan-1-ol\" \"Decyl alcohol\" \"112-30-1\" #> [5] \"n-Decyl alcohol\" \"n-Decanol\" \"Capric alcohol\" \"Nonylcarbinol\" #> [9] \"Antak\" \"Royaltac\" # }"},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot method for chent objects — plot.chent","title":"Plot method for chent objects — plot.chent","text":"Plot method chent objects","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot method for chent objects — plot.chent","text":"","code":"# S3 method for class 'chent' plot(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot method for chent objects — plot.chent","text":"x chent object plotted ... arguments passed grImport::grid.picture","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot method for chent objects — plot.chent","text":"","code":"# Don't run examples per default, as PubChem may be unavailable # \\dontrun{ caffeine <- chent$new(\"caffeine\") #> Querying PubChem for name caffeine ... #> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C print(caffeine) #> <chent> #> Identifier $identifier caffeine #> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" #> Molecular weight $mw: 194.2 #> PubChem synonyms (up to 10): #> [1] \"caffeine\" \"58-08-2\" #> [3] \"Guaranine\" \"1,3,7-Trimethylxanthine\" #> [5] \"Methyltheobromine\" \"Theine\" #> [7] \"Thein\" \"Cafeina\" #> [9] \"Caffein\" \"Cafipel\" if (!is.null(caffeine$Picture)) { plot(caffeine) } # }"},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 class for a plant protection product with at least one active ingredient — ppp","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"Contains basic information active ingredients product","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"R6::R6Class generator object.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"name name product ais list active ingredients concentrations concentration ais concentration_units Defaults g/L density density product density_units Defaults g/L","code":""},{"path":[]},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"ppp$new() ppp$clone()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"Creates new instance R6 class.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"","code":"ppp$new( name, ..., concentrations, concentration_units = \"g/L\", density = 1000, density_units = \"g/L\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"name name product ... Identifiers active ingredients concentrations Concentrations active ingredients concentration_units Defaults g/L density density density_units Defaults g/L","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"objects class cloneable method.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"","code":"ppp$clone(deep = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"deep Whether make deep clone.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.chent.html","id":null,"dir":"Reference","previous_headings":"","what":"Printing method for chent objects — print.chent","title":"Printing method for chent objects — print.chent","text":"Printing method chent objects","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.chent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Printing method for chent objects — print.chent","text":"","code":"# S3 method for class 'chent' print(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/print.chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Printing method for chent objects — print.chent","text":"x chent object printed ... arguments compatibility S3 method","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.pai.html","id":null,"dir":"Reference","previous_headings":"","what":"Printing method for pai objects (pesticidal active ingredients) — print.pai","title":"Printing method for pai objects (pesticidal active ingredients) — print.pai","text":"Printing method pai objects (pesticidal active ingredients)","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.pai.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Printing method for pai objects (pesticidal active ingredients) — print.pai","text":"","code":"# S3 method for class 'pai' print(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/print.pai.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Printing method for pai objects (pesticidal active ingredients) — print.pai","text":"x chent object printed ... arguments compatibility S3 method","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.ppp.html","id":null,"dir":"Reference","previous_headings":"","what":"Printing method for ppp objects (plant protection products) — print.ppp","title":"Printing method for ppp objects (plant protection products) — print.ppp","text":"Printing method ppp objects (plant protection products)","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.ppp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Printing method for ppp objects (plant protection products) — print.ppp","text":"","code":"# S3 method for class 'ppp' print(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/print.ppp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Printing method for ppp objects (plant protection products) — print.ppp","text":"x chent object printed ... arguments compatibility S3 method","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-041","dir":"Changelog","previous_headings":"","what":"version 0.4.1","title":"version 0.4.1","text":"R/chent.R: Improve print method pai objects.","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-040","dir":"Changelog","previous_headings":"","what":"version 0.4.0","title":"version 0.4.0","text":"R/chent.R: PubChem changed names SMILES codes provide. former isomeric smiles incorporated chent objects “Pubchem_Isomeric” now simply calles SMILES, incorporated objects “PubChem”. SMILES code formerly given “canonical” now termed “connectivity SMILES” contain isotopic stereochemical specifications. chents object, now available name “PubChem_Connectivity”. breaking change, objects generated versions < 0.4.0 may produce errors used current versions.","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-037","dir":"Changelog","previous_headings":"","what":"version 0.3.7","title":"version 0.3.7","text":"R/chent.R: attempt load chyaml file per default, format file resulting chyaml list object documented need inferred use pfm package.","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-036","dir":"Changelog","previous_headings":"","what":"version 0.3.6","title":"version 0.3.6","text":"R/chent.R: Set fields smiles, inchikey mw NA fields still NULL end initialization, source attribute set “user”, assuming initialisation carefully done pubchem rdkit skipped structure well-defined. Please refer ChangeLog commit messages November 2021, changed GNUmakefile include commit messages file .","code":""}] +[{"path":"https://pkgdown.jrwb.de/chents/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Johannes Ranke. Author, maintainer, copyright holder.","code":""},{"path":"https://pkgdown.jrwb.de/chents/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Ranke J (2026). chents: Chemical Entities R Objects. R package version 0.4.1, https://pkgdown.jrwb.de/chents/.","code":"@Manual{, title = {chents: Chemical Entities as R Objects}, author = {Johannes Ranke}, year = {2026}, note = {R package version 0.4.1}, url = {https://pkgdown.jrwb.de/chents/}, }"},{"path":"https://pkgdown.jrwb.de/chents/index.html","id":"chents","dir":"","previous_headings":"","what":"Chemical Entities as R Objects","title":"Chemical Entities as R Objects","text":"working data chemical substances, often need reliable link data chemical identity substances. R package chents provides way define check identity chemically defined substances (“chemical entities”) collect related information. first defining chemical entity, chemical information retrieved PubChem website using webchem package. Python RDKit (> 2015.03) installed configured use reticulate package, additional chemical information including 2D graph computed. print method gives overview information collected. simple plotting method chemical structure. -called ISO common name pesticide active ingredient, can use ‘pai’ class derived ‘chent’ class, starts querying BCPC compendium first. Additional information can read local .yaml file. information can leveraged e.g. PEC_soil function ‘pfm’ package. However, functionality superseded dedicated package, defining data environmental risk assessment chemicals, particular active ingredients plant protection products.","code":"library(chents) caffeine <- chent$new(\"caffeine\") #> Querying PubChem for name caffeine ... #> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C print(caffeine) #> <chent> #> Identifier $identifier caffeine #> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" #> Molecular weight $mw: 194.2 #> PubChem synonyms (up to 10): #> [1] \"caffeine\" \"58-08-2\" #> [3] \"Guaranine\" \"1,3,7-Trimethylxanthine\" #> [5] \"Methyltheobromine\" \"Theine\" #> [7] \"Thein\" \"Cafeina\" #> [9] \"Caffein\" \"Cafipel\" plot(caffeine) lambda <- pai$new(\"lambda-cyhalothrin\") #> Querying BCPC for lambda-cyhalothrin ... #> Querying PubChem for name lambda-cyhalothrin ... #> Get chemical information from RDKit using PubChem SMILES #> CC1([C@@H]([C@@H]1C(=O)O[C@@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)/C=C(/C(F)(F)F)\\Cl)C #> Warning in self$get_rdkit(template = template): RDKit mw is 449.856 while mw is #> 449.8 plot(lambda)"},{"path":"https://pkgdown.jrwb.de/chents/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Chemical Entities as R Objects","text":"can conveniently install chents repository kindly made available R-Universe project: order profit chemoinformatics, need install RDKit python bindings. Debian type Linux distribution, just use use package Windows MacOS, happy include installation instructions share , e.g. via Pull Request.","code":"install.packages(\"chents\", repos = c(\"https://jranke.r-universe.dev\", \"https://cran.r-project.org\")) sudo apt install python3-rdkit"},{"path":"https://pkgdown.jrwb.de/chents/index.html","id":"configuration-of-the-python-version-to-use","dir":"","previous_headings":"","what":"Configuration of the Python version to use","title":"Chemical Entities as R Objects","text":"Debian type Linux distributions, can use following line global project specific .Rprofile file tell reticulate package use system Python version find RDKit installed system location.","code":"Sys.setenv(RETICULATE_PYTHON=\"/usr/bin/python3\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":null,"dir":"Reference","previous_headings":"","what":"An R6 class for chemical entities with associated data — chent","title":"An R6 class for chemical entities with associated data — chent","text":"class initialised identifier. Chemical information retrieved internet. Additionally, can generated using RDKit RDKit python bindings installed.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"An R6 class for chemical entities with associated data — chent","text":"R6::R6Class generator object","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"An R6 class for chemical entities with associated data — chent","text":"identifier (character(1)) identifier used initiate object, attribute 'source' inchikey (character(1)) InChI Key, attribute 'source' smiles (character()) SMILES code(s), attribute 'source' mw (numeric(1)) Molecular weight, attribute 'source' pubchem (list()) List information retrieved PubChem rdkit List information obtained RDKit mol <rdkit.Chem.rdchem.Mol> object svg SVG code Picture Graph grImport::Picture object obtained using grImport package Pict_font_size Font size extracted intermediate PostScript file pdf_height Height MediaBox pdf cropping p0 Vapour pressure Pa cwsat Water solubility mg/L PUF Plant uptake factor chyaml List information obtained YAML file TPs List transformation products chent objects transformations Data frame observed transformations soil_degradation Dataframe modelling DT50 values soil_ff Dataframe formation fractions soil_sorption Dataframe soil sorption data","code":""},{"path":[]},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"An R6 class for chemical entities with associated data — chent","text":"chent$new() chent$try_pubchem() chent$get_pubchem() chent$get_rdkit() chent$get_chyaml() chent$add_p0() chent$add_cwsat() chent$add_PUF() chent$add_TP() chent$add_transformation() chent$add_soil_degradation() chent$add_soil_ff() chent$add_soil_sorption() chent$pdf() chent$png() chent$emf() chent$clone()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"An R6 class for chemical entities with associated data — chent","text":"Creates new instance R6 class.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$new( identifier, smiles = NULL, inchikey = NULL, pubchem = TRUE, pubchem_from = c(\"name\", \"smiles\", \"inchikey\"), rdkit = TRUE, template = NULL, chyaml = FALSE )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"identifier Identifier stored object smiles Optional user provided SMILES code inchikey Optional user provided InChI Key pubchem attempt made retrieve chemical information PubChem via webchem package? pubchem_from Possibility select argument used query pubchem rdkit attempt made retrieve chemical information local rdkit installation via python reticulate package? template optional SMILES code used template RDKit chyaml look identifier.yaml file working directory?","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-try-pubchem-","dir":"Reference","previous_headings":"","what":"Method try_pubchem()","title":"An R6 class for chemical entities with associated data — chent","text":"Try get chemical information PubChem","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$try_pubchem(query = self$identifier, from = \"name\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"query Query string passed get_cid Passed get_cid","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-get-pubchem-","dir":"Reference","previous_headings":"","what":"Method get_pubchem()","title":"An R6 class for chemical entities with associated data — chent","text":"Get chemical information PubChem known PubChem CID","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$get_pubchem(pubchem_cid)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"pubchem_cid CID","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-get-rdkit-","dir":"Reference","previous_headings":"","what":"Method get_rdkit()","title":"An R6 class for chemical entities with associated data — chent","text":"Get chemical information RDKit available","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$get_rdkit(template = NULL)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"template optional SMILES code used template RDKit","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-get-chyaml-","dir":"Reference","previous_headings":"","what":"Method get_chyaml()","title":"An R6 class for chemical entities with associated data — chent","text":"Obtain information YAML file","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$get_chyaml( repo = c(\"wd\", \"local\", \"web\"), chyaml = paste0(URLencode(self$identifier), \".yaml\") )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"repo file looked current working directory, local git repository ~/git/chyaml, web (implemented). chyaml filename looked ","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-p-","dir":"Reference","previous_headings":"","what":"Method add_p0()","title":"An R6 class for chemical entities with associated data — chent","text":"Add vapour pressure","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_p0(p0, T = NA, source = NA, page = NA, remark = \"\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"p0 vapour pressure Pa T Temperature source acronym specifying source information page page information taken remark remark","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-cwsat-","dir":"Reference","previous_headings":"","what":"Method add_cwsat()","title":"An R6 class for chemical entities with associated data — chent","text":"Add water solubility","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_cwsat(cwsat, T = NA, pH = NA, source = NA, page = NA, remark = \"\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"cwsat water solubility mg/L T Temperature pH pH value source acronym specifying source information page page information taken remark remark","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-puf-","dir":"Reference","previous_headings":"","what":"Method add_PUF()","title":"An R6 class for chemical entities with associated data — chent","text":"Add plant uptake factor","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_PUF( PUF = 0, source = \"focus_generic_gw_2014\", page = 41, remark = \"Conservative default value\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"PUF plant uptake factor, number 0 1 source acronym specifying source information page page information taken remark remark","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-tp-","dir":"Reference","previous_headings":"","what":"Method add_TP()","title":"An R6 class for chemical entities with associated data — chent","text":"Add transformation product internal list","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_TP(x, smiles = NULL, pubchem = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"x chent object, identifier generate chent object smiles Optional user provided SMILES code pubchem chemical information obtained PubChem?","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-transformation-","dir":"Reference","previous_headings":"","what":"Method add_transformation()","title":"An R6 class for chemical entities with associated data — chent","text":"Add line internal dataframe holding observed transformations","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_transformation( study_type, TP_identifier, max_occurrence, remark = \"\", source = NA, pages = NA )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"study_type characterisation study type TP_identifier identifier one transformation products self$TPs max_occurrence maximum observed occurrence transformation product, expressed fraction amount result stochiometric transformation remark remark source acronym specifying source information pages pages information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-soil-degradation-","dir":"Reference","previous_headings":"","what":"Method add_soil_degradation()","title":"An R6 class for chemical entities with associated data — chent","text":"Add line internal dataframe holding modelling DT50 values","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_soil_degradation( soils, DT50_mod, DT50_mod_ref, type = NA, country = NA, pH_orig = NA, pH_medium = NA, pH_H2O = NA, perc_OC = NA, temperature = NA, moisture = NA, category = \"lab\", formulation = NA, model = NA, chi2 = NA, remark = \"\", source, page = NA )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"soils Names soils DT50_mod modelling DT50 sense regulatory pesticide fate modelling DT50_mod_ref normalised modelling DT50 sense regulatory pesticide fate modelling type soil type country country (mainly field studies) pH_orig pH stated study pH_medium medium pH measured pH_H2O pH extrapolated pure water perc_OC percentage organic carbon soil temperature temperature study degrees Celsius moisture moisture study category laboratory ('lab') field study ('field') formulation Name formulation applied, technical active ingredient model degradation model used deriving DT50_mod chi2 relative error defined FOCUS kinetics remark remark source acronym specifying source information page page information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-soil-ff-","dir":"Reference","previous_headings":"","what":"Method add_soil_ff()","title":"An R6 class for chemical entities with associated data — chent","text":"Add one formation fractions degradation soil","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_soil_ff(target, soils, ff = 1, remark = \"\", source, page = NA)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"target identifier(s) transformation product soils soil name(s) transformation observed ff formation fraction(s) remark remark source acronym specifying source information page page information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-add-soil-sorption-","dir":"Reference","previous_headings":"","what":"Method add_soil_sorption()","title":"An R6 class for chemical entities with associated data — chent","text":"Add soil sorption data","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$add_soil_sorption( soils, Kf, Kfoc, N, type = NA, pH_orig = NA, pH_medium = NA, pH_H2O = NA, perc_OC = NA, perc_clay = NA, CEC = NA, remark = \"\", source, page = NA )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-12","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"soils Names soils Kf sorption constant L/kg, either linear (N 1) according Freundlich Kfoc constant , normalised soil organic carbon N Freundlich exponent type soil type pH_orig pH stated study pH_medium medium pH measured pH_H2O pH extrapolated pure water perc_OC percentage organic carbon soil perc_clay percentage clay soil CEC cation exchange capacity remark remark source acronym specifying source information page page information taken","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-pdf-","dir":"Reference","previous_headings":"","what":"Method pdf()","title":"An R6 class for chemical entities with associated data — chent","text":"Write PDF image structure","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$pdf( file = paste0(self$identifier, \".pdf\"), dir = \"structures/pdf\", template = NULL )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-13","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"file file write dir directory write file template optional SMILES code used template RDKit","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-png-","dir":"Reference","previous_headings":"","what":"Method png()","title":"An R6 class for chemical entities with associated data — chent","text":"Write PNG image structure","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-14","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$png( file = paste0(self$identifier, \".png\"), dir = \"structures/png\", antialias = \"gray\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-14","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"file file write dir directory write file antialias Passed png","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-emf-","dir":"Reference","previous_headings":"","what":"Method emf()","title":"An R6 class for chemical entities with associated data — chent","text":"Write EMF image structure using emf","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-15","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$emf(file = paste0(self$identifier, \".emf\"), dir = \"structures/emf\")"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-15","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"file file write dir directory write file ","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"An R6 class for chemical entities with associated data — chent","text":"objects class cloneable method.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"usage-16","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"chent$clone(deep = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"arguments-16","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for chemical entities with associated data — chent","text":"deep Whether make deep clone.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/chent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"An R6 class for chemical entities with associated data — chent","text":"","code":"# Don't run examples per default, as PubChem may be unavailable # \\dontrun{ caffeine <- chent$new(\"caffeine\") #> Querying PubChem for name caffeine ... #> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C print(caffeine) #> <chent> #> Identifier $identifier caffeine #> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" #> Molecular weight $mw: 194.2 #> PubChem synonyms (up to 10): #> [1] \"caffeine\" \"58-08-2\" #> [3] \"Guaranine\" \"1,3,7-Trimethylxanthine\" #> [5] \"Methyltheobromine\" \"Theine\" #> [7] \"Thein\" \"Cafeina\" #> [9] \"Caffein\" \"Cafipel\" if (!is.null(caffeine$Picture)) { plot(caffeine) } oct <- chent$new(\"1-octanol\", smiles = \"CCCCCCCCO\", pubchem = FALSE) #> Get chemical information from RDKit using user SMILES #> CCCCCCCCO print(oct) #> <chent> #> Identifier $identifier 1-octanol #> InChI Key $inchikey NA #> SMILES string $smiles: #> user #> \"CCCCCCCCO\" #> Molecular weight $mw: 130.2 # }"},{"path":"https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","title":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","text":"Draw SVG graph chent object using RDKit","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","text":"","code":"draw_svg.chent( x, width = 300, height = 150, filename = paste0(names(x$identifier), \".svg\"), subdir = \"svg\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw SVG graph from a chent object using RDKit — draw_svg.chent","text":"x chent object plotted width desired width pixels height desired height pixels filename filename subdir path file written","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":null,"dir":"Reference","previous_headings":"","what":"An R6 class for pesticidal active ingredients and associated data — pai","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"class derived chent. makes easy create chent ISO common name pesticide active ingredient, additionally stores ISO name well complete result querying BCPC compendium using bcpc_query.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"R6::R6Class generator object","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"chents::chent -> pai","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"iso ISO common name active ingredient according ISO 1750 bcpc Information retrieved BCPC compendium available online <pesticidecompendium.bcpc.org>","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"chents::chent$add_PUF() chents::chent$add_TP() chents::chent$add_cwsat() chents::chent$add_p0() chents::chent$add_soil_degradation() chents::chent$add_soil_ff() chents::chent$add_soil_sorption() chents::chent$add_transformation() chents::chent$emf() chents::chent$get_chyaml() chents::chent$get_pubchem() chents::chent$get_rdkit() chents::chent$pdf() chents::chent$png() chents::chent$try_pubchem()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"pai$new() pai$clone()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"Create new pai object","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"","code":"pai$new( iso, identifier = iso, smiles = NULL, inchikey = NULL, bcpc = TRUE, pubchem = TRUE, pubchem_from = \"auto\", rdkit = TRUE, template = NULL, chyaml = FALSE )"},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"iso ISO common name used query BCPC compendium identifier Alternative identifier used querying pubchem smiles Optional user provided SMILES code inchikey Optional user provided InChI Key bcpc BCPC compendium queried? pubchem attempt made retrieve chemical information PubChem via webchem package? pubchem_from Possibility select argument used query pubchem rdkit attempt made retrieve chemical information local rdkit installation via python reticulate package? template optional SMILES code used template RDKit chyaml look identifier.yaml file working","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"objects class cloneable method.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"","code":"pai$clone(deep = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"deep Whether make deep clone.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/pai.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"An R6 class for pesticidal active ingredients and associated data — pai","text":"","code":"# Don't run examples per default, as PubChem may be unavailable # \\dontrun{ atr <- pai$new(\"atrazine\") #> Querying BCPC for atrazine ... #> Querying PubChem for inchikey MXWJVTOOROXGIU-UHFFFAOYSA-N ... #> Get chemical information from RDKit using PubChem SMILES #> CCNC1=NC(=NC(=N1)Cl)NC(C)C print(atr) #> <pai> with ISO common name $iso atrazine #> <chent> #> Identifier $identifier atrazine #> InChI Key $inchikey MXWJVTOOROXGIU-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CCNC1=NC(=NC(=N1)Cl)NC(C)C\" #> Molecular weight $mw: 215.7 #> PubChem synonyms (up to 10): #> [1] \"atrazine\" \"1912-24-9\" \"Gesaprim\" \"Aatrex\" \"Atranex\" #> [6] \"Atrazin\" \"Oleogesaprim\" \"Atazinax\" \"Atrasine\" \"Chromozin\" if (!is.null(atr$Picture)) { plot(atr) } # We can also define pais that are not found on the BCPC site decanol <- pai$new(\"1-Decanol\") #> Querying BCPC for 1-Decanol ... #> Common name 1-Decanol is not known at the BCPC compendium, trying PubChem #> Querying PubChem for name 1-Decanol ... #> Get chemical information from RDKit using PubChem SMILES #> CCCCCCCCCCO print(decanol) #> <pai> without ISO common name #> <chent> #> Identifier $identifier 1-Decanol #> InChI Key $inchikey MWKFXSUHUHTGQN-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CCCCCCCCCCO\" #> Molecular weight $mw: 158.3 #> PubChem synonyms (up to 10): #> [1] \"1-DECANOL\" \"Decan-1-ol\" \"Decyl alcohol\" \"112-30-1\" #> [5] \"n-Decyl alcohol\" \"n-Decanol\" \"Capric alcohol\" \"Nonylcarbinol\" #> [9] \"Antak\" \"Royaltac\" # }"},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot method for chent objects — plot.chent","title":"Plot method for chent objects — plot.chent","text":"Plot method chent objects","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot method for chent objects — plot.chent","text":"","code":"# S3 method for class 'chent' plot(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot method for chent objects — plot.chent","text":"x chent object plotted ... arguments passed grImport::grid.picture","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/plot.chent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot method for chent objects — plot.chent","text":"","code":"# Don't run examples per default, as PubChem may be unavailable # \\dontrun{ caffeine <- chent$new(\"caffeine\") #> Querying PubChem for name caffeine ... #> Get chemical information from RDKit using PubChem SMILES #> CN1C=NC2=C1C(=O)N(C(=O)N2C)C print(caffeine) #> <chent> #> Identifier $identifier caffeine #> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N #> SMILES string $smiles: #> PubChem #> \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" #> Molecular weight $mw: 194.2 #> PubChem synonyms (up to 10): #> [1] \"caffeine\" \"58-08-2\" #> [3] \"Guaranine\" \"1,3,7-Trimethylxanthine\" #> [5] \"Methyltheobromine\" \"Theine\" #> [7] \"Thein\" \"Cafeina\" #> [9] \"Caffein\" \"Cafipel\" if (!is.null(caffeine$Picture)) { plot(caffeine) } # }"},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 class for a plant protection product with at least one active ingredient — ppp","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"Contains basic information active ingredients product","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"R6::R6Class generator object.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"name name product ais list active ingredients concentrations concentration ais concentration_units Defaults g/L density density product density_units Defaults g/L","code":""},{"path":[]},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"ppp$new() ppp$clone()","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"Creates new instance R6 class.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"","code":"ppp$new( name, ..., concentrations, concentration_units = \"g/L\", density = 1000, density_units = \"g/L\" )"},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"name name product ... Identifiers active ingredients concentrations Concentrations active ingredients concentration_units Defaults g/L density density density_units Defaults g/L","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"objects class cloneable method.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"","code":"ppp$clone(deep = FALSE)"},{"path":"https://pkgdown.jrwb.de/chents/reference/ppp.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"R6 class for a plant protection product with at least one active ingredient — ppp","text":"deep Whether make deep clone.","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.chent.html","id":null,"dir":"Reference","previous_headings":"","what":"Printing method for chent objects — print.chent","title":"Printing method for chent objects — print.chent","text":"Printing method chent objects","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.chent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Printing method for chent objects — print.chent","text":"","code":"# S3 method for class 'chent' print(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/print.chent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Printing method for chent objects — print.chent","text":"x chent object printed ... arguments compatibility S3 method","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.pai.html","id":null,"dir":"Reference","previous_headings":"","what":"Printing method for pai objects (pesticidal active ingredients) — print.pai","title":"Printing method for pai objects (pesticidal active ingredients) — print.pai","text":"Printing method pai objects (pesticidal active ingredients)","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.pai.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Printing method for pai objects (pesticidal active ingredients) — print.pai","text":"","code":"# S3 method for class 'pai' print(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/print.pai.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Printing method for pai objects (pesticidal active ingredients) — print.pai","text":"x chent object printed ... arguments compatibility S3 method","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.ppp.html","id":null,"dir":"Reference","previous_headings":"","what":"Printing method for ppp objects (plant protection products) — print.ppp","title":"Printing method for ppp objects (plant protection products) — print.ppp","text":"Printing method ppp objects (plant protection products)","code":""},{"path":"https://pkgdown.jrwb.de/chents/reference/print.ppp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Printing method for ppp objects (plant protection products) — print.ppp","text":"","code":"# S3 method for class 'ppp' print(x, ...)"},{"path":"https://pkgdown.jrwb.de/chents/reference/print.ppp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Printing method for ppp objects (plant protection products) — print.ppp","text":"x chent object printed ... arguments compatibility S3 method","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-041","dir":"Changelog","previous_headings":"","what":"version 0.4.1","title":"version 0.4.1","text":"R/chent.R: Improve print method pai objects plot method chents: Pass dots argument grid.picture() documented.","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-040","dir":"Changelog","previous_headings":"","what":"version 0.4.0","title":"version 0.4.0","text":"R/chent.R: PubChem changed names SMILES codes provide. former isomeric smiles incorporated chent objects “Pubchem_Isomeric” now simply calles SMILES, incorporated objects “PubChem”. SMILES code formerly given “canonical” now termed “connectivity SMILES” contain isotopic stereochemical specifications. chents object, now available name “PubChem_Connectivity”. breaking change, objects generated versions < 0.4.0 may produce errors used current versions.","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-037","dir":"Changelog","previous_headings":"","what":"version 0.3.7","title":"version 0.3.7","text":"R/chent.R: attempt load chyaml file per default, format file resulting chyaml list object documented need inferred use pfm package.","code":""},{"path":"https://pkgdown.jrwb.de/chents/news/index.html","id":"version-036","dir":"Changelog","previous_headings":"","what":"version 0.3.6","title":"version 0.3.6","text":"R/chent.R: Set fields smiles, inchikey mw NA fields still NULL end initialization, source attribute set “user”, assuming initialisation carefully done pubchem rdkit skipped structure well-defined. Please refer ChangeLog commit messages November 2021, changed GNUmakefile include commit messages file .","code":""}] diff --git a/log/check.log b/log/check.log index bd0154d..7109c4e 100644 --- a/log/check.log +++ b/log/check.log @@ -1,5 +1,5 @@ * using log directory ‘/home/jranke/git/chents/chents.Rcheck’ -* using R version 4.5.2 (2025-10-31) +* using R version 4.5.3 (2026-03-11) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (Debian 14.2.0-19) 14.2.0 @@ -55,11 +55,7 @@ unable to verify current time * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK -* checking examples ... [3s/21s] NOTE -Examples with CPU (user + system) or elapsed time > 5s - user system elapsed -pai 0.353 0.073 8.080 -plot.chent 0.155 0.021 6.368 +* checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking PDF version of manual ... OK @@ -68,7 +64,7 @@ plot.chent 0.155 0.021 6.368 * checking for detritus in the temp directory ... OK * DONE -Status: 2 NOTEs +Status: 1 NOTE See ‘/home/jranke/git/chents/chents.Rcheck/00check.log’ for details. diff --git a/man/figures/README-unnamed-chunk-4-1.png b/man/figures/README-unnamed-chunk-4-1.png Binary files differindex 21caae7..47da250 100644 --- a/man/figures/README-unnamed-chunk-4-1.png +++ b/man/figures/README-unnamed-chunk-4-1.png diff --git a/man/figures/README-unnamed-chunk-5-1.png b/man/figures/README-unnamed-chunk-5-1.png Binary files differindex d54f3a0..f9f7cfc 100644 --- a/man/figures/README-unnamed-chunk-5-1.png +++ b/man/figures/README-unnamed-chunk-5-1.png |
