Generating Atom Pair Constraints

Member Site Forums PyRosetta PyRosetta – General Generating Atom Pair Constraints

Viewing 1 reply thread
  • Author
    Posts
    • #3529
      Anonymous

        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

      • #15432
        Anonymous

          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.

          • #15433
            Anonymous

              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.

            • #15434
              Anonymous

                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. 

          Viewing 1 reply thread
          • You must be logged in to reply to this topic.