Member Site › Forums › PyRosetta › PyRosetta – General › Score Function with Constraints
- This topic has 6 replies, 3 voices, and was last updated 7 years, 1 month ago by Anonymous.
-
AuthorPosts
-
-
July 28, 2017 at 1:41 pm #2806Anonymous
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?)
-
August 1, 2017 at 7:24 pm #13637Anonymous
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
-
August 3, 2017 at 10:06 am #13639Anonymous
Thank you very much Andrew
-
August 3, 2017 at 4:32 pm #13644Anonymous
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.
-
August 5, 2017 at 4:18 pm #13648Anonymous
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 ?
-
August 14, 2017 at 3:26 pm #13657Anonymous
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')
-
-
December 9, 2017 at 10:15 am #13945Anonymous
–
-
-
AuthorPosts
- You must be logged in to reply to this topic.