eloch216 / PhotoGEA

https://eloch216.github.io/PhotoGEA/
Other
1 stars 4 forks source link

[Unconfirmed] A potential c3 fit issue #99

Open yufenghe22 opened 1 month ago

yufenghe22 commented 1 month ago

I encountered a strange behavior of PhotoGEA's c3 fitting. A very small difference in A can cause a substantial different result of Vcmax and Jmax, particularly Vcmax.

The scenario can be repeated by running the script named run_test.R from here (https://github.com/Matthews-Research-Group/BioCro-ePhotosynthesis-v2/tree/master/enzyme_optimization/fit_Aci/test_PhotoGEA).

On my mac, the vcmax1=127 and vcmax2=134. And you can see that the A1 and A2 have only difference in decimal places. I do not expect the estimated Vcmax to be so different. Please see if this issue can be repeated on your computer.

[Update] Somehow this only happened in my Rstudio after using it for a while. I suspect this has something to do with the memory management of PhotoGEA's fitting procedure, but I'm not certain of it. Open this for records ONLY in case anyone else might have seen the same problem.

eloch216 commented 1 month ago

I just tried running the script and the two vcmax values were very similar (vcmax1 = 134.83 and vcmax2 = 134.8125).

RStudio could certainly have something to do with it. Thanks for bringing it up. This is something to keep an eye one. I could also potentially add a test like this to the package, to double-check that small changes in inputs result in small changes in outputs.

Something to keep in mind is that fitting identical or similar A-Ci curves may actually produce different results because the default optimization algorithm (deoptim) uses randomness. So if you want things to be totally reproducible, it's a good idea to set a seed. That being said, deoptim should find similar solutions every time if the number of generations is high enough (and if remove_unreliable_param is set to TRUE).