diff options
| author | Johannes Ranke <johannes.ranke@jrwb.de> | 2026-03-05 11:09:31 +0100 |
|---|---|---|
| committer | Johannes Ranke <johannes.ranke@jrwb.de> | 2026-03-05 11:14:53 +0100 |
| commit | 4e092707e70adac492b74197e6ceef5cdd09cc8d (patch) | |
| tree | 0e3f46d0282c5ef5785394bc9f0b33a990e20b6e /docs/index.html | |
| parent | 594d35837001f92dec9bda0e873ba6b7286162a0 (diff) | |
Bump version for improved pai printing method
Also, improve the example demonstrating pais not found at BCPC
Diffstat (limited to 'docs/index.html')
| -rw-r--r-- | docs/index.html | 64 |
1 files changed, 45 insertions, 19 deletions
diff --git a/docs/index.html b/docs/index.html index 6850f0a..d9d44ad 100644 --- a/docs/index.html +++ b/docs/index.html @@ -22,7 +22,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"> @@ -51,35 +51,61 @@ </h1></div> <p><a href="https://pkgdown.jrwb.de/chents/"><img src="https://img.shields.io/badge/docs-jrwb.de-blue.svg" alt="Online documentation"></a> <a href="https://jranke.r-universe.dev/chents" class="external-link"><img src="https://jranke.r-universe.dev/badges/chents" alt="R-Universe status"></a> <a href="https://pkgdown.jrwb.de/chents/coverage/coverage.html"><img src="https://img.shields.io/badge/coverage-jrwb.de-blue.svg" alt="Code coverage"></a></p> <p>The R package <strong>chents</strong> provides some utilities for working with chemical entities in R.</p> -<div class="section level2"> -<h2 id="features">Features<a class="anchor" aria-label="anchor" href="#features"></a> -</h2> -<ul> -<li>Some chemical information is retrieved from the PubChem website using the webchem package</li> -<li>If Python and RDKit (> 2015.03) are installed and configured for use with ‘reticulate’, some basic chemoinformatics functions some additional chemical information is computed and a 2D graph can be plotted</li> -<li>Additional information can be read from a local .yaml file</li> -</ul> -</div> +<p>When first defining a chemical entity, some chemical information is retrieved from the <a href="https://pubchem.ncbi.nlm.nih.gov/" class="external-link">PubChem</a> website using the <a href="https://docs.ropensci.org/webchem/" class="external-link">webchem</a> package.</p> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/chents">chents</a></span><span class="op">)</span></span> +<span><span class="va">caffeine</span> <span class="op"><-</span> <span class="va"><a href="reference/chent.html">chent</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="st">"caffeine"</span><span class="op">)</span></span> +<span><span class="co">#> Querying PubChem ...</span></span> +<span><span class="co">#> Trying to get chemical information from RDKit using PubChem SMILES</span></span> +<span><span class="co">#> CN1C=NC2=C1C(=O)N(C(=O)N2C)C</span></span></code></pre></div> +<p>If Python and <a href="https://rdkit.org" class="external-link">RDKit</a> (> 2015.03) are installed and configured for use with the <a href="https://rstudio.github.io/reticulate/" class="external-link">reticulate</a> package, some additional chemical information including a 2D graph are computed.</p> +<p>The print method gives an overview of the information that was collected.</p> +<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><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="co">#> <chent></span></span> +<span><span class="co">#> Identifier $identifier caffeine </span></span> +<span><span class="co">#> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N </span></span> +<span><span class="co">#> SMILES string $smiles:</span></span> +<span><span class="co">#> PubChem </span></span> +<span><span class="co">#> "CN1C=NC2=C1C(=O)N(C(=O)N2C)C" </span></span> +<span><span class="co">#> Molecular weight $mw: 194.2 </span></span> +<span><span class="co">#> PubChem synonyms (up to 10):</span></span> +<span><span class="co">#> [1] "caffeine" "58-08-2" </span></span> +<span><span class="co">#> [3] "Guaranine" "1,3,7-Trimethylxanthine"</span></span> +<span><span class="co">#> [5] "Methyltheobromine" "Theine" </span></span> +<span><span class="co">#> [7] "Thein" "Cafeina" </span></span> +<span><span class="co">#> [9] "Koffein" "Mateina"</span></span></code></pre></div> +<p>There is a very simple plotting method for the chemical structure.</p> +<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">caffeine</span><span class="op">)</span></span></code></pre></div> +<p><img src="reference/figures/README-unnamed-chunk-4-1.png"><!-- --></p> +<p>Additional information can be (but is rarely ever) read from a local .yaml file. This information can be leveraged e.g. by the <a href="https://pkgdown.jrwb.de/pfm/reference/PEC_soil.html" class="external-link">PEC_soil</a> function of the ‘pfm’ package.</p> +<p>If you have a so-called ISO common name of a pesticide active ingredient, you can use the ‘pai’ class derived from the ‘chent’ class, which starts with querying the <a href="http://www.bcpcpesticidecompendium.org/" class="external-link">BCPC compendium</a> first.</p> +<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span><span class="va">lambda</span> <span class="op"><-</span> <span class="va"><a href="reference/pai.html">pai</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="st">"lambda-cyhalothrin"</span><span class="op">)</span></span> +<span><span class="co">#> Querying BCPC for lambda-cyhalothrin ...</span></span> +<span><span class="co">#> Querying PubChem ...</span></span> +<span><span class="co">#> Trying to get chemical information from RDKit using PubChem SMILES</span></span> +<span><span class="co">#> CC1([C@@H]([C@@H]1C(=O)O[C@@H](C#N)C2=CC(=CC=C2)OC3=CC=CC=C3)/C=C(/C(F)(F)F)\Cl)C</span></span> +<span><span class="co">#> RDKit mw is 449.856</span></span> +<span><span class="co">#> mw is 449.8</span></span> +<span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">lambda</span><span class="op">)</span></span></code></pre></div> +<p><img src="reference/figures/README-unnamed-chunk-5-1.png"><!-- --></p> <div class="section level2"> <h2 id="installation">Installation<a class="anchor" aria-label="anchor" href="#installation"></a> </h2> <p>You can conveniently install chents from the repository kindly made available by the R-Universe project:</p> -<pre><code><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"chents"</span>,</span> -<span> repos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"https://jranke.r-universe.dev"</span>, <span class="st">"https://cran.r-project.org"</span><span class="op">)</span><span class="op">)</span></span></code></pre> +<div class="sourceCode" id="cb5"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="fu">install.packages</span>(<span class="st">"chents"</span>,</span> +<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a> <span class="at">repos =</span> <span class="fu">c</span>(<span class="st">"https://jranke.r-universe.dev"</span>, <span class="st">"https://cran.r-project.org"</span>))</span></code></pre></div> <p>In order to profit from the chemoinformatics, you need to install RDKit and its python bindings. On a Debian type Linux distribution, just use</p> -<pre><code>sudo apt install python3-rdkit</code></pre> +<div class="sourceCode" id="cb6"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" tabindex="-1"></a>sudo apt install python3<span class="sc">-</span>rdkit</span></code></pre></div> <p>If you use this package on Windows or MacOS, I would be happy to include installation instructions here if you share them with me, e.g. via a Pull Request.</p> </div> <div class="section level2"> <h2 id="configuration-of-the-python-version-to-use">Configuration of the Python version to use<a class="anchor" aria-label="anchor" href="#configuration-of-the-python-version-to-use"></a> </h2> <p>On Debian type Linux distributions, you can use the following line in your global or project specific <code>.Rprofile</code> file to tell the <code>reticulate</code> package to use the system Python version that will find the RDKit installed in the system location.</p> -<pre><code><span><span class="fu"><a href="https://rdrr.io/r/base/Sys.setenv.html" class="external-link">Sys.setenv</a></span><span class="op">(</span>RETICULATE_PYTHON<span class="op">=</span><span class="st">"/usr/bin/python3"</span><span class="op">)</span></span></code></pre> -</div> -<div class="section level2"> -<h2 id="examples">Examples<a class="anchor" aria-label="anchor" href="#examples"></a> -</h2> -<p>Some examples are available from the <a href="https://pkgdown.jrwb.de/chents/reference">reference on jrwb.de</a>. For example, in the <a href="https://pkgdown.jrwb.de/chents/reference/chent.html#ref-examples">example code section of the chent object docs</a> you can see how to generate an R object for caffeine, show some of the information retrieved from PubChem and plot it by virtue of RDKit.</p> +<div class="sourceCode" id="cb7"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" tabindex="-1"></a><span class="fu">Sys.setenv</span>(<span class="at">RETICULATE_PYTHON=</span><span class="st">"/usr/bin/python3"</span>)</span></code></pre></div> </div> </div> </main><aside class="col-md-3"><div class="links"> |
