# PyRosetta FastDesign

10 posts / 0 new
PyRosetta FastDesign
#1

Dear Community,

I have been trying to implement FastDesign in PyRosetta. This is my code so far, I could not find documentation or examples to help me get the code running:

x = FastDesign()
x.apply(pose)

I get the folloing error:

Segmentation fault (core dumped)

I tried several settings, using MoveMap, set_enable_design(), set_to_default(), dry_run(), get_scorefxn(), get_input_pose(), I ended up doing things by trial and error, but still i get the same error output.

How do I overcome this error? What does my code need to correctly work?

----Update----

I have been talking to some Python developers and they tell me a Segmentation fault (core dumped) error indicates a problem with the actual C++ code rather than python itself. So is this is a bug within PyRosetta, or am I using the mover incorrectly?

Category:
Post Situation:
Tue, 2017-07-04 10:23
ac.research

First, I would ask why do you want to use FastDesign?  What paper are you referring to in order to use it?  Much of the ability to design during fast relax was incorporated into FastRelax itself.  Is this what you want to do, or do you need something specific from FastDesign?

What version of PyRosetta are you using to start?

Wed, 2017-07-05 11:50

Thanks for your replay. as i  understand FastDesign runs the following protcol: where the protein is designed, then fast relaxed with low fa_rep, then repeat increasing the fa_rep until its default value. That is what i am trying to do, and i thought that is what FastDesign does. correct me if i am wrong.

I am using latest PyRosetta (PyRosetta4.Release.python35.ubuntu/)

--update--

I am trying to run Fixed BackBone design (that is what i meant by protein design)

Wed, 2017-07-05 12:05
ac.research

So, you can do exactly that in FastRelax.  You would basically set a MoveMap that holds the BB fixed, but allows chi angles to move and pass in either your resfile or a TaskFactory.

mm = MoveMap()
mm.set_bb(False)
mm.set_chi(True)

rel = FastRelax()
rel.set_movemap( mm)

rel.apply( my_pose )

Wed, 2017-07-05 13:01
task = TaskFactory.create_packer_task(pose) #<--- TaskFactory is created just fine

mm = MoveMap()
mm.set_bb(False)
mm.set_chi(True)

rel = FastRelax(scorefxn)
rel.set_movemap(mm)
rel.apply(pose)

'''
Error:
TypeError: get_task_factory(): incompatible function arguments. The following argument types are supported:
'''

its doesn't seem to like the TaskFactory

Everything else works fine, you need to pass in a score funtion while calling the FastRelax() ---> rel = FastRelax(scorefxn) other wise it gives Segmentation fault (core dumped)

I do need the TaskFactory in order to control which residues to mutate, so how can i fix this?

Wed, 2017-07-05 13:21
ac.research

So, a PackerTask is different than a TaskFactory.  The job of the TaskFactory is to create a  PackerTask from its list of TaskOperations (hence the 'Factory' name).

You would create a TaskFactory, and then add TaskOperations to it.  If you need help with how to do this, let me know.  There is a 'ReadResFile' operation that may be of use to you.

You would then pass the TaskFactory directly.  The packertask will be generated by the internal FastRelax machinery every time packing occurs.  The benefit to this is that you can have TaskOperations that respond to the changing environment - such as packing neighbors (which may change as things are designed or the backbone is moved)

FastRelax does have a default constructor, so it's strange that it should require a scorefunction on construction in PyRosetta...

The alternative way to do all of this is to pass the options '-resfile my_resfile.txt' and '-respect_resfile' as command line options.  This will generate a TF in FastRelax that just reads the resfile and packs/designs accordingly (then no need to pass a TF).

from pyrosetta import *
from rosetta import *
init('-respect_resfile -resfile full_or_relative_path_to_my_resfile.txt')

Wed, 2017-07-05 14:30

Yes, I want to know how to do that please: (Create a TaskFactory, and then add TaskOperations to it, then pass the TaskFactory directly.) it would be prefereable to avoid making a resfile if possible.

---UPDATE---

wait i think i did it, is it this way?

task = TaskFactory()

.apply(pose)

Wed, 2017-07-05 14:58
ac.research

There should really be a PyRosetta tutorial for all of this, but alas... Ok, here goes.

First, you don't need to call create_packer_task.  The relax object will this itself.

Second, a vanilla TaskFactory won't do anything.  You'll need to load it with TaskOperations. Many common task ops are in:

and

#(Import Rosetta and initialize)

from rosetta.core.pack.task.operations import *
from rosetta.protocols.toolbox.task_operations import *

#Generate the TF

#Create a few TaskOps

restrict = RestrictToRepacking()
TF.push_back(restrict)

#->This would limit packing to only those that are specified in the resfile.

#You could also control residue-level design, packing, and what to design into through TaskOps.
Checkout the RestrictAbsentCanonicalAAS, InitializeFromCommandline (which will enable -ex1 and -ex2 options for extra rotamers that is typically passed ) and RestrictToRepacking operations.

Some of my favorites:
#RestrictToLoopsAndNeighbors
#RestrictResidueToRepacking
#ConservativeDesignOperation
#RestrictAbsentCanonicalAASRLT
#OperateOnCertainResidues
#NoRepackDisulfides
#OperateOnResidueSubset (which allows you to work with ResidueSelectors)
#DesignAroundOperation
#ResidueProbDesignOperation
#RestrictToMoveMapChiOperation
#SelectBySASAOperation



Sergey has fixed the API docs and added a sweet new search bar as I was having problems finding anything before.

Wed, 2017-07-05 16:10