micom-dev / micom

Python package to study microbial communities using metabolic modeling.
https://micom-dev.github.io/micom
Apache License 2.0
82 stars 17 forks source link

keyerror: '_gpr' when using 'load_pickle' #121

Closed Rotembartuv closed 9 months ago

Rotembartuv commented 1 year ago

hi

Im have some issues with 'load_pickle' command

for com_No in all_com: comname = 'com' + str(com_No) + '.pickle' print(com_name) com = load_pickle('C:/Users/rotemb/OneDrive/Ph.D/binning_90_5/communities/com_test/'+com_name)

im geting the error

keyerror: '_gpr' when trying to load a pickle file python

my pickle file contain 4 species, the GEMs built using CarvMe and validated with MIMOTE

cdiener commented 1 year ago

Usually pickle files can only be read with the same MICOM and COBRApy versions that were used to build them in the first place. So we recommend rebuilding the models after you have updated MICOM or COBRApy. Do you still have the taxonomy tables?

In this case that is due to the new gene-reaction-rule format in cobrapy which breaks compatibility with pickled models generated with older versions. I submitted a PR to cobrapy to improve backwards compatibility, so hopefully you can read the models once this has been released.

cdiener commented 9 months ago

Should work now after updating COBRAPY to 0.27.0.