I am using pyRosetta and am trying to add my own custom scoring method into an energy function and then use that energy function in a refinement. When I run refinement with a scoring function that has only my custom scoring method both the "MinMover" and "PackRotamersMover" do not minimise or at all change the pose. Why is this? Have I done something wrong in writing up my custom scoring method? I have attached an example of the energy method I am trying to define as well as the refinement file (which is based on the pyRosetta demo file) I have been using.
Thanks in advance.
This is an example code of how I defined my custom energy method:
import rosetta.core.scoring.methods as methods
def finalize_total_energy(self, pose, efunc, emap):
#Calculate what score should be. Below is just demo scoring method that should force the protein to crunch at position 0,0,0.
score = 0
for i in range (1, pose.total_residue()):
pos = pose.residue(i).xyz('CA')
score += abs(pos) + abs(pos) + abs(pos)