8000 Final edits before v1.1.2 by stitam · Pull Request #342 · ropensci/webchem · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Final edits before v1.1.2 #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
10000
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ README_cache

codemeta.json
^codemeta\.json$

cran-comments.md
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Description: Chemical information from around the web. This package interacts
Flavornet, NIST Chemistry WebBook, OPSIN, PAN Pesticide Database, PubChem,
SRS, Wikidata.
Type: Package
Version: 1.1.1.9004
Date: 2021-02-07
Version: 1.1.2
Date: 2021-12-06
License: MIT + file LICENSE
URL: https://docs.ropensci.org/webchem/, https://github.com/ropensci/webchem
BugReports: https://github.com/ropensci/webchem/issues
Expand Down
38 changes: 19 additions & 19 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# webchem (development version)
# webchem 1.1.2

## NEW FEATURES

Expand All @@ -7,7 +7,7 @@
## BUG FIXES

* ci_query() can no longer query chemicals by name.
* non-exported function ping_pubchem_pw() was incorrectly reporting that PUG VIEW was down. This has been fixed.
* Non-exported function ping_pubchem_pw() was incorrectly reporting that PUG VIEW was down. This has been fixed.
* is.cas() now catches whitespaces correctly.
* aw_query() was renamed and adapted to bcpc_query, as the alanwood site has moved

Expand Down Expand Up @@ -59,8 +59,8 @@

## MINOR IMPROVEMENTS

* all `get_*()` functions now output tibbles with a column for the query and a column for the retrieved ID.
* changes to arguments in `get_*()` functions to make them more consistent.
* All `get_*()` functions now output tibbles with a column for the query and a column for the retrieved ID.
* Changes to arguments in `get_*()` functions to make them more consistent.
* aw_idx.rda is no longer included in the package as a data set. Instead, it is built by build_aw_idx() to tempdir().


Expand Down Expand Up @@ -91,7 +91,7 @@
## MINOR IMPROVEMENTS

* as.cas() added.
* removed documentation files for non-exported functions that were only used internally.
* Removed documentation files for non-exported functions that were only used internally.

## BUG FIXES

Expand Down Expand Up @@ -129,7 +129,7 @@
* cs_prop() did not parse scientific number correctly.
* is.smiles() failed because of changes in rcdk.
* cir_query() failed with identifiers containing spaces (e.g. 'acetic acid').
* several other functions failed with identifiers containing spaces & returned wrong distance.
* Aeveral other functions failed with identifiers containing spaces & returned wrong distance.

## DEPRECATED FUNCTIONS

Expand Down Expand Up @@ -179,11 +179,11 @@


## NEW FEATURES
* added ping_pubchem() to check whether pubchem is up & running.
* added cs_web_ping () to check whether the chemspider webpage is functional.
* Added ping_pubchem() to check whether pubchem is up & running.
* Added cs_web_ping () to check whether the chemspider webpage is functional.

## MINOR IMPROVEMENTS
* updated allan wood index.
* Updated allan wood index.

## BUG FIXES
* pc_prop() returned to many rows if last cid supplied was NA.
Expand All @@ -202,16 +202,16 @@


## NEW FEATURES
* added cts_to() and cts_from() to retrieve possible ids that can be queried.
* Added cts_to() and cts_from() to retrieve possible ids that can be queried.
* cts_*(), pp_query(), cir_query(), get_cid(), get_etoxid(), etox_*(), pan_query() get_wdid(), aw_query(), get_csid(), cs_prop(), cs_compinfo() and ci_query() can handle multiple inputs.
* pc_prop() queries properties and pc_synonmy() synonyms from PUG-REST.
* added extractors for webchem objects: cas(), inchikey() and smiles().
* Added extractors for webchem objects: cas(), inchikey() and smiles().


## MINOR IMPROVEMENTS
* rewrite of pubchem functions using PUG-REST.
* chemspider: better use of NA in input (=return NA).
* more robust matching in get_etoxid.
* Rewrite of pubchem functions using PUG-REST.
* ChemSpider: better use of NA in input (=return NA).
* More robust matching in get_etoxid.

## BUG FIXES

Expand Down Expand Up @@ -253,14 +253,14 @@ The new ppdb_parse() parses only a html, but does not interact with the database
- names of returned list changed.
- result is numeric where appropriate.
* cir(): result is numeric where appropriate.
* unified naming scheme of functions.
* Unified naming scheme of functions.
* is.inchikey_cs() has been integrated into is.inchikey().
* aw_query() returns multiple inchikey if found.
* pan() now returns chemical name and matched synonym.

## BUG FIXES

* utility functions are not vectorized and throw an error.
* Utility functions are not vectorized and throw an error.
* chemid() did mot work with inchikey as input.
* ppdb_idx returned duplicated CAS values, which caused ppdb() to fail.
* ppdb() failed in some cases because of false encoding.
Expand Down Expand Up @@ -321,7 +321,7 @@ The new ppdb_parse() parses only a html, but does not interact with the database

* alanwood() returns only results for first match in case of multiple links found.
* physprop() stopped working after change of SRC to https, fixed now.
* changed etox_* functions to https.
* Changed etox_* functions to https.


## DEPRECATED FUNCTIONS
Expand Down Expand Up @@ -351,8 +351,8 @@ The new ppdb_parse() parses only a html, but does not interact with the database

## MINOR IMPROVEMENTS

* added exceptions/checks to tests.
* improved robustness of cir_query().
* Added exceptions/checks to tests.
* Improved robustness of cir_query().

## BUG FIXES

Expand Down
8 changes: 4 additions & 4 deletions R/bcpc.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Query http://pesticidecompendium.bcpc.org
#' Query https://pesticidecompendium.bcpc.org
#'
#' Query the BCPC Compendium of Pesticide Common Names
#' \url{http://pesticidecompendium.bcpc.org}
#' \url{https://pesticidecompendium.bcpc.org}
#' formerly known as Alan Woods Compendium of Pesticide Common Names
#' @import xml2
#'
Expand All @@ -15,7 +15,7 @@
#' url.
#' @note for from = 'cas' only the first matched link is returned.
#' Please respect Copyright, Terms and Conditions
#' \url{http://pesticidecompendium.bcpc.org/legal.html}!
#' \url{https://pesticidecompendium.bcpc.org/legal.html}!
#' @references Eduard Szöcs, Tamás Stirling, Eric R. Scott, Andreas Scharmüller,
#' Ralf B. Schäfer (2020). webchem: An R Package to Retrieve Chemical
#' Information from the Web. Journal of Statistical Software, 93(13).
Expand Down Expand Up @@ -147,7 +147,7 @@ bcpc_query <- function(query, from = c("name", "cas"),
r_isomer = gsub(".*\\(R\\)-isomer:(.*)", "\\1", inchi))
}
}

out <- list(cname = cname, status = status,
pref_iupac_name = pref_iupac_name, iupac_name = iupac_name,
cas = cas, formula = formula, activity = activity,
Expand Down
2 changes: 1 addition & 1 deletion R/chemid.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ci_query <- function(query, from = c("rn", "inchikey"),
physprop <- NA
} else {
physprop <- html_table(xml_find_all(ttt, "//h2[contains(., 'Physical Prop')]/following-sibling::div//table"))[[1]]
physprop[ , 'Value'] <- as.numeric(physprop[ , 'Value'])
physprop[ , 'Value'] <- as.numeric(unlist(physprop[ , 'Value']))
#= same as physprop
}

Expand Down
12 changes: 6 additions & 6 deletions R/chemspider.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cs_check_key <- function() {
#' @note An API key is needed. Register at \url{https://developer.rsc.org/}
#' for an API key. Please respect the Terms & Conditions. The Terms & Conditions
#' can be found at \url{https://developer.rsc.org/terms}.
#' @references \url{https://developer.rsc.org/compounds-v1/apis}
#' @references \url{https://developer.rsc.org/docs/compounds-v1-trial/1/overview}
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -107,7 +107,7 @@ cs_datasources <- function(apikey = NULL, verbose = getOption("verbose")) {
#' Each API uses a subset of these controls.
#' The controls that are available for a given function are indicated within the
#' documentation of the function.
#' @references \url{https://developer.rsc.org/compounds-v1/apis}
#' @references \url{https://developer.rsc.org/docs/compounds-v1-trial/1/overview}
#' @seealso \code{\link{get_csid}}
#' @export
#' @examples
Expand Down Expand Up @@ -160,7 +160,7 @@ cs_control <- function(datasources = vector(),
#' @note An API key is needed. Register at \url{https://developer.rsc.org/} for
#' an API key. Please respect the Terms & conditions:
#' \url{https://developer.rsc.org/terms}.
#' @references \url{https://developer.rsc.org/compounds-v1/apis}
#' @references \url{https://developer.rsc.org/docs/compounds-v1-trial/1/overview}
#' @references Eduard Szöcs, Tamás Stirling, Eric R. Scott, Andreas Scharmüller,
#' Ralf B. Schäfer (2020). webchem: An R Package to Retrieve Chemical
#' Information from the Web. Journal of Statistical Software, 93(13).
Expand Down Expand Up @@ -332,7 +332,7 @@ get_csid <- function(query,
#' @note An API key is needed. Register at \url{https://developer.rsc.org/}
#' for an API key. Please respect the Terms & Conditions. The Terms & Conditions
#' can be found at \url{https://developer.rsc.org/terms}.
#' @references \url{https://developer.rsc.org/compounds-v1/apis}
#' @references \url{https://developer.rsc.org/docs/compounds-v1-trial/1/overview}
#' @references Eduard Szöcs, Tamás Stirling, Eric R. Scott, Andreas Scharmüller,
#' Ralf B. Schäfer (2020). webchem: An R Package to Retrieve Chemical
#' Information from the Web. Journal of Statistical Software, 93(13).
Expand Down Expand Up @@ -463,7 +463,7 @@ cs_convert <- function(query, from, to, verbose = getOption("verbose"),
#' @note An API key is needed. Register at \url{https://developer.rsc.org/}
#' for an API key. Please respect the Terms & Conditions. The Terms & Conditions
#' can be found at \url{https://developer.rsc.org/terms}.
#' @references \url{https://developer.rsc.org/compounds-v1/apis}
#' @references \url{https://developer.rsc.org/docs/compounds-v1-trial/1/overview}
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -618,7 +618,7 @@ use 'cs_commpinfo()' instead.")
#' @note An API key is needed. Register at \url{https://developer.rsc.org/}
#' for an API key. Please respect the Terms & Conditions. The Terms & Conditions
#' can be found at \url{https://developer.rsc.org/terms}.
#' @references \url{https://developer.rsc.org/compounds-v1/apis}
#' @references \url{https://developer.rsc.org/docs/compounds-v1-trial/1/overview}
#' @seealso \code{\link{get_csid}}, \code{\link{cs_check_key}}
#' @export
#' @examples
Expand Down
8 changes: 5 additions & 3 deletions R/cts.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ cts_compinfo <- function(query, from = "inchikey",
#' single named vector.
#' @details See also \url{http://cts.fiehnlab.ucdavis.edu/}
#' for possible values of from and to.
#' @note When this version of webchem was released, CTS was temporarily unable
#' to convert chemical names to IDs.
#'
#' @seealso \code{\link{cts_from}} for possible values in the 'from' argument
#' and \code{\link{cts_to}} for possible values in the 'to' argument.
Expand All @@ -110,11 +112,11 @@ cts_compinfo <- function(query, from = "inchikey",
#' @examples
#' \donttest{
#' # might fail if API is not available
#' cts_convert("triclosan", "Chemical Name", "inchikey")
#' cts_convert("XEFQLINVKFYRCS-UHFFFAOYSA-N", "inchikey", "Chemical Name")
#'
#' ### multiple inputs
#' comp <- c("triclosan", "hexane")
#' cts_convert(comp, "Chemical Name", "cas")
#' keys <- c("XEFQLINVKFYRCS-UHFFFAOYSA-N", "VLKZOEOYAKHREP-UHFFFAOYSA-N")
#' cts_convert(keys, "inchikey", "cas")
#' }
cts_convert <- function(query,
from,
Expand Down
4 changes: 2 additions & 2 deletions R/webchem-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (getRversion() >= "2.15.1")
#'
#' This dataset comprises acute ecotoxicity data of 124 insecticides.
#' The data is publicly available and can be retrieved from the EPA ECOTOX database
#' (\url{http://cfpub.epa.gov/ecotox/})
#' (\url{https://cfpub.epa.gov/ecotox/})
#' It comprises acute toxicity data (D. magna, 48h, Laboratory, 48h) and has been
#' preprocessed (remove non-insecticides, aggregate multiple value, keep only numeric data etc).
#'
Expand All @@ -47,5 +47,5 @@ if (getRversion() >= "2.15.1")
#' \item{cas}{CAS registry number}
#' \item{value}{LC50value}
#' }
#' @source \url{http://cfpub.epa.gov/ecotox/}
#' @source \url{https://cfpub.epa.gov/ecotox/}
"lc50"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ documentation
Compendium of Pesticide Common Names)
- [ChEBI](https://www.ebi.ac.uk/chebi/)
- [Chemical Identifier Resolver
(CIR)](http://cactus.nci.nih.gov/chemical/structure)
(CIR)](https://cactus.nci.nih.gov/chemical/structure)
- [Chemical Translation Service
(CTS)](http://cts.fiehnlab.ucdavis.edu/)
- [ChemIDplus](https://chem.nlm.nih.gov/chemidplus/)
- [ChemSpider](http://www.chemspider.com/) (requires an [API
token]((https://developer.rsc.org/)))
token](https://developer.rsc.org/))
- [ETOX](http://webetox.uba.de/webETOX/index.do)
- [Flavornet](http://www.flavornet.org)
- [NIST](https://webbook.nist.gov) (currently gas chromatography
retention indices only)
- [OPSIN](http://opsin.ch.cam.ac.uk/instructions.html)
- [PAN Pesticide Database](http://www.pesticideinfo.org/)
- [PAN Pesticide Database](https://www.pesticideinfo.org/)
- [PubChem](https://pubchem.ncbi.nlm.nih.gov/)
- [U.S. EPA Substance Registry Service
(SRS)](https://cdxnodengn.epa.gov/cdx-srs-rest/)
Expand Down Expand Up @@ -130,4 +130,4 @@ here](https://github.com/ropensci/webchem/blob/master/CONTRIBUTING.md).
of Conduct](https://ropensci.org/code-of-conduct/). By contributing
to this project, you agree to abide by its terms.

[![ropensci](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org)
[![ropensci](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)
27 changes: 22 additions & 5 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
],
"@type": "SoftwareSourceCode",
"identifier": "webchem",
"description": "Chemical information from around the web. This package interacts \n with a suite of web services for chemical information. Sources include: Alan\n Wood's Compendium of Pesticide Common Names, Chemical Identifier Resolver,\n ChEBI, Chemical Translation Service, ChemIDplus, ChemSpider, ETOX,\n Flavornet, NIST Chemistry WebBook, OPSIN, PAN Pesticide Database, PubChem,\n SRS, Wikidata.",
"description": "Chemical information from around the web. This package interacts with a suite of web services for chemical information. Sources include: Alan Wood's Compendium of Pesticide Common Names, Chemical Identifier Resolver, ChEBI, Chemical Translation Service, ChemIDplus, ChemSpider, ETOX, Flavornet, NIST Chemistry WebBook, OPSIN, PAN Pesticide Database, PubChem, SRS, Wikidata.",
"name": "webchem: Chemical Information from the Web",
"codeRepository": "https://github.com/ropensci/webchem",
"relatedLink": [
Expand All @@ -15,13 +15,13 @@
],
"issueTracker": "https://github.com/ropensci/webchem/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "1.1.1",
"version": "1.1.2",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.0.3 (2020-10-10)",
"runtimePlatform": "R version 4.1.2 (2021-11-01)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -189,6 +189,18 @@
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=usethis"
},
{
"@type": "SoftwareApplication",
"identifier": "vcr",
"name": "vcr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=vcr"
}
],
"softwareRequirements": [
Expand Down Expand Up @@ -334,10 +346,15 @@
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rlang"
},
{
"@type": "SoftwareApplication",
"identifier": "utils",
"name": "utils"
}
],
"readme": "https://github.com/ropensci/webchem/blob/master/README.md",
"fileSize": "0KB",
"fileSize": "616.471KB",
"keywords": [
"rstats",
"ropensci",
Expand All @@ -350,7 +367,7 @@
"r-package"
],
"releaseNotes": "https://github.com/ropensci/webchem/blob/master/NEWS.md",
"contIntegration": "https://codecov.io/gh/ropensci/webchem/branch/master",
"contIntegration": ["https://github.com/ropensci/webchem/actions", "https://codecov.io/gh/ropensci/webchem/branch/master"],
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
3 changes: 3 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# webchem 1.1.2

* https://developer.rsc.org/, SSL certificate problem: unable to get local issuer certificate: The URLs work and including these URLs in the package is important.
6 changes: 3 additions & 3 deletions man/bcpc_query.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0