mjenior / riptide

Reaction Inclusion by Parsimony and Transcript Distribution
MIT License
11 stars 3 forks source link

rv = reductor(4) TypeError: can't pickle SwigPyObject objects #4

Closed aschluter closed 1 year ago

aschluter commented 2 years ago

Hi,

when I try the last Human-GEM model I got an error in the deepcopy process. Thanks in advance.

model = cobra.io.read_sbml_model("Human-GEM_30112021.xml") modelRiptide = riptide.contextualize(model) WARNING: No transcriptome provided. Analyzing most parsimonious state

Initializing model and integrating transcriptomic data... Traceback (most recent call last): File "", line 1, in File "/home/agatha/python-virtual-environments/env/lib/python3.6/site-packages/riptide/riptide.py", line 612, in contextualize riptide_model = copy.deepcopy(model) File "/usr/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/usr/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/usr/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib/python3.6/copy.py", line 169, in deepcopy rv = reductor(4) TypeError: can't pickle SwigPyObject objects

mjenior commented 2 years ago

This issue sometimes comes up when some of the python 3.6 dependencies aren't up to date. I haven't fully narrowed down which packages it is yet, but if you update python it usually resolves it. I'll get back to you after I do a little more testing and isolate the solution.

mjenior commented 1 year ago

This turns out to be an issue with an incompatibility with pickling particular objects within the DictList cobrapy data structure. This becomes problematic when trying to parallelize growth simulations. The latest version of ritpide should fix this issue.