You are here

Generating Atom Pair Constraints

4 posts / 0 new
Last post
Generating Atom Pair Constraints
#1

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: 
Wed, 2020-08-05 15:39
Peik

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.

Thu, 2020-08-06 02:47
matteoferla

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.

Thu, 2020-08-06 11:13
Peik

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. 

Thu, 2020-08-06 11:48
Peik