[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [modeller_usage] How to write a dope score for selected region of optimized atoms along with whole model?



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
--
             https://salilab.org/modeller/
Modeller mail list: https://salilab.org/mailman/listinfo/modeller_usage