-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathREADME.Rmd
More file actions
144 lines (109 loc) · 6 KB
/
Copy pathREADME.Rmd
File metadata and controls
144 lines (109 loc) · 6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r echo=FALSE}
knitr::opts_chunk$set(
warning = FALSE,
message = FALSE,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
cache = TRUE
)
```
# Webchem
```{r coverage, echo=FALSE}
Sys.setenv(NOT_CRAN = "true")
cov <- covr::package_coverage()
pct <- covr::percent_coverage(cov)
pct_label <- sprintf("%.1f%%", pct)
# Choose badge color based on coverage
col <- if (pct >= 90) {
"brightgreen"
} else if (pct >= 75) {
"yellow"
} else if (pct >= 50) {
"orange"
} else {
"red"
}
badge_url <- sprintf(
"https://img.shields.io/badge/coverage-%s-%s",
URLencode(pct_label),
col
)
```
<!-- badges: start -->
[](https://www.repostatus.org/#active)
[](https://CRAN.R-project.org/package=webchem)
[](https://community.r-multiverse.org/webchem)
[](https://github.com/ropensci/webchem/actions)
```{r coverage-badge, echo=FALSE, results='asis'}
cat(sprintf("[](#test-coverage)\n\n", badge_url))
```
[](https://cran.r-project.org/package=webchem)
[](https://cran.r-project.org/package=webchem)
[](https://doi.org/10.18637/jss.v093.i13)
<!-- badges: end -->
`webchem` is a R package to retrieve chemical information from the web.
This package interacts with a suite of web APIs to retrieve chemical information.
The functions in the package that hit a specific API have a prefix and suffix separated by an underscore (`prefix_suffix()`).
They follow the format of `source_functionality`, with the exception of functions that retrieve database identifiers which follow the format of `get_identifier`. e.g.`cs_compinfo` uses ChemSpider to retrieve compound informations and `get_csid()` retrieves ChemSpider IDs.
## Chemical databases currently accessed by webchem
At least some of the data in the following sources is accesible through `webchem` functions. To learn more about what is available, browse the documentation [here](https://docs.ropensci.org/webchem/reference/index.html).
```{r databases-table, echo=FALSE, results='asis'}
databases <- tibble::tribble(
~Database, ~Webservice, ~Offline,
"[BCPC Compendium of Pesticide Common Names](https://pesticidecompendium.bcpc.org) (formerly Alan Wood's Compendium of Pesticide Common Names)", "✅", "❌",
"[ChEBI](https://www.ebi.ac.uk/chebi/)", "✅", "❌",
"[ChEMBL](https://www.ebi.ac.uk/chembl/)", "✅", "✅",
"[Chemical Identifier Resolver (CIR)](https://cactus.nci.nih.gov/chemical/structure)", "✅", "❌",
"[Chemical Translation Service (CTS)](http://cts.fiehnlab.ucdavis.edu/)", "✅", "❌",
"[ChemSpider](https://www.chemspider.com/) (requires an [API token](https://developer.rsc.org/))", "✅", "❌",
"[ETOX](http://webetox.uba.de/webETOX/index.do)", "✅", "❌",
"[EU Pesticides](https://food.ec.europa.eu/plants/pesticides/eu-pesticides-database_en)", "❌", "✅",
"[Flavornet](http://www.flavornet.org)", "✅", "❌",
"[FooDB](https://foodb.ca/)", "❌", "✅",
"[NIST](https://webbook.nist.gov) (currently gas chromatography retention indices only)", "✅", "❌",
"[OPSIN](https://www.ebi.ac.uk/opsin/)", "✅", "❌",
"[PubChem](https://pubchem.ncbi.nlm.nih.gov/)", "✅", "❌",
"[U.S. EPA Substance Registry Service (SRS)](https://cdxnodengn.epa.gov/cdx-srs-rest/)", "✅", "❌",
"[Wikidata](https://www.wikidata.org/wiki/Wikidata:WikiProject_Chemistry)", "✅", "❌"
)
knitr::kable(databases)
```
#### Offline access
For databases that support it (marked ✅ in the Offline column), `webchem` can download the database and then query it locally. Offline queries are faster, work without an internet connection, and return the same results every time, making your analyses more reproducible.
#### API keys
Some ChemSpider functions require an API key.
Please register at RSC (https://developer.rsc.org/) to retrieve an API key.
## Installation
#### Install from CRAN (stable version)
```{r install_cran, eval=FALSE}
install.packages("webchem")
```
#### Install from Github (development version)
```{r install_github, eval=FALSE}
install.packages("devtools")
library("devtools")
install_github("ropensci/webchem")
```
### Use Cases
See how `webchem` has been used or cited in literature [here](https://scholar.google.com/scholar?cites=14244442030948237605&as_sdt=40000005&sciodt=0,22&hl=en).
### Citation
If you use `webchem` in a publication, please cite our paper:
- Szöcs E, Stirling T, Scott ER, et al (2020) webchem: An R Package to Retrieve Chemical Information from the Web. J Stat Soft 93:. https://doi.org/10.18637/jss.v093.i13
### Acknowledgements
Without the fantastic web services `webchem` wouldn't be here. Therefore, kudos to the web service providers and developers! Please remember to acknowledge these data resources in your work using `webchem`.
### Want to contribute?
Check out our [contribution guide here](https://github.com/ropensci/webchem/blob/master/CONTRIBUTING.md).
### Meta
- Please [report any issues, bugs or feature requests](https://github.com/ropensci/webchem/issues).
- License: MIT
- Get citation information for `webchem` in R with `citation("webchem")`
- Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.
[](https://ropensci.org)