-
|
I've recently installed pyrosetta in my conda environment using these commands (from here): pip install pyrosetta-installer
python -c 'import pyrosetta_installer; pyrosetta_installer.install_pyrosetta()'Now I want to read a silent file and I'm using the following code: from pyrosetta import *
from pyrosetta.distributed import io
init()
file_name = 'pep-119-0'
# initialize dataframe
df = pd.DataFrame(columns=['tag','score_before_relax','score_after_relax'])
# initialize score function
score_function = get_fa_scorefxn()
# initialize relax mover
fast_relax_mover = rosetta.protocols.relax.FastRelax()
fast_relax_mover.set_scorefxn(score_function)
# load structures from silent file
silent_file_path = f'outputs/{file_name}.silent'
silent_data = rosetta.core.import_pose.pose_stream.SilentFilePoseInputStream(silent_file_path)
# loop throgh structures
while silent_data.has_another_pose():
pose = Pose()
silent_data.fill_pose(pose)
packed_pose = io.to_packed(pose)
packed_pose_data = io.to_dict(packed_pose)but I get this error: Traceback (most recent call last):
File "relax_silent.py", line 25, in <module>
packed_pose = io.to_packed(pose)
^^^^^^^^^^^^^^^^^^
File ".conda/envs/myenv/lib/python3.11/functools.py", line 909, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".conda/envs/myenv/lib/python3.11/site-packages/pyrosetta/distributed/packed_pose/core.py", line 83, in to_packed
return PackedPose(pose_or_pack)
^^^^^^^^^^^^^^^^^^^^^^^^
File ".conda/envs/myenv/lib/python3.11/site-packages/pyrosetta/distributed/packed_pose/core.py", line 41, in __init__
self.pickled_pose = pickle.dumps(pose_or_pack)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".conda/envs/myenv/lib/python3.11/site-packages/pyrosetta/bindings/pose.py", line 71, in __pose_getstate__
return __cereal_getstate__(pose)
^^^^^^^^^^^^^^^^^^^^^^^^^
File ".conda/envs/myenv/lib/python3.11/site-packages/pyrosetta/distributed/__init__.py", line 63, in fwrap
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File ".conda/envs/myenv/lib/python3.11/site-packages/pyrosetta/distributed/utility/pickle.py", line 36, in __cereal_getstate__
raise NotImplementedError(
NotImplementedError: __cereal_getstate__ requires pyrosetta '--serialization' build.
srun: error: n0135: task 0: Exited with exit code 1Someone in slack had mentioned this is because of not using conda build, but I'm already using it in conda environment. I appreciate any help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
@NooraAz you will probably want to supply |
Beta Was this translation helpful? Give feedback.
-
|
Also, if you already using Conda then easiest way to get PyRosetta would be by using our native Conda package, please see instructions here: https://www.pyrosetta.org/downloads#h.c0px19b8kvuw |
Beta Was this translation helpful? Give feedback.
@NooraAz you will probably want to supply
distributed=Trueor at leastserialization=Truewhen callinginstall_pyrosettafunction. Please see more options here: https://pypi.org/project/pyrosetta-installer/