mczyzj / pestr

Tools to use EPPO Data Services from R
Other
6 stars 0 forks source link

Retrieve all pest names #24

Open rigormortis0 opened 8 months ago

rigormortis0 commented 8 months ago

Dear Michal,

I am trying to get a vector with all the pests that exist in the EPPO database, a complete list of all the full names. I have not managed to do it with this package, if not possible what method could you advice. Thank you.

Best, João Colaço

mczyzj commented 8 months ago

@rigormortis0 Hey, Thanks for checking out the pestr package! Getting the whole vector of pest names might be tricky with the package. The deal is that if you want to query API with to many eppocodes you will get temporary ban. However if you look at this: https://www.eppo.int/RESOURCES/eppo_databases/eppo_codes

You will see that the plants eppocodes are always 5 letters, while other organisms (and viruses) have 6 letters in eppocodes. There are also some eppocodes for commodities, but the names should be easy to filter.

What I would do:

  1. Query the SQLite data base for eppocodes that are 6 letters long from t_codes table.
  2. Take the codeid of this eppocodes and match them with t_names table.
  3. Filter the status == A, you will get all the names of pests in db including common names and synonyms.

This method won't return weeds or pest plants. To do this, you would need to take all the plant eppocodes and pass them to the eppo_tabletools_hosts function. The eppocodes that have host by definition are also parasitic plants. But as mentioned above, if you try to do it in one query you will get temporary ban.

If you do not know how to query the SQLite DB, I can write a script and post it here, but currently I am quite loaded so you will need to wait till Sunday.