diff options
| -rw-r--r-- | docs/404.html | 2 | ||||
| -rw-r--r-- | docs/404.md | 3 | ||||
| -rw-r--r-- | docs/authors.html | 2 | ||||
| -rw-r--r-- | docs/authors.md | 21 | ||||
| -rw-r--r-- | docs/index.html | 2 | ||||
| -rw-r--r-- | docs/index.md | 111 | ||||
| -rw-r--r-- | docs/llms.txt | 133 | ||||
| -rw-r--r-- | docs/news/index.html | 2 | ||||
| -rw-r--r-- | docs/news/index.md | 37 | ||||
| -rw-r--r-- | docs/reference/chent.html | 11 | ||||
| -rw-r--r-- | docs/reference/chent.md | 802 | ||||
| -rw-r--r-- | docs/reference/draw_svg.chent.md | 37 | ||||
| -rw-r--r-- | docs/reference/index.html | 26 | ||||
| -rw-r--r-- | docs/reference/index.md | 20 | ||||
| -rw-r--r-- | docs/reference/pai.html | 7 | ||||
| -rw-r--r-- | docs/reference/pai.md | 187 | ||||
| -rw-r--r-- | docs/reference/plot.chent.html | 15 | ||||
| -rw-r--r-- | docs/reference/plot.chent.md | 51 | ||||
| -rw-r--r-- | docs/reference/ppp.md | 102 | ||||
| -rw-r--r-- | docs/reference/print.chent.md | 20 | ||||
| -rw-r--r-- | docs/reference/print.pai.md | 20 | ||||
| -rw-r--r-- | docs/reference/print.ppp.md | 20 | ||||
| -rw-r--r-- | docs/search.json | 2 |
23 files changed, 1606 insertions, 27 deletions
diff --git a/docs/404.html b/docs/404.html index 80410c2..22c2979 100644 --- a/docs/404.html +++ b/docs/404.html @@ -61,7 +61,7 @@ Content not found. Please use links in the navbar. </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> diff --git a/docs/404.md b/docs/404.md new file mode 100644 index 0000000..5107f89 --- /dev/null +++ b/docs/404.md @@ -0,0 +1,3 @@ +Content not found. Please use links in the navbar. + +# Page not found (404) diff --git a/docs/authors.html b/docs/authors.html index d892a2a..a11c70d 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -66,7 +66,7 @@ R package version 0.4.1, <a href="https://pkgdown.jrwb.de/chents">https://pkgdow </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/authors.md b/docs/authors.md new file mode 100644 index 0000000..e297afa --- /dev/null +++ b/docs/authors.md @@ -0,0 +1,21 @@ +# Authors and Citation + +## Authors + +- **Johannes Ranke**. Author, maintainer, copyright holder. + +## Citation + +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>. + + @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}, + } diff --git a/docs/index.html b/docs/index.html index d9d44ad..6623b75 100644 --- a/docs/index.html +++ b/docs/index.html @@ -148,7 +148,7 @@ </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> diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..199ad78 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,111 @@ +# chents + +[](https://pkgdown.jrwb.de/chents/) +[](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 first defining a chemical entity, some chemical information is +retrieved from the [PubChem](https://pubchem.ncbi.nlm.nih.gov/) website +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 +#> CN1C=NC2=C1C(=O)N(C(=O)N2C)C +``` + +If Python and [RDKit](https://rdkit.org) (\> 2015.03) are installed and +configured for use with the +[reticulate](https://rstudio.github.io/reticulate/) package, some +additional chemical information including a 2D graph are computed. + +The print method gives an overview of the information that was +collected. + +``` r +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" +``` + +There is a very simple plotting method for the chemical structure. + +``` r +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) +``` + + + +## Installation + +You can conveniently install chents from the repository kindly made +available by the R-Universe project: + +``` 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 + +``` R +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. + +## Configuration of the Python version to use + +On Debian type Linux distributions, you can use the following line in +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 +Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") +``` diff --git a/docs/llms.txt b/docs/llms.txt new file mode 100644 index 0000000..60135e4 --- /dev/null +++ b/docs/llms.txt @@ -0,0 +1,133 @@ +# chents + +[](https://pkgdown.jrwb.de/chents/) +[](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 first defining a chemical entity, some chemical information is +retrieved from the [PubChem](https://pubchem.ncbi.nlm.nih.gov/) website +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 +#> CN1C=NC2=C1C(=O)N(C(=O)N2C)C +``` + +If Python and [RDKit](https://rdkit.org) (\> 2015.03) are installed and +configured for use with the +[reticulate](https://rstudio.github.io/reticulate/) package, some +additional chemical information including a 2D graph are computed. + +The print method gives an overview of the information that was +collected. + +``` r +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" +``` + +There is a very simple plotting method for the chemical structure. + +``` r +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) +``` + + + +## Installation + +You can conveniently install chents from the repository kindly made +available by the R-Universe project: + +``` 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 + +``` R +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. + +## Configuration of the Python version to use + +On Debian type Linux distributions, you can use the following line in +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 +Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") +``` + +# Package index + +## R6 Class definitions and methods + +- [`chent`](https://pkgdown.jrwb.de/chents/reference/chent.md) : An R6 + class for chemical entities with associated data +- [`pai`](https://pkgdown.jrwb.de/chents/reference/pai.md) : An R6 class + for pesticidal active ingredients and associated data +- [`ppp`](https://pkgdown.jrwb.de/chents/reference/ppp.md) : R6 class + for a plant protection product with at least one active ingredient +- [`draw_svg.chent()`](https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.md) + : Draw SVG graph from a chent object using RDKit +- [`plot(`*`<chent>`*`)`](https://pkgdown.jrwb.de/chents/reference/plot.chent.md) + : Plot method for chent objects +- [`print(`*`<chent>`*`)`](https://pkgdown.jrwb.de/chents/reference/print.chent.md) + : Printing method for chent objects +- [`print(`*`<pai>`*`)`](https://pkgdown.jrwb.de/chents/reference/print.pai.md) + : Printing method for pai objects (pesticidal active ingredients) +- [`print(`*`<ppp>`*`)`](https://pkgdown.jrwb.de/chents/reference/print.ppp.md) + : Printing method for ppp objects (plant protection products) + diff --git a/docs/news/index.html b/docs/news/index.html index fd27893..1020efc 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -58,7 +58,7 @@ </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/news/index.md b/docs/news/index.md new file mode 100644 index 0000000..32ad5c9 --- /dev/null +++ b/docs/news/index.md @@ -0,0 +1,37 @@ +# Changelog + +## version 0.4.1 + +- R/chent.R: Improve print method for `pai` objects. + +## version 0.4.0 + +- R/chent.R: PubChem has changed the names of the SMILES codes they + provide. The former isomeric smiles that was incorporated in our chent + objects as “Pubchem_Isomeric” is now simply calles SMILES, and is + incorporated in our objects as “PubChem”. The SMILES code formerly + given as “canonical” is now termed “connectivity SMILES” because it + does not contain isotopic or stereochemical specifications. In the + chents object, it is now available under the name + “PubChem_Connectivity”. This is a breaking change, so objects + generated with versions \< 0.4.0 may produce errors when used with + current versions. + +## version 0.3.7 + +- R/chent.R: Do not attempt to load a chyaml file per default, as the + format of such a file and the resulting chyaml list object is not + documented and would need to be inferred from its use in the pfm + package. + +## version 0.3.6 + +- R/chent.R: Set the fields `smiles`, `inchikey` and `mw` to NA if these + fields are still NULL at the end of the initialization, with `source` + attribute set to “user”, assuming that the initialisation was + carefully done and `pubchem` and `rdkit` were skipped because the + structure is not well-defined. + +Please refer to the ChangeLog for commit messages up to November 2021, +where I changed the GNUmakefile not to include commit messages in that +file any more. diff --git a/docs/reference/chent.html b/docs/reference/chent.html index 131d548..e2f241d 100644 --- a/docs/reference/chent.html +++ b/docs/reference/chent.html @@ -11,7 +11,7 @@ generated using RDKit if RDKit and its python bindings are installed."></head><b <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"> @@ -790,7 +790,9 @@ or according to Freundlich</p></dd> <div class="section level2"> <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">caffeine</span> <span class="op"><-</span> <span class="va">chent</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> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># Don't run examples per default, as PubChem may be unavailable</span></span></span> +<span class="r-in"><span><span class="co"># \dontrun{</span></span></span> +<span class="r-in"><span><span class="va">caffeine</span> <span class="op"><-</span> <span class="va">chent</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="r-msg co"><span class="r-pr">#></span> Querying PubChem for name caffeine ...</span> <span class="r-msg co"><span class="r-pr">#></span> Get chemical information from RDKit using PubChem SMILES</span> <span class="r-msg co"><span class="r-pr">#></span> CN1C=NC2=C1C(=O)N(C(=O)N2C)C</span> @@ -807,7 +809,7 @@ or according to Freundlich</p></dd> <span class="r-out co"><span class="r-pr">#></span> [3] "Guaranine" "1,3,7-Trimethylxanthine"</span> <span class="r-out co"><span class="r-pr">#></span> [5] "Methyltheobromine" "Theine" </span> <span class="r-out co"><span class="r-pr">#></span> [7] "Thein" "Cafeina" </span> -<span class="r-out co"><span class="r-pr">#></span> [9] "Koffein" "Mateina" </span> +<span class="r-out co"><span class="r-pr">#></span> [9] "Caffein" "Cafipel" </span> <span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="fu"><a href="https://rdrr.io/r/base/NULL.html" class="external-link">is.null</a></span><span class="op">(</span><span class="va">caffeine</span><span class="op">$</span><span class="va">Picture</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span> <span class="r-in"><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></span> <span class="r-in"><span><span class="op">}</span></span></span> @@ -823,6 +825,7 @@ or according to Freundlich</p></dd> <span class="r-out co"><span class="r-pr">#></span> user </span> <span class="r-out co"><span class="r-pr">#></span> "CCCCCCCCO" </span> <span class="r-out co"><span class="r-pr">#></span> Molecular weight $mw: 130.2 </span> +<span class="r-in"><span><span class="co"># }</span></span></span> </code></pre></div> </div> </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> @@ -834,7 +837,7 @@ or according to Freundlich</p></dd> </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/reference/chent.md b/docs/reference/chent.md new file mode 100644 index 0000000..40716ce --- /dev/null +++ b/docs/reference/chent.md @@ -0,0 +1,802 @@ +# An R6 class for chemical entities with associated data + +The class is initialised with an identifier. Chemical information is +retrieved from the internet. Additionally, it can be generated using +RDKit if RDKit and its python bindings are installed. + +## Format + +An [R6::R6Class](https://r6.r-lib.org/reference/R6Class.html) generator +object + +## Public fields + +- `identifier`: + + (`character(1)`) + The identifier that was used to initiate the object, with attribute + 'source' + +- `inchikey`: + + (`character(1)`) + InChI Key, with attribute 'source' + +- `smiles`: + + ([`character()`](https://rdrr.io/r/base/character.html)) + SMILES code(s), with attribute 'source' + +- `mw`: + + (`numeric(1)`) + Molecular weight, with attribute 'source' + +- `pubchem`: + + ([`list()`](https://rdrr.io/r/base/list.html)) + List of information retrieved from PubChem + +- `rdkit`: + + List of information obtained with RDKit + +- `mol`: + + \<rdkit.Chem.rdchem.Mol\> object + +- `svg`: + + SVG code + +- `Picture`: + + Graph as a + [grImport::Picture](https://rdrr.io/pkg/grImport/man/Picture-class.html) + object obtained using the grImport package + +- `Pict_font_size`: + + Font size as extracted from the intermediate PostScript file + +- `pdf_height`: + + Height of the MediaBox in the pdf after cropping + +- `p0`: + + Vapour pressure in Pa + +- `cwsat`: + + Water solubility in mg/L + +- `PUF`: + + Plant uptake factor + +- `chyaml`: + + List of information obtained from a YAML file + +- `TPs`: + + List of transformation products as chent objects + +- `transformations`: + + Data frame of observed transformations + +- `soil_degradation`: + + Dataframe of modelling DT50 values + +- `soil_ff`: + + Dataframe of formation fractions + +- `soil_sorption`: + + Dataframe of soil sorption data + +## Methods + +### Public methods + +- [`chent$new()`](#method-chent-new) + +- [`chent$try_pubchem()`](#method-chent-try_pubchem) + +- [`chent$get_pubchem()`](#method-chent-get_pubchem) + +- [`chent$get_rdkit()`](#method-chent-get_rdkit) + +- [`chent$get_chyaml()`](#method-chent-get_chyaml) + +- [`chent$add_p0()`](#method-chent-add_p0) + +- [`chent$add_cwsat()`](#method-chent-add_cwsat) + +- [`chent$add_PUF()`](#method-chent-add_PUF) + +- [`chent$add_TP()`](#method-chent-add_TP) + +- [`chent$add_transformation()`](#method-chent-add_transformation) + +- [`chent$add_soil_degradation()`](#method-chent-add_soil_degradation) + +- [`chent$add_soil_ff()`](#method-chent-add_soil_ff) + +- [`chent$add_soil_sorption()`](#method-chent-add_soil_sorption) + +- [`chent$pdf()`](#method-chent-pdf) + +- [`chent$png()`](#method-chent-png) + +- [`chent$emf()`](#method-chent-emf) + +- [`chent$clone()`](#method-chent-clone) + +------------------------------------------------------------------------ + +### Method `new()` + +Creates a new instance of this +[R6](https://r6.r-lib.org/reference/R6Class.html) class. + +#### Usage + + chent$new( + identifier, + smiles = NULL, + inchikey = NULL, + pubchem = TRUE, + pubchem_from = c("name", "smiles", "inchikey"), + rdkit = TRUE, + template = NULL, + chyaml = FALSE + ) + +#### Arguments + +- `identifier`: + + Identifier to be stored in the object + +- `smiles`: + + Optional user provided SMILES code + +- `inchikey`: + + Optional user provided InChI Key + +- `pubchem`: + + Should an attempt be made to retrieve chemical information from + PubChem via the webchem package? + +- `pubchem_from`: + + Possibility to select the argument that is used to query pubchem + +- `rdkit`: + + Should an attempt be made to retrieve chemical information from a + local rdkit installation via python and the reticulate package? + +- `template`: + + An optional SMILES code to be used as template for RDKit + +- `chyaml`: + + Should we look for a identifier.yaml file in the working directory? + +------------------------------------------------------------------------ + +### Method `try_pubchem()` + +Try to get chemical information from PubChem + +#### Usage + + chent$try_pubchem(query = self$identifier, from = "name") + +#### Arguments + +- `query`: + + Query string to be passed to + [get_cid](https://docs.ropensci.org/webchem/reference/get_cid.html) + +- `from`: + + Passed to + [get_cid](https://docs.ropensci.org/webchem/reference/get_cid.html) + +------------------------------------------------------------------------ + +### Method `get_pubchem()` + +Get chemical information from PubChem for a known PubChem CID + +#### Usage + + chent$get_pubchem(pubchem_cid) + +#### Arguments + +- `pubchem_cid`: + + CID + +------------------------------------------------------------------------ + +### Method `get_rdkit()` + +Get chemical information from RDKit if available + +#### Usage + + chent$get_rdkit(template = NULL) + +#### Arguments + +- `template`: + + An optional SMILES code to be used as template for RDKit + +------------------------------------------------------------------------ + +### Method `get_chyaml()` + +Obtain information from a YAML file + +#### Usage + + chent$get_chyaml( + repo = c("wd", "local", "web"), + chyaml = paste0(URLencode(self$identifier), ".yaml") + ) + +#### Arguments + +- `repo`: + + Should the file be looked for in the current working directory, a + local git repository under `~/git/chyaml`, or from the web (not + implemented). + +- `chyaml`: + + The filename to be looked for + +------------------------------------------------------------------------ + +### Method `add_p0()` + +Add a vapour pressure + +#### Usage + + chent$add_p0(p0, T = NA, source = NA, page = NA, remark = "") + +#### Arguments + +- `p0`: + + The vapour pressure in Pa + +- `T`: + + Temperature + +- `source`: + + An acronym specifying the source of the information + +- `page`: + + The page from which the information was taken + +- `remark`: + + A remark + +------------------------------------------------------------------------ + +### Method `add_cwsat()` + +Add a water solubility + +#### Usage + + chent$add_cwsat(cwsat, T = NA, pH = NA, source = NA, page = NA, remark = "") + +#### Arguments + +- `cwsat`: + + The water solubility in mg/L + +- `T`: + + Temperature + +- `pH`: + + pH value + +- `source`: + + An acronym specifying the source of the information + +- `page`: + + The page from which the information was taken + +- `remark`: + + A remark + +------------------------------------------------------------------------ + +### Method `add_PUF()` + +Add a plant uptake factor + +#### Usage + + chent$add_PUF( + PUF = 0, + source = "focus_generic_gw_2014", + page = 41, + remark = "Conservative default value" + ) + +#### Arguments + +- `PUF`: + + The plant uptake factor, a number between 0 and 1 + +- `source`: + + An acronym specifying the source of the information + +- `page`: + + The page from which the information was taken + +- `remark`: + + A remark + +------------------------------------------------------------------------ + +### Method `add_TP()` + +Add a transformation product to the internal list + +#### Usage + + chent$add_TP(x, smiles = NULL, pubchem = FALSE) + +#### Arguments + +- `x`: + + A chent object, or an identifier to generate a chent object + +- `smiles`: + + Optional user provided SMILES code + +- `pubchem`: + + Should chemical information be obtained from PubChem? + +------------------------------------------------------------------------ + +### Method `add_transformation()` + +Add a line in the internal dataframe holding observed transformations + +#### Usage + + chent$add_transformation( + study_type, + TP_identifier, + max_occurrence, + remark = "", + source = NA, + pages = NA + ) + +#### Arguments + +- `study_type`: + + A characterisation of the study type + +- `TP_identifier`: + + An identifier of one of the transformation products in `self$TPs` + +- `max_occurrence`: + + The maximum observed occurrence of the transformation product, + expressed as a fraction of the amount that would result from + stochiometric transformation + +- `remark`: + + A remark + +- `source`: + + An acronym specifying the source of the information + +- `pages`: + + The pages from which the information was taken + +------------------------------------------------------------------------ + +### Method `add_soil_degradation()` + +Add a line in the internal dataframe holding modelling DT50 values + +#### Usage + + 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 + ) + +#### Arguments + +- `soils`: + + Names of the soils + +- `DT50_mod`: + + The modelling DT50 in the sense of regulatory pesticide fate modelling + +- `DT50_mod_ref`: + + The normalised modelling DT50 in the sense of regulatory pesticide + fate modelling + +- `type`: + + The soil type + +- `country`: + + The country (mainly for field studies) + +- `pH_orig`: + + The pH stated in the study + +- `pH_medium`: + + The medium in which this pH was measured + +- `pH_H2O`: + + The pH extrapolated to pure water + +- `perc_OC`: + + The percentage of organic carbon in the soil + +- `temperature`: + + The temperature during the study in degrees Celsius + +- `moisture`: + + The moisture during the study + +- `category`: + + Is it a laboratory ('lab') or field study ('field') + +- `formulation`: + + Name of the formulation applied, if it was not the technical active + ingredient + +- `model`: + + The degradation model used for deriving `DT50_mod` + +- `chi2`: + + The relative error as defined in FOCUS kinetics + +- `remark`: + + A remark + +- `source`: + + An acronym specifying the source of the information + +- `page`: + + The page from which the information was taken + +------------------------------------------------------------------------ + +### Method `add_soil_ff()` + +Add one or more formation fractions for degradation in soil + +#### Usage + + chent$add_soil_ff(target, soils, ff = 1, remark = "", source, page = NA) + +#### Arguments + +- `target`: + + The identifier(s) of the transformation product + +- `soils`: + + The soil name(s) in which the transformation was observed + +- `ff`: + + The formation fraction(s) + +- `remark`: + + A remark + +- `source`: + + An acronym specifying the source of the information + +- `page`: + + The page from which the information was taken + +------------------------------------------------------------------------ + +### Method `add_soil_sorption()` + +Add soil sorption data + +#### Usage + + 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 + ) + +#### Arguments + +- `soils`: + + Names of the soils + +- `Kf`: + + The sorption constant in L/kg, either linear (then `N` is 1) or + according to Freundlich + +- `Kfoc`: + + The constant from above, normalised to soil organic carbon + +- `N`: + + The Freundlich exponent + +- `type`: + + The soil type + +- `pH_orig`: + + The pH stated in the study + +- `pH_medium`: + + The medium in which this pH was measured + +- `pH_H2O`: + + The pH extrapolated to pure water + +- `perc_OC`: + + The percentage of organic carbon in the soil + +- `perc_clay`: + + The percentage of clay in the soil + +- `CEC`: + + The cation exchange capacity + +- `remark`: + + A remark + +- `source`: + + An acronym specifying the source of the information + +- `page`: + + The page from which the information was taken + +------------------------------------------------------------------------ + +### Method [`pdf()`](https://rdrr.io/r/grDevices/pdf.html) + +Write a PDF image of the structure + +#### Usage + + chent$pdf( + file = paste0(self$identifier, ".pdf"), + dir = "structures/pdf", + template = NULL + ) + +#### Arguments + +- `file`: + + The file to write to + +- `dir`: + + The directory to write the file to + +- `template`: + + An optional SMILES code to be used as template for RDKit + +------------------------------------------------------------------------ + +### Method [`png()`](https://rdrr.io/r/grDevices/png.html) + +Write a PNG image of the structure + +#### Usage + + chent$png( + file = paste0(self$identifier, ".png"), + dir = "structures/png", + antialias = "gray" + ) + +#### Arguments + +- `file`: + + The file to write to + +- `dir`: + + The directory to write the file to + +- `antialias`: + + Passed to [png](https://rdrr.io/r/grDevices/png.html) + +------------------------------------------------------------------------ + +### Method `emf()` + +Write an EMF image of the structure using +[emf](https://rdrr.io/pkg/devEMF/man/emf.html) + +#### Usage + + chent$emf(file = paste0(self$identifier, ".emf"), dir = "structures/emf") + +#### Arguments + +- `file`: + + The file to write to + +- `dir`: + + The directory to write the file to + +------------------------------------------------------------------------ + +### Method `clone()` + +The objects of this class are cloneable with this method. + +#### Usage + + chent$clone(deep = FALSE) + +#### Arguments + +- `deep`: + + Whether to make a deep clone. + +## Examples + +``` r +# 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 +# } +``` diff --git a/docs/reference/draw_svg.chent.md b/docs/reference/draw_svg.chent.md new file mode 100644 index 0000000..7b43988 --- /dev/null +++ b/docs/reference/draw_svg.chent.md @@ -0,0 +1,37 @@ +# Draw SVG graph from a chent object using RDKit + +Draw SVG graph from a chent object using RDKit + +## Usage + +``` r +draw_svg.chent( + x, + width = 300, + height = 150, + filename = paste0(names(x$identifier), ".svg"), + subdir = "svg" +) +``` + +## Arguments + +- x: + + The chent object to be plotted + +- width: + + The desired width in pixels + +- height: + + The desired height in pixels + +- filename: + + The filename + +- subdir: + + The path to which the file should be written diff --git a/docs/reference/index.html b/docs/reference/index.html index a8a9c05..52b7cfb 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -36,8 +36,7 @@ - - </div><div class="section level2"> + <dl></dl></div><div class="section level2"> @@ -48,43 +47,50 @@ </dt> <dd>An R6 class for chemical entities with associated data</dd> - </dl><dl><dt> + + <dt> <code><a href="pai.html">pai</a></code> </dt> <dd>An R6 class for pesticidal active ingredients and associated data</dd> - </dl><dl><dt> + + <dt> <code><a href="ppp.html">ppp</a></code> </dt> <dd>R6 class for a plant protection product with at least one active ingredient</dd> - </dl><dl><dt> + + <dt> <code><a href="draw_svg.chent.html">draw_svg.chent()</a></code> </dt> <dd>Draw SVG graph from a chent object using RDKit</dd> - </dl><dl><dt> + + <dt> <code><a href="plot.chent.html">plot(<i><chent></i>)</a></code> </dt> <dd>Plot method for chent objects</dd> - </dl><dl><dt> + + <dt> <code><a href="print.chent.html">print(<i><chent></i>)</a></code> </dt> <dd>Printing method for chent objects</dd> - </dl><dl><dt> + + <dt> <code><a href="print.pai.html">print(<i><pai></i>)</a></code> </dt> <dd>Printing method for pai objects (pesticidal active ingredients)</dd> - </dl><dl><dt> + + <dt> <code><a href="print.ppp.html">print(<i><ppp></i>)</a></code> @@ -99,7 +105,7 @@ </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/reference/index.md b/docs/reference/index.md new file mode 100644 index 0000000..c927189 --- /dev/null +++ b/docs/reference/index.md @@ -0,0 +1,20 @@ +# Package index + +## R6 Class definitions and methods + +- [`chent`](https://pkgdown.jrwb.de/chents/reference/chent.md) : An R6 + class for chemical entities with associated data +- [`pai`](https://pkgdown.jrwb.de/chents/reference/pai.md) : An R6 class + for pesticidal active ingredients and associated data +- [`ppp`](https://pkgdown.jrwb.de/chents/reference/ppp.md) : R6 class + for a plant protection product with at least one active ingredient +- [`draw_svg.chent()`](https://pkgdown.jrwb.de/chents/reference/draw_svg.chent.md) + : Draw SVG graph from a chent object using RDKit +- [`plot(`*`<chent>`*`)`](https://pkgdown.jrwb.de/chents/reference/plot.chent.md) + : Plot method for chent objects +- [`print(`*`<chent>`*`)`](https://pkgdown.jrwb.de/chents/reference/print.chent.md) + : Printing method for chent objects +- [`print(`*`<pai>`*`)`](https://pkgdown.jrwb.de/chents/reference/print.pai.md) + : Printing method for pai objects (pesticidal active ingredients) +- [`print(`*`<ppp>`*`)`](https://pkgdown.jrwb.de/chents/reference/print.ppp.md) + : Printing method for ppp objects (plant protection products) diff --git a/docs/reference/pai.html b/docs/reference/pai.html index 25ca564..29f9368 100644 --- a/docs/reference/pai.html +++ b/docs/reference/pai.html @@ -184,7 +184,9 @@ and the reticulate package?</p></dd> <div class="section level2"> <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">atr</span> <span class="op"><-</span> <span class="va">pai</span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="st">"atrazine"</span><span class="op">)</span></span></span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># Don't run examples per default, as PubChem may be unavailable</span></span></span> +<span class="r-in"><span><span class="co"># \dontrun{</span></span></span> +<span class="r-in"><span><span class="va">atr</span> <span class="op"><-</span> <span class="va">pai</span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="st">"atrazine"</span><span class="op">)</span></span></span> <span class="r-msg co"><span class="r-pr">#></span> Querying BCPC for atrazine ...</span> <span class="r-msg co"><span class="r-pr">#></span> Querying PubChem for inchikey MXWJVTOOROXGIU-UHFFFAOYSA-N ...</span> <span class="r-msg co"><span class="r-pr">#></span> Get chemical information from RDKit using PubChem SMILES</span> @@ -225,6 +227,7 @@ and the reticulate package?</p></dd> <span class="r-out co"><span class="r-pr">#></span> [1] "1-DECANOL" "Decan-1-ol" "Decyl alcohol" "112-30-1" </span> <span class="r-out co"><span class="r-pr">#></span> [5] "n-Decyl alcohol" "n-Decanol" "Capric alcohol" "Nonylcarbinol" </span> <span class="r-out co"><span class="r-pr">#></span> [9] "Antak" "Royaltac" </span> +<span class="r-in"><span><span class="co"># }</span></span></span> </code></pre></div> </div> </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> @@ -236,7 +239,7 @@ and the reticulate package?</p></dd> </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/reference/pai.md b/docs/reference/pai.md new file mode 100644 index 0000000..2291653 --- /dev/null +++ b/docs/reference/pai.md @@ -0,0 +1,187 @@ +# An R6 class for pesticidal active ingredients and associated data + +This class is derived from +[chent](https://pkgdown.jrwb.de/chents/reference/chent.md). It makes it +easy to create a +[chent](https://pkgdown.jrwb.de/chents/reference/chent.md) from the ISO +common name of a pesticide active ingredient, and additionally stores +the ISO name as well as the complete result of querying the BCPC +compendium using +[bcpc_query](https://docs.ropensci.org/webchem/reference/bcpc_query.html). + +## Format + +An [R6::R6Class](https://r6.r-lib.org/reference/R6Class.html) generator +object + +## Super class + +[`chents::chent`](https://pkgdown.jrwb.de/chents/reference/chent.md) -\> +`pai` + +## Public fields + +- `iso`: + + ISO common name of the active ingredient according to ISO 1750 + +- `bcpc`: + + Information retrieved from the BCPC compendium available online at + \<pesticidecompendium.bcpc.org\> + +## Methods + +### Public methods + +- [`pai$new()`](#method-pai-new) + +- [`pai$clone()`](#method-pai-clone) + +Inherited methods + +- [`chents::chent$add_PUF()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_PUF) +- [`chents::chent$add_TP()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_TP) +- [`chents::chent$add_cwsat()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_cwsat) +- [`chents::chent$add_p0()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_p0) +- [`chents::chent$add_soil_degradation()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_soil_degradation) +- [`chents::chent$add_soil_ff()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_soil_ff) +- [`chents::chent$add_soil_sorption()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_soil_sorption) +- [`chents::chent$add_transformation()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-add_transformation) +- [`chents::chent$emf()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-emf) +- [`chents::chent$get_chyaml()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-get_chyaml) +- [`chents::chent$get_pubchem()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-get_pubchem) +- [`chents::chent$get_rdkit()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-get_rdkit) +- [`chents::chent$pdf()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-pdf) +- [`chents::chent$png()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-png) +- [`chents::chent$try_pubchem()`](https://pkgdown.jrwb.de/chents/reference/chent.html#method-try_pubchem) + +------------------------------------------------------------------------ + +### Method `new()` + +Create a new pai object + +#### Usage + + pai$new( + iso, + identifier = iso, + smiles = NULL, + inchikey = NULL, + bcpc = TRUE, + pubchem = TRUE, + pubchem_from = "auto", + rdkit = TRUE, + template = NULL, + chyaml = FALSE + ) + +#### Arguments + +- `iso`: + + The ISO common name to be used in the query of the BCPC compendium + +- `identifier`: + + Alternative identifier used for querying pubchem + +- `smiles`: + + Optional user provided SMILES code + +- `inchikey`: + + Optional user provided InChI Key + +- `bcpc`: + + Should the BCPC compendium be queried? + +- `pubchem`: + + Should an attempt be made to retrieve chemical information from + PubChem via the webchem package? + +- `pubchem_from`: + + Possibility to select the argument that is used to query pubchem + +- `rdkit`: + + Should an attempt be made to retrieve chemical information from a + local rdkit installation via python and the reticulate package? + +- `template`: + + An optional SMILES code to be used as template for RDKit + +- `chyaml`: + + Should we look for a identifier.yaml file in the working + +------------------------------------------------------------------------ + +### Method `clone()` + +The objects of this class are cloneable with this method. + +#### Usage + + pai$clone(deep = FALSE) + +#### Arguments + +- `deep`: + + Whether to make a deep clone. + +## Examples + +``` r +# 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" +# } +``` diff --git a/docs/reference/plot.chent.html b/docs/reference/plot.chent.html index 49f54b2..c33b732 100644 --- a/docs/reference/plot.chent.html +++ b/docs/reference/plot.chent.html @@ -7,7 +7,7 @@ <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"> @@ -58,9 +58,11 @@ <div class="section level2"> <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">caffeine</span> <span class="op"><-</span> <span class="va"><a href="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="r-msg co"><span class="r-pr">#></span> PubChem:</span> -<span class="r-msg co"><span class="r-pr">#></span> Trying to get chemical information from RDKit using PubChem SMILES</span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># Don't run examples per default, as PubChem may be unavailable</span></span></span> +<span class="r-in"><span><span class="co"># \dontrun{</span></span></span> +<span class="r-in"><span><span class="va">caffeine</span> <span class="op"><-</span> <span class="va"><a href="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="r-msg co"><span class="r-pr">#></span> Querying PubChem for name caffeine ...</span> +<span class="r-msg co"><span class="r-pr">#></span> Get chemical information from RDKit using PubChem SMILES</span> <span class="r-msg co"><span class="r-pr">#></span> CN1C=NC2=C1C(=O)N(C(=O)N2C)C</span> <span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">caffeine</span><span class="op">)</span></span></span> <span class="r-out co"><span class="r-pr">#></span> <chent></span> @@ -75,11 +77,12 @@ <span class="r-out co"><span class="r-pr">#></span> [3] "Guaranine" "1,3,7-Trimethylxanthine"</span> <span class="r-out co"><span class="r-pr">#></span> [5] "Methyltheobromine" "Theine" </span> <span class="r-out co"><span class="r-pr">#></span> [7] "Thein" "Cafeina" </span> -<span class="r-out co"><span class="r-pr">#></span> [9] "Koffein" "Mateina" </span> +<span class="r-out co"><span class="r-pr">#></span> [9] "Caffein" "Cafipel" </span> <span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="fu"><a href="https://rdrr.io/r/base/NULL.html" class="external-link">is.null</a></span><span class="op">(</span><span class="va">caffeine</span><span class="op">$</span><span class="va">Picture</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span> <span class="r-in"><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></span> <span class="r-in"><span><span class="op">}</span></span></span> <span class="r-plt img"><img src="plot.chent-1.png" alt="" width="700" height="433"></span> +<span class="r-in"><span><span class="co"># }</span></span></span> </code></pre></div> </div> </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> @@ -91,7 +94,7 @@ </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/reference/plot.chent.md b/docs/reference/plot.chent.md new file mode 100644 index 0000000..eaa6817 --- /dev/null +++ b/docs/reference/plot.chent.md @@ -0,0 +1,51 @@ +# Plot method for chent objects + +Plot method for chent objects + +## Usage + +``` r +# S3 method for class 'chent' +plot(x, ...) +``` + +## Arguments + +- x: + + The chent object to be plotted + +- ...: + + Further arguments passed to + [grImport::grid.picture](https://rdrr.io/pkg/grImport/man/grid.picture.html) + +## Examples + +``` r +# 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) +} + +# } +``` diff --git a/docs/reference/ppp.md b/docs/reference/ppp.md new file mode 100644 index 0000000..77ff2b6 --- /dev/null +++ b/docs/reference/ppp.md @@ -0,0 +1,102 @@ +# R6 class for a plant protection product with at least one active ingredient + +Contains basic information about the active ingredients in the product + +## Format + +An [R6::R6Class](https://r6.r-lib.org/reference/R6Class.html) generator +object. + +## Public fields + +- `name`: + + The name of the product + +- `ais`: + + A list of active ingredients + +- `concentrations`: + + The concentration of the ais + +- `concentration_units`: + + Defaults to g/L + +- `density`: + + The density of the product + +- `density_units`: + + Defaults to g/L + +## Methods + +### Public methods + +- [`ppp$new()`](#method-ppp-new) + +- [`ppp$clone()`](#method-ppp-clone) + +------------------------------------------------------------------------ + +### Method `new()` + +Creates a new instance of this +[R6](https://r6.r-lib.org/reference/R6Class.html) class. + +#### Usage + + ppp$new( + name, + ..., + concentrations, + concentration_units = "g/L", + density = 1000, + density_units = "g/L" + ) + +#### Arguments + +- `name`: + + The name of the product + +- `...`: + + Identifiers of the active ingredients + +- `concentrations`: + + Concentrations of the active ingredients + +- `concentration_units`: + + Defaults to g/L + +- `density`: + + The density + +- `density_units`: + + Defaults to g/L + +------------------------------------------------------------------------ + +### Method `clone()` + +The objects of this class are cloneable with this method. + +#### Usage + + ppp$clone(deep = FALSE) + +#### Arguments + +- `deep`: + + Whether to make a deep clone. diff --git a/docs/reference/print.chent.md b/docs/reference/print.chent.md new file mode 100644 index 0000000..f4d84bf --- /dev/null +++ b/docs/reference/print.chent.md @@ -0,0 +1,20 @@ +# Printing method for chent objects + +Printing method for chent objects + +## Usage + +``` r +# S3 method for class 'chent' +print(x, ...) +``` + +## Arguments + +- x: + + The chent object to be printed + +- ...: + + Further arguments for compatibility with the S3 method diff --git a/docs/reference/print.pai.md b/docs/reference/print.pai.md new file mode 100644 index 0000000..86cad4b --- /dev/null +++ b/docs/reference/print.pai.md @@ -0,0 +1,20 @@ +# Printing method for pai objects (pesticidal active ingredients) + +Printing method for pai objects (pesticidal active ingredients) + +## Usage + +``` r +# S3 method for class 'pai' +print(x, ...) +``` + +## Arguments + +- x: + + The chent object to be printed + +- ...: + + Further arguments for compatibility with the S3 method diff --git a/docs/reference/print.ppp.md b/docs/reference/print.ppp.md new file mode 100644 index 0000000..8387a54 --- /dev/null +++ b/docs/reference/print.ppp.md @@ -0,0 +1,20 @@ +# Printing method for ppp objects (plant protection products) + +Printing method for ppp objects (plant protection products) + +## Usage + +``` r +# S3 method for class 'ppp' +print(x, ...) +``` + +## Arguments + +- x: + + The chent object to be printed + +- ...: + + Further arguments for compatibility with the S3 method diff --git a/docs/search.json b/docs/search.json index 5f22f90..0312572 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":"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] \"Koffein\" \"Mateina\" 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":"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":"caffeine <- chent$new(\"caffeine\") #> 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\" 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":"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":""}] |
