Dear All,
I am new to PyRosetta and I am trying to calculate the ddG after point-mutation. The calculation logic is like the following:
1) clean the pdb file and use cartesian relax to minimize its energy
2) perform the point mutation with mutate_residue() function
3) calculate the score before and after the mutation to gain the ddG
However, the ddG data I got was always positive values and have large differences from the benchmark.
Can someone give me some help? Which part of my code is wrong? Thank you guys so much for your input and suggestions!!
from pyrosetta import *
from pyrosetta.rosetta import *
from pyrosetta.toolbox import *
init("-ignore_unrecognized_res 1 -ex1 -ex2 -flip_HNQ -relax:cartesian -nstruct 200 -crystal_refine -optimization:default_max_cycles 200")
testPose= Pose()
testPose = pose_from_pdb("1BNI.clean.pdb")
from pyrosetta.rosetta.protocols.relax import FastRelax
scorefxn = pyrosetta.create_score_function("ref2015_cart")
relax = pyrosetta.rosetta.protocols.relax.FastRelax()
relax.constrain_relax_to_start_coords(True)
relax.coord_constrain_sidechains(True)
relax.ramp_down_constraints(False)
relax.cartesian(True)
#relax.min_type("dfpmin_armijo_nonmonotone")
relax.min_type("lbfgs_armijo_nonmonotone")#for non-Cartesian scorefunctions use'dfpmin_armijo_nonmonotone'
relax.set_scorefxn(scorefxn)
s0=scorefxn(testPose)
relax.apply(testPose)
s1=scorefxn(testPose)
testPose.dump_pdb('1BNI.relax.pdb')
AA=['G','A','L','M','F','W','K','Q','E','S','P','V','I','C','Y','H','R','N','D','T']
ddG=[]
mp=Pose()
for i in AA:
mp.assign(testPose)
mutate_residue(mp,52,i)
s2=scorefxn(mp)
dg=s2-s1
ddG.append(dg)
print(ddG)
Best regards
Category:
Post Situation:
Hi,
I would relax or minimise after the mutation. Not sure `mutate_residue` does this allready. I would have a flexible backbone around the mutation (i.e. 8 Angs), but keep everything else fixed.
Here is one implementation of ddg https://github.com/Kortemme-Lab/ddg
And another: https://www.rosettacommons.org/docs/latest/cartesian-ddG
And the newest one in the rosetta_scripts directory (not sure it's been released yet):
rosetta_scripts_scripts/scripts/public/stabilize_proteins_pm_mc/
Best,
Ajasja
PS: also what's the diffrence between s0 and s1? Does relax take into account the coord constraints? I would use two diffrent scoring functions one for relax and one for scoring, so there would be no doubt if constraints are on.
Hi Ajasja,
Thank you so so much for your kindly reply. First of all, I would like to say sorry that I am new to both Rosetta and PyRosetta so you may find my questions are a bit silly. I checked the reference you sent to me but seems that both of them are only suitable for Rosetta, while I want to do the job in PyRosetta.
Regarding the questions in your PS section. I found that the energy before and after the relax was different. s0 is a positive number while s1 is a negative number. I don't know whether in my python code the relax takes into account the coord constraints, but according to the official tutorial the command "relax.constrain_relax_to_start_coords(True)" helps me do it? Also, may I ask you what do you mean by "using two different scoring functions?", do you mean that I can set up a scorefxn1="ref2015_cart" for cartesian_relax, while setting up another scorefxn2='ref2015' for the scoring calculation?
For your suggestion, May I ask how you keep everything else fixed while having a flexible backbone around the mutation? Do I have to do the minimization for the mutated pose? The "mutate_residue()" function is attached below, does the "Packer" help me do the job already?
Really sorry to bother you again and again, looking forward to hearing from you!
Best,
Kai San