osmose-model / osmose-web-api

Web service that generates Osmose configuration files from data sources like Fishbase and SeaLifeBase. Used by https://www.config.osmose-model.org .
MIT License
2 stars 2 forks source link

Updating the "PredPreyRatioMin" field of FishBase/SeaLifeBase's ESTIMATE table #150

Closed agruss2 closed 6 years ago

agruss2 commented 6 years ago

@Dengaloo @FIN-JBarile @FIN-casey As described in #32 and in this document (OSMOSE_Methods_Predator_prey_size_ratios.docx), I developed generalized additive models (GAMs) that predict minimum predator/prey size ratios. We now need to update the "PredPreyRatioMin" field of FishBase/SeaLifeBase's ESTIMATE table, using the predictions of the GAMs that I developed. We should proceed as follows: (1) If the species under consideration belongs to one of the following orders, then the "complex" GAM of minimum predator/prey size ratio should be used to estimate the minimum predator/prey size ratio of the species: Carcharhiniformes, Chimaeriformes, Clupeiformes, Decapoda, Elopiformes, Euphausiacea, Gadiformes, Mugiliformes, Myctophiformes, Myliobatiformes, Octopoda, Osmeriformes, Perciformes, Pleuronectiformes, Salmoniformes, Scorpaeniformes, Sepiida, Siluriformes, Squaliformes, Stomatopoda, Stomiiformes, and Teuthida. (2) If the species under consideration does not belong to an order listed in (1) BUT has a trophic level (TL) provided in FishBase or SeaLifeBase, then the "simple" GAM of minimum predator/prey size ratio should be used to estimate the minimum predator/prey size ratio of the species. (3) Finally, if the species under consideration does not belong to an order listed in (1) AND does not have a trophic level (TL) provided in FishBase or SeaLifeBase, then the minimum predator/prey size ratio of the species should be set to 3.5.

To figure out how to update the "PredPreyRatioMin" field of FishBase/SeaLifeBase's ESTIMATE table from the predictions of the GAMs that I developed, I suggest that we meet on Skype soon. I will be available any time from now to December, 22nd and then again starting from December, 31st. Please let me know a day and time where we could meet. Many thanks!

agruss2 commented 6 years ago

@Dengaloo @FIN-JBarile As discussed during our last Skype meeting, I am now in charge of updating FB's and SLB's ESTIMATE tables. However, making predictions with the generalized additive models (GAMs) that I developed is taking me far much time than initially anticipated. I should not be done with this task before some time next week. Once I am done, I will send you the updated FB's and SLB's ESTIMATE tables in the form of spreadsheets, which I will ask you to integrate in FB and SLB. Finally, I will be able to run some tests to see if the updated PredPreyRatioMin fields of the FB's and SLB's ESTIMATE tables are satisfactory or if some ultimate modifications are needed. Many thanks!

agruss2 commented 6 years ago

@FIN-JBarile @QQ-Sortiz (CC: @Dengaloo) (This comment is identical to that I just posted for #151) I am done updating the PredPreyRatioMin and PredPreyRatioMax fields of the ESTIMATE tables, based on the predictions of my generalized additive models. Here is the updated FB's ESTIMATE table: ESTIMATE_v3.xlsx And here is the updated SLB's ESTIMATE table: ESTIMATE_SLB_v3.xlsx Could you know please update your ESTIMATE tables (those that the API use to derive parameter estimates for OSMOSE)? Once you are done with these updates, please post a comment here to let me know. I will then run a test for some ecosystems to find out whether the predator/prey size ratio estimates provided by the API are satisfactory. Many thanks!

FIN-JBarile commented 6 years ago

@agruss2 We will need Jorrit's help here. @jhpoelen My understanding is that your API uses a local copy at your end of FishBase/SeaLifeBase tables used, so to speak. That is the API doesn't extract directly from the FishBase API in rOpenSci. Correct? If so, may we know how we can proceed? Thanks!

jhpoelen commented 6 years ago

A cached version of fishbase/sealifebase api is used to enable fishbase/sealifebase data for batch processing. See https://github.com/jhpoelen/fishbase_archiver/releases , https://github.com/jhpoelen/fishbase_archiver and https://github.com/jhpoelen/fb-osmose-bridge/blob/master/src/main/java/com/github/jhpoelen/fbob/ValueFactoryFishbaseCache.java .

Generating a new fisbhase_archive release and updating the version of ValueFactoryFishbaseCache should be doable by any reasonably skilled software engineer. Happy to provide read/write access to the fishbase_archive if you'd like to re-use the repository and not clone it somewhere else.

Hope this helps.

agruss2 commented 6 years ago

@QQ-Sortiz (CC: @Dengaloo @FIN-JBarile @jhpoelen) This has also become an API issue, and you are the responsible for API issues. Therefore, could you please solve this issue by March, 11th? If needed, please ask questions to @jhpoelen Thanks a lot.

FIN-JBarile commented 6 years ago

@jhpoelen Thanks for the guide. Yes, please give Miel read/write access so he can see more about updating the estimate tables of FishBase and SeaLifeBase. Thanks.

jhpoelen commented 6 years ago

I've invited @FIN-JBarile and @QQ-Sortiz to become a collaborator for https://github.com/jhpoelen/fishbase_archiver . Both @FIN-JBarile and @QQ-Sortiz are already collaborators for https://github.com/jhpoelen/fb-osmose-bridge . Probably just stating the obvious, but please do not remove/ change older releases and be careful making changes. Good luck!

jhpoelen commented 6 years ago

PS - At some point, it might make sense to create a github organization. This allows for more flexible permission management.

QQ-Sortiz commented 6 years ago

Hello @agruss2,

Same as issue #151. Please check. Thanks

agruss2 commented 6 years ago

@QQ-Sortiz (CC: @FIN-JBarile)
Many thanks for having worked on this! I ran a test where I queried OSMOSE parameters for six different ecosystems. In all cases, I obtained a minimum predator/prey size ratio of 3.5 for all focal functional groups. In other words, in all cases, the minimum predator/prey size ratio of all focal functional groups was set to the default value of the parameter. This should not be the case, because of the large number and diversity of minimum predator/prey size ratios in the "ESTIMATE_v3.xlsx" and "ESTIMATE_SLB_v3.xlsx" files that I shared above. I suspect that what is happening is that the API is currently setting all minimum predator/prey size ratios to 3.5 instead of extracting relevant values from FishBase's and SeaLifeBase's ESTIMATE tables. Could you please correct for this? Thank you very much.

QQ-Sortiz commented 6 years ago

Hello @agruss2,

I tried to generate the osmose configuration for Azores Island before changing the estimates table and after changing it. Kindly see the attached file for the result. osmose_config(Azores_new).zip osmose_config(Azores_old).zip

Upon checking the osm_param-predation.csv file, the minimum predator/prey ratio(predation.predPrey.sizeRatio.max and predation.predPrey.sizeRatio.min) is not equal to 3.5. The value varies for all the species which is I think the expected output. Can you tell me what ecosystems did you use so that we can replicate the problem? Thanks

agruss2 commented 6 years ago

@QQ-Sortiz I ran a test where I queried parameters for OSMOSE models for different ecosystems. The minimum predator/prey size ratio estimates I obtained were as expected and made sense. Many thanks for your very good work on this!! I am now going to close the present issue. The next step will be for me to: (1) query OSMOSE parameters for all ecosystems, in order to find out whether an "osmose_config.zip" file can be obtained for all ecosystems (and not only JSON files for the ecosystems characterized by a very high biodiversity); and (2) examine in great detail the parameter values provided for several chosen ecosystems, so as to determine whether some things need to be tweaked in the bridge between FB/SLB and OSMOSE. Meanwhile, I will start working on the first draft of manuscript. Talk very soon!