Hi,
I'm trying to mutate and minimize a complex with atom pair constraints applied to the residues around the mutated position, but the constraints do not seem to be getting applied to my pose. This is what I have:
def constrain(pose, posi):
constraint = AtomPairConstraintGenerator()
mut_posi = pyrosetta.rosetta.core.select.residue_selector.ResidueIndexSelector()
mut_posi.set_index(str(posi))
nbr_selector = pyrosetta.rosetta.core.select.residue_selector.NeighborhoodResidueSelector()
nbr_selector.set_focus_selector(mut_posi)
nbr_selector.set_include_focus_in_subset(True)
constraint.set_residue_selector(nbr_selector)
constraint.set_ca_only(True)
constraint.set_use_harmonic_function(True)
constraint.set_max_distance(5.0)
constraint.set_sd(0.5)
constraint.set_weight(1.0)
add_csts = AddConstraints()
add_csts.add_generator(constraint)
add_csts.apply(pose)
sfxn = get_fa_scorefxn()
sfxn.set_weight(atom_pair_constraint, 1.0)
When I use this function on my pose and then use the function sfxn.show(pose), the atom_pair_constraint category always has a score of 0. What am I doing wrong here?
Thanks
-Peik
Category:
Post Situation:
I assume the last line is something like:
Which is all correct. And should be show 1 regardless of whether the constraint is actually set correct or set at all.
So is the scorefunction instance the same? Different calls to get_fa_scorefxn give different instances.
Thank you for the response. What do you mean by scorefunction instance? If it's what you're asking, I don't call get_fa_scorefxn again.
I figured it out! Thanks again for your response. I used backrub on my pose and it seems that it just took more perturbation than I thought to change the atom_pair_constraint energy.