How to write a dope score for selected region of optimized atoms along with whole model?
Dear All,
I have tried generate a models for single point mutation along with own optimization and refinement criteria on the selected region of atoms around the mutated residue which works fine but the problem is in dope score.
I thing modeler generate DOPE score only for selected region of optimized atoms but I want to write the dope score for optimized region of atoms along with whole structure. Is it possible to do the same?
Here is my script used for select part of region from model and perform optimization:
class MyModel(automodel): def select_atoms(self): s = selection(self.atoms['CA:'+"275"+':'+"A"].select_sphere(5)).by_residue() self.restraints.unpick_all() self.restraints.pick(s) s.energy() s.randomize_xyz(deviation=4) return s
def optimize(s, sched): for step in sched: step.optimize(s, max_iterations=200, min_atom_shift=0.001) refine(s) cg = conjugate_gradients() cg.optimize(s, max_iterations=200, min_atom_shift=0.001)
def refine(self,s,actions): md = molecular_dynamics(cap_atom_shift=0.39, md_time_step=4.0, md_return='FINAL') init_vel = True for (its, equil, temps) in ((200, 20, (150.0, 250.0, 400.0, 700.0, 1000.0)), (200, 600, (1000.0, 800.0, 600.0, 500.0, 400.0, 300.0))): for temp in temps: md.optimize(s, init_velocities=init_vel, temperature=temp, max_iterations=its, equilibrate=equil) init_vel = False
Thanking you in advance
With Regards Mahesh V
On 7/20/16 2:01 PM, Mahesh Velusamy wrote: > I thing modeler generate DOPE score only for selected region of optimized > atoms but I want to write the dope score for optimized region of atoms > along with whole structure. Is it possible to do the same?
Sure, it is really easy to write your own assessment method. I assume you're instantiating your MyModel class with something like
a = MyModel(..., assess_methods=assess.DOPE)
assess.DOPE is a simple Python function, defined in modlib/modeller/automodel/assess.py:
def DOPE(atmsel): """Returns the DOPE score of the given model.""" return ('DOPE score', atmsel.assess_dope())
i.e. given the partial-model selection (atmsel) return the name of the score and its value. It's easy to write your own function that does something different, e.g.
def my_all_model_dope(atmsel): # get model m = atmsel.get_model() # select all atoms in model s = selection(m) # return all-model score return ('my score', s.assess_dope())
then instantiate your class with
a = MyModel(..., assess_methods=(assess.DOPE, my_all_model_dope))
to get both scores.
Alternatively, you can do whatever analysis you like (including calculating scores, of course) in automodel.user_after_single_model(), a method which gets called for each generated model: https://salilab.org/modeller/9.17/manual/node74.html
Ben Webb, Modeller Caretaker
participants (2)
-
Mahesh Velusamy
-
Modeller Caretaker