Member Site › Forums › PyRosetta › PyRosetta – General › Reading poses from silent file that need a params file
- This topic has 2 replies, 2 voices, and was last updated 6 years, 4 months ago by Anonymous.
-
AuthorPosts
-
-
August 13, 2018 at 7:25 pm #2986Anonymous
Hello everyone,
I am trying to read a silent file with the function poses_from_silent(), but I get an error about an unrecognized residue:
for pose in poses_from_silent(silentFile):
pose
core.io.silent.SilentFileData: Reading all structures from silent.out
core.io.silent.SilentFileData: Finished reading X structures from silent.out
$HOME/miniconda2/lib/python2.7/site-packages/pyrosetta-2018.31+release.231d1f3-py2.7-linux-x86_64.egg/pyrosetta/io/__init__.pyc in poses_from_silent(silent_filename)
66 ss = sfd.get_structure(tag)
67 pose = Pose()
---> 68 ss.fill_pose(pose)
69 yield pose
RuntimeError:
File: /home/benchmark/T/rosetta.Glass/_commits_/main/source/src/core/pose/annotated_sequence.cc:191
[ ERROR ] UtilityExitException
ERROR: can't find residue type for XX at pos XXX in sequence M[MET:NtermProteinFull]...However, when I am working with a single pdb file there is no problem to do this; I am currently loading the params file, for a single pdb, with the function pose_from_file() as follows:
pose = Pose()
generate_nonstandard_residue_set(pose,paramsFile)
pose_from_file(pose, pdbFile)which loads correctly the params file into a new pose object and then it is passed to the pose_from_file() function.
Is there an analog way for loading the params file as to be read by the poses_from_silent() function?
-
August 24, 2018 at 6:22 pm #14406Anonymous
You can take a look at the implementation of poses_from_silent() to see how it works:
def poses_from_silent(silent_filename):
sfd = rosetta.core.io.silent.SilentFileData(rosetta.core.io.silent.SilentFileOptions())
sfd.read_file(silent_filename)
for tag in sfd.tags():
ss = sfd.get_structure(tag)
pose = Pose()
ss.fill_pose(pose)
yield posThe ss.fill_pose() will obey a set non-standard residue set just like pose_from_file() will. You would just need to implement your own version oof poses_from_silent which loads your params files for each pose you’re creating.
The other alternative is to add the params files to the global residue type set. This can be done by passing them in during PyRosetta initialization with the -extra_res_fa option. (http://www.pyrosetta.org/faq#TOC-1.-How-do-I-interact-with-the-Rosetta-Options-system-using-PyRosetta-) — The drawback of this way is that you’d add the ligand for the entire run, and not just the loaded structures.
-
August 27, 2018 at 5:50 pm #14410Anonymous
Thank you very much Rocco for your answer, very helpfull as always!
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.