Implement access to EU Pesticides Database - #467
Open
stitam wants to merge 12 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #460.
https://food.ec.europa.eu/plants/pesticides/eu-pesticides-database_en
Also known as DG SANTE Pesticide Database, the EU Pesticide Database contains "information on active substances used in plant protection products, Maximum Residue Levels (MRLs) in food products, and emergency authorisations of plant protection products in Member States." The data download and APIs page offers a number of pubic endpoints which is a clear sign that we are free to implement access to the database.
This PR adds the following functionality to
webchem:db_download_eup()downloads two data sets, the "Active Substances" data set and the "Residues and MRLs" data set and stores them as a single sqlite database which is subsequently queried by other functions.eup_list_entries()lists all entries in the database.eup_convert()converts between supported identifiers.eup_query()queries the database.Not an EU Pesticides specific functionality, but this PR also adds a new function
db_connect()whichwebchemusers can use to connect to downloaded offline databases and get e.g. direct access to the tables within the sqlite databases.webchemcurrently provides offline access to ChEMBL, EU Pesticides, FooDB, these are all supported bydb_connect().PR task list:
devtools::document()Extra tasks (more for maintainers, but feel free to do them if you want):
RUN_ONLINE_TESTSto "true"devtools::build_readme()to update test coverage badge