Member Site › Forums › PyRosetta › PyRosetta – General › Generating Atom Pair Constraints
- This topic has 3 replies, 2 voices, and was last updated 4 years, 4 months ago by Anonymous.
-
AuthorPosts
-
-
August 5, 2020 at 10:39 pm #3529Anonymous
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
-
August 6, 2020 at 9:47 am #15432Anonymous
I assume the last line is something like:
stm = pyrosetta.rosetta.core.scoring.ScoreTypeManager()
atom_pair_constraint = stm.score_type_from_name("atom_pair_constraint")
scorefxn.set_weight(atom_pair_constraint, 1.0)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.
-
August 6, 2020 at 6:13 pm #15433Anonymous
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.
-
August 6, 2020 at 6:48 pm #15434Anonymous
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.
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.