Score Function with Constraints

Member Site Forums PyRosetta PyRosetta – General Score Function with Constraints

Viewing 4 reply threads
  • Author
    Posts
    • #2806
      Anonymous

        Dear All,

         

        I am trying to use the BluePrintBDR() for De Novo Design. I am trying to use with it a constraints file to guide the desin towards a certain topology. This is my code so far:


        mover = pyrosetta.rosetta.protocols.fldsgn.BluePrintBDR()
        mover.num_fragpick(200)
        mover.use_abego_bias(True)
        mover.use_sequence_bias(False)
        mover.max_linear_chainbreak(0.07)
        mover.ss_from_blueprint(True)
        mover.dump_pdb_when_fail('')
        mover.set_constraints_NtoC(-1.0)
        mover.set_blueprint('blueprint')
        mover.set_constraint_file('structure.cst') #<
        Added Constraints here
        #mover.scorefunction(?????) #<
        Score Function with constraints add here?
        mover.apply(pose)
        pose.dump_pdb('DeNovo.pdb')

         

        It seems the default score function is REF2015 that does not have contraint weights. How can I add constraints to the score function so the mover can penalise atom pairs that do not satisfy the constraints? (it my explanation clear?)

      • #13637
        Anonymous

          Full disclosure, I’m not a pyrosetta expert but here’s how I add constraints to a score function.  You have to set the weight of the relevant constraint score term to be > 0.

          Here’s an example using the atom_pair_constraint term (this may or may not be applicable to what you’re trying to do, but there are other constraint terms such as coordinate_constraint, etc).

          ========

          import pyrosetta

          scorefxn = pyrosetta.create_score_function(“talaris2014”)

          score_manager = pyrosetta.rosetta.core.scoring.ScoreTypeManager()

          score_term = score_manager.score_type_from_name(“atom_pair_constraint”)

          scorefxn.set_weight(score_term, 1.0)

          ========

           

          I’ve never used blueprints, so I can’t comment on that, but hopefully this answers the question of how to enable constraints in a scoring function.

          – Andrew

           

        • #13639
          Anonymous

            Thank you very much Andrew

          • #13644
            Anonymous

              Andrew’s solution is a general purpose one, but something to be aware of is that there is a version of ref2015 (called, unsurprisingly “ref2015_cst”) which has all of the standard constraint terms turned on.

              Setting them individually gives you more control, but if you want a simple “ref2015 with constraints”, it should work.

              • #13648
                Anonymous

                  well, i did find the ref2015_cst but i do not know how to call it?

                   

                  just simply change this to the script on top?


                  mover.scorefunction('ref2015_cst')
                  mover.set_constraint_file('structure.cst')

                  Would this work ?

                • #13657
                  Anonymous

                    No, the ‘ref2015_cst’ is the filename of the weights file in the database, not a scorefunction object itself. What you would want to do is call the function to create the scorefunction with that name: 


                    sfxn = pyrosetta.create_score_function('ref2015_cst')

                     

                • #13945
                  Anonymous

                Viewing 4 reply threads
                • You must be logged in to reply to this topic.