You are here

Difference between GenericMonteCarloMover() and GenericSimulatedAnnealer()

5 posts / 0 new
Last post
Difference between GenericMonteCarloMover() and GenericSimulatedAnnealer()
#1

Hello Everyone,

I am trying to preform RosettaDesign using thr FastRelax() mover. As I understand this is the correct mover? or should i be using FastDesign()?

Anyway, What is the difference between the GenericMonteCarloMover() and the GenericSimulatedAnnealer() movers? and which one should I be using with FastRelax() to preform correct RosettaDesign?

I tried both, but both fail to change the structure's sequence. Here is my code:

pose = pose_from_pdb('1.pdb')
scorefxn = get_fa_scorefxn()
filters = pyrosetta.rosetta.protocols.simple_filters.PackStatFilter()
read = pyrosetta.rosetta.core.pack.task.operation.ReadResfile('Resfile.resfile')
task = pyrosetta.rosetta.core.pack.task.TaskFactory()
task.push_back(read)
movemap = MoveMap()
movemap.set_bb(False)
movemap.set_chi(True)
mover = pyrosetta.rosetta.protocols.relax.FastRelax()
mover.set_task_factory(task)
mover.set_movemap(movemap)
mover.set_scorefxn(scorefxn)

MC = pyrosetta.rosetta.protocols.monte_carlo.GenericMonteCarloMover()
MC.set_sampletype('low')
MC.set_drift(True)
MC.set_preapply(False)
MC.set_scorefxn(scorefxn)
MC.set_maxtrials(1)
MC.set_temperature(1.5)
MC.task_factory(task)
MC.set_mover(mover)
MC.set_recover_low(True)
MC.set_recover_low(True)
MC.set_boltz_rank(True)
MC.add_filter(filters , False , 0.005 , 'low'  , True )
#MC.apply(pose)

SA = pyrosetta.rosetta.protocols.monte_carlo.GenericSimulatedAnnealer()
SA.set_scorefxn(scorefxn)
SA.set_mover(mover)
SA.set_maxtrials(1)
SA.set_preapply(False)
SA.set_drift(True)
SA.set_sampletype('low')
SA.set_temperature(1.5)
SA.set_recover_low(True)
SA.set_boltz_rank(True)
SA.add_filter(filters , False , 0.005 , 'low'  , True )
#SA.apply(pose)


And here is my output for GenericMonteCarloMover()

protocols.monte_carlo.GenericMonteCarloMover: MC stopping condition met at trial 1 because maximum number of accepted moves was achieved
protocols.monte_carlo.GenericMonteCarloMover: Lower score sampled: trial=    0, score(current/last_accepted/best)=    0.000/  138.254/  138.254
protocols.monte_carlo.GenericMonteCarloMover: mover=       FastRelax Score_eval=                 trials=      0 NO ACCEPTS.
protocols.monte_carlo.GenericMonteCarloMover: Number of rejections per filter: 0   
protocols.monte_carlo.GenericMonteCarloMover: Finished MC. Out of 55 0 accepted  and 0 rejected.

 

And here is my output for GenericSimulatedAnnealer()

protocols.simple_moves.GenericSimulatedAnnealer: accepted_scores_= 0 123.518 0.617592 
protocols.simple_moves.GenericSimulatedAnnealer:  1 123.518 0.617592 
protocols.simple_moves.GenericSimulatedAnnealer: Not scaling temperatures. Going to step 2 at anneal_step 0
protocols.simple_moves.GenericSimulatedAnnealer: Lower score sampled: trial=    1, score(current/last_accepted/best)=    0.000/  123.518/  123.518
protocols.simple_moves.GenericSimulatedAnnealer: mover=FastRelax        Score_eval=                 trials=     1;  accepts=  1.000;  energy_gap/trial=    0.000
protocols.simple_moves.GenericSimulatedAnnealer: Number of rejections per filter: 0   
protocols.simple_moves.GenericSimulatedAnnealer: Finished MC. Out of 1, 1 accepted  and 0 rejected.

 

I tried different temperatures, different maxtrials, changed different True and False, and I get no error messages, but the movers are not changing the structure sequences, not sure if they are printint that they accepted a move but then do not update the pose, or if they are unable to use the mover. I tested the FastRelax() mover on its own and it works perfectly. So I am not sure what I am doing wrong.

Any help will be greatly appriciated.

Category: 
Post Situation: 
Fri, 2018-05-11 10:37
ac.research

If you want flexible backbone design, use the FastDesign mover.  It's extremely similar to FastRelax, with a few tiny tweaks.

If you want fixed backbone design - your movemap indicates this - just use the PackRotamersMover.  It will be thousands of times faster for the same effect.  It's also what's usually meant by "RosettaDesign".

You do not need to handle Monte Carlo yourself - it is handled inside FastDesign and PackRotamersMover.  Just run it N times (depending on system size and computer power available) and sort/rank the results.  (No need for more than 100 or so if PackRotamers).

I don't know, having not looked into them, but I assume the difference between GMC and GSA is whether the temperature is constant (MC) or scheduled (SA).

Fri, 2018-05-11 10:57
smlewis

Thank you very much, this actually solves my issue and I changed my script.

I wil benchmark my script: I will preform the design on 3 different structures then simulate their folding with Abinitio to see if I get a funnel.

But the reason I was "painfully" using the GenericMonteCarloMover() was because I was trying to preform RosettaDesign while also pushing the design towards a tightly packed core to prevent core voids, thus I was using the PackStatFilter() as a filter in the MC mover.

Would I still need call in the PackStatFilter() somehow with fixbb (PackRotamersMover) and flxbb (FastDesign)? or do they themselves account for core packing?

Fri, 2018-05-11 14:16
ac.research

The scorefunction will favor well packed things over poorly packed things.  A filter on packstat is basically nudging the result population towards avoiding voids over other considerations.  Since it's a filter, not a scorefunction term, it just happens after the fact.  

You should be able to run PackRotamers in a GenericMonteCarlo context if you want it to also filter on packstat.  I've never used GenericMonteCarlo and was trying to caution you away from a giant solution to a small problem; if you want the filtering embedded in this way then you are going about it in approximately the right way.  I can't finesse the details here: you should re-frame the problem in a new thread if you can't get GenericMonteCarlo working.  

Fri, 2018-05-11 15:29
smlewis

I understand, thank you very much.

I will benchmark my script and hopefully I won't need to use the filter nor the GenericMonteCarloMover().

Fri, 2018-05-11 15:46
ac.research