From 525269a9f663d02546e2de22ddd79294cc246f57 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 5 Mar 2026 15:57:01 +0100 Subject: Rebuild docs --- docs/404.html | 2 +- docs/404.md | 3 + docs/authors.html | 2 +- docs/authors.md | 21 + docs/index.html | 2 +- docs/index.md | 111 ++++++ docs/llms.txt | 133 +++++++ docs/news/index.html | 2 +- docs/news/index.md | 37 ++ docs/reference/chent.html | 11 +- docs/reference/chent.md | 802 +++++++++++++++++++++++++++++++++++++++ docs/reference/draw_svg.chent.md | 37 ++ docs/reference/index.html | 26 +- docs/reference/index.md | 20 + docs/reference/pai.html | 7 +- docs/reference/pai.md | 187 +++++++++ docs/reference/plot.chent.html | 15 +- docs/reference/plot.chent.md | 51 +++ docs/reference/ppp.md | 102 +++++ docs/reference/print.chent.md | 20 + docs/reference/print.pai.md | 20 + docs/reference/print.ppp.md | 20 + docs/search.json | 2 +- 23 files changed, 1606 insertions(+), 27 deletions(-) create mode 100644 docs/404.md create mode 100644 docs/authors.md create mode 100644 docs/index.md create mode 100644 docs/llms.txt create mode 100644 docs/news/index.md create mode 100644 docs/reference/chent.md create mode 100644 docs/reference/draw_svg.chent.md create mode 100644 docs/reference/index.md create mode 100644 docs/reference/pai.md create mode 100644 docs/reference/plot.chent.md create mode 100644 docs/reference/ppp.md create mode 100644 docs/reference/print.chent.md create mode 100644 docs/reference/print.pai.md create mode 100644 docs/reference/print.ppp.md 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. 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, https://pkgdow 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, . + + @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 @@ 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 + +[![Online +documentation](https://img.shields.io/badge/docs-jrwb.de-blue.svg)](https://pkgdown.jrwb.de/chents/) +[![R-Universe +status](https://jranke.r-universe.dev/badges/chents)](https://jranke.r-universe.dev/chents) +[![Code +coverage](https://img.shields.io/badge/coverage-jrwb.de-blue.svg)](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) +#> +#> 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) +``` + +![](reference/figures/README-unnamed-chunk-4-1.png) + +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) +``` + +![](reference/figures/README-unnamed-chunk-5-1.png) + +## 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 + +[![Online +documentation](https://img.shields.io/badge/docs-jrwb.de-blue.svg)](https://pkgdown.jrwb.de/chents/) +[![R-Universe +status](https://jranke.r-universe.dev/badges/chents)](https://jranke.r-universe.dev/chents) +[![Code +coverage](https://img.shields.io/badge/coverage-jrwb.de-blue.svg)](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) +#> +#> 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) +``` + +![](reference/figures/README-unnamed-chunk-4-1.png) + +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) +``` + +![](reference/figures/README-unnamed-chunk-5-1.png) + +## 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(`*``*`)`](https://pkgdown.jrwb.de/chents/reference/plot.chent.md) + : Plot method for chent objects +- [`print(`*``*`)`](https://pkgdown.jrwb.de/chents/reference/print.chent.md) + : Printing method for chent objects +- [`print(`*``*`)`](https://pkgdown.jrwb.de/chents/reference/print.pai.md) + : Printing method for pai objects (pesticidal active ingredients) +- [`print(`*``*`)`](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 @@ 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.">chents - 0.4.0 + 0.4.1