# Score Function with Constraints

7 posts / 0 new
Score Function with Constraints
#1

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?)

Category:
Post Situation:
Fri, 2017-07-28 06:41
ac.research

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

Tue, 2017-08-01 12:24
SenyorDrew

Thank you very much Andrew

Thu, 2017-08-03 03:06
ac.research

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.

Thu, 2017-08-03 09:32
rmoretti

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 ?

Sat, 2017-08-05 09:18
ac.research

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')

Mon, 2017-08-14 08:26
rmoretti
Sat, 2017-12-09 02:15
ac.research