You are here

problems with low-resolution loop refinemet (LoopMover_Perturb_CCD)

10 posts / 0 new
Last post
problems with low-resolution loop refinemet (LoopMover_Perturb_CCD)
#1

Hi,

I am trying to replicate some of the examples of the PyRosetta manual and tutorial. I have several problems with the LoopMover_Perturb_CCD. See the code below

1) I am getting the same conformation 10 times (instead of 10 different conformations). Conformations looks the same and have the same energy. Is LoopMover_Perturb_CCD not properly working in PyRosetta or what I am doing wrong?
2) The two commented lines do not work. When uncommented I get the "object has no attribute" message. PyRosetta manual indicates that "randomize_loop(True)" option exist (the other one, I just trying to guess the correct option). How do I get which options are available for a specific function?
3) When applying "switch_to_standard.apply(pose)" I get sidechains with a lots of bumps. I guess I need to minimize the conformations after switching from centroid. I have to use add a minimizer mover or there is and option in LoopMover_Perturb_CCD to minimize and/or recover sidechains properly?

Thanks in advance.

from rosetta import *
rosetta.init()

pose = pose_from_pdb('test.pdb')
scorefxn_std = create_score_function('standard')
scorefxn_low = create_score_function_ws_patch('cen_std', 'score4L')

frag_set = ConstantLengthFragSet(3, 'frag_test')

switch_to_centroid = SwitchResidueTypeSetMover('centroid')
switch_to_standard = SwitchResidueTypeSetMover('fa_standard')

loop_A = Loop(20,30, 25)
sample_loops = Loops()
sample_loops.add_loop(loop_A)

loop_perturb = LoopMover_Perturb_CCD(sample_loops, scorefxn_low, frag_set)
#loop_perturb.randomize_loop(True)
#loop_perturb.set_extended(True)

for ite in range(0, 10):
switch_to_centroid.apply(pose)
loop_perturb.apply(pose)
switch_to_standard.apply(pose)
pose.dump_pdb('test_%03d.pdb' % ite)
Post Situation: 
Thu, 2012-07-26 06:51
aloctavodia

"3) When applying "switch_to_standard.apply(pose)" I get sidechains with a lots of bumps. I guess I need to minimize the conformations after switching from centroid. I have to use add a minimizer mover or there is and option in LoopMover_Perturb_CCD to minimize and/or recover sidechains properly?"

You are correct; using SwitchResidueTypeSetMover in this fashion leaves garbage rotamers (it just threads default rotamers without packing). I can offer three ideas in decreasing order of quality:
1) look for ReturnSidechainsMover, which is meant for just this purpose. It stores the fullatom sidechains before you use switch_to_centroid and can return them after. After returning them, you still need to pack the loop residues with PackRotamersMover (don't forget a TaskFactory/PackerTask that says to repack only; and perhaps only the loop region using neighbor detection like RestrictToNeighborhoodOperation).
2) repack the whole pose after switch_to_standard (again, don't forget to say repack only)
3) I think SwitchResidueTypeSetMover may have a boolean for repacking if moving to fullatom

"2) The two commented lines do not work. When uncommented I get the "object has no attribute" message. PyRosetta manual indicates that "randomize_loop(True)" option exist (the other one, I just trying to guess the correct option). How do I get which options are available for a specific function?"

Sadly, the best thing is to go read the underlying C++. The next best thing is to try python's online help function - I think it's ?LoopMover_Perturb_CCD or similar? I can tell you what the C++ says exists, but since I don't know what code your python install is built from, it won't be any more accurate than the manual.

"1) I am getting the same conformation 10 times (instead of 10 different conformations). Conformations looks the same and have the same energy. Is LoopMover_Perturb_CCD not properly working in PyRosetta or what I am doing wrong?"
Hm, this is a strange one. Your loop is at least somewhat flawed in that you never reset your pose variable, meaning that it accumulates state. The second run starts from the result of the first run, rather than from the starting point. It is remotely possible that Monte Carlo is finding a great structure on run 1 and refusing to alter it later (unlikely).

Is it moving the loop *at all* compared to the starting structure?

Thu, 2012-07-26 17:27
smlewis

Hi smlewis,

I will explore your solutions, thanks very much.
About your question, the 10 conformations are exactly the same (rmsd=0 and the same energy).

Fri, 2012-07-27 09:35
aloctavodia

"About your question, the 10 conformations are exactly the same (rmsd=0 and the same energy)."

I understand that they are identical to each other - but how do they compare to the input structure (test.pdb)? The question is, is loopmover doing one thing and nothing more, or nothing at all?

Fri, 2012-07-27 09:39
smlewis

Sorry, for my confusion.
The backbone coordinates are the same as the starting structure. The sidechains of all residues are changed even those outside the loop (as we already discuss this is a result of the switching between centroid and standard representation.

Fri, 2012-07-27 16:25
aloctavodia

Are you getting any sort of logging output that is indicating failed filters or failed loop closure or anything like that?

Fri, 2012-07-27 19:39
smlewis

I get a WARNING because the input pdb does not have a "OXT" atom. But I think is not related. Attached you will find all the output I get (I don´t know if the verbosity can be increased).

Fri, 2012-07-27 20:08
aloctavodia

it looks like it tried only 0 attempts at loop modeling. Look for a setter function for number of cycles? I'm Answering from my phone and don't have a code base to look at.

Fri, 2012-07-27 21:15
smlewis

I found a "set_build_attempts_()" function, that takes one integer as argument. PyRosetta understand this function as valid, but it seems to have no effect.

I have decided to implement the LoopMover_Perturb_CCD mover from scratch (following the guidelines in http://graylab.jhu.edu/pyrosetta/downloads/scripts/D080_Loop_modeling.py). Now the loop is moving as expected.

Thanks very much for you help.

Sat, 2012-07-28 10:26
aloctavodia

Hey. Both LoopMover_Perturb_CCD and LoopMover_Perturb_KIC require you to set your pose with a foldtree, describing the loop. If you look at step 4 in the script it describes how to set it. Also, there should be a better explanation of it on the tutorial page.

Some tips:
Create the fold_tree from your pose. Create an empty foldtree.
ft = pose.fold_tree(); ft_o = FoldTree()

Edit the empty foldtree to specify your loops as in the script/tutorial.
Check to make sure everything is kosher.
print "Fold Tree Correct? " + repr(ft_o.check_fold_tree())

Assign the new foldtree
pose.fold_tree(ft_o)

At the end, assign back the foldtree from the beginning, so you can do other things with the pose.
pose.fold_tree(ft)

Hope that helps

Fri, 2012-08-03 11:49
jadolfbr