Skip to content

Can't pickle local object 'calcInteractionsMultipleFrames.<locals>.analyseFrame' #2192

@houyaxuan634-coder

Description

@houyaxuan634-coder

I am trying to use insty in Prody 2.6.1
I provide an ensemble pdb file with 40 structures (with hydrogens)
the command is
calcHydrogenBondsTrajectory(atoms)
I get the following error

AttributeError Traceback (most recent call last)
Cell In[6], line 1
----> 1 calcHydrogenBondsTrajectory(atoms)

File ~\anaconda3\envs\prody_env\Lib\site-packages\prody\proteins\interactions.py:1929, in calcHydrogenBondsTrajectory(atoms, trajectory, **kwargs)
1887 def calcHydrogenBondsTrajectory(atoms, trajectory=None, **kwargs):
1888 """Compute hydrogen bonds for DCD trajectory or multi-model PDB using default parameters.
1889
1890 :arg atoms: an Atomic object from which residues are selected
(...) 1926 If we want to study chain-chain interactions:
1927 selection='chain A', selection2='chain B' """
-> 1929 return calcInteractionsMultipleFrames(atoms, 'HBs', trajectory, **kwargs)

File ~\anaconda3\envs\prody_env\Lib\site-packages\prody\proteins\interactions.py:1817, in calcInteractionsMultipleFrames(atoms, interaction_type, trajectory, **kwargs)
1815 for _ in range(max_proc):
1816 p = mp.Process(target=analyseFrame, args=(i, interactions_all))
-> 1817 p.start()
1818 processes.append(p)
1820 i += 1

File ~\anaconda3\envs\prody_env\Lib\multiprocessing\process.py:121, in BaseProcess.start(self)
118 assert not _current_process._config.get('daemon'),
119 'daemonic processes are not allowed to have children'
120 _cleanup()
--> 121 self._popen = self._Popen(self)
122 self._sentinel = self._popen.sentinel
123 # Avoid a refcycle if the target function holds an indirect
124 # reference to the process object (see bpo-30775)

File ~\anaconda3\envs\prody_env\Lib\multiprocessing\context.py:224, in Process._Popen(process_obj)
222 @staticmethod
223 def _Popen(process_obj):
--> 224 return _default_context.get_context().Process._Popen(process_obj)

File ~\anaconda3\envs\prody_env\Lib\multiprocessing\context.py:336, in SpawnProcess._Popen(process_obj)
333 @staticmethod
334 def _Popen(process_obj):
335 from .popen_spawn_win32 import Popen
--> 336 return Popen(process_obj)

File ~\anaconda3\envs\prody_env\Lib\multiprocessing\popen_spawn_win32.py:95, in Popen.init(self, process_obj)
93 try:
94 reduction.dump(prep_data, to_child)
---> 95 reduction.dump(process_obj, to_child)
96 finally:
97 set_spawning_popen(None)

File ~\anaconda3\envs\prody_env\Lib\multiprocessing\reduction.py:60, in dump(obj, file, protocol)
58 def dump(obj, file, protocol=None):
59 '''Replacement for pickle.dump() using ForkingPickler.'''
---> 60 ForkingPickler(file, protocol).dump(obj)

AttributeError: Can't pickle local object 'calcInteractionsMultipleFrames..analyseFrame'

can you please help?
Luke

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions