Member Site › Forums › PyRosetta › PyRosetta – General › set constraints › Reply To: set constraints
I’m not sure how to do this automatically, but I started to do it for disulfides using this code:
sulfidefour = AtomID(4, 4)
sulfidesix = AtomID(4, 6)
sulfidefifte= AtomID(4, 15)
sulfide_23 = AtomID(4, 23)
sulfide_25 = AtomID(4, 25)
sulfide_36 = AtomID(4, 36)
standard=create_score_function_ws_patch(‘standard’, ‘score12’)
#No
currectdisulfide=True
def disulfidecheck():
correctdisulfide=True
if disulfides != 0:
print pose.xyz(sulfidefour)
print pose.xyz(sulfidesix)
print pose.xyz(sulfidefifte)
print pose.xyz(sulfide_23)
print pose.xyz(sulfide_25)
print pose.xyz(sulfide_36)
SSbond = pose.xyz(sulfidefour) – pose.xyz(sulfidesix)
xD = SSbond.x
yD = SSbond.y
zD = SSbond.z
dSquared = (xD**2) + (yD**2) + (zD**2)
d = math.sqrt(dSquared)
print d
if d < 2.11:
correctdisulfide = False
SSbond = pose.xyz(sulfidefour) – pose.xyz(sulfidefifte)
xD = SSbond.x
yD = SSbond.y
zD = SSbond.z
dSquared = (xD**2) + (yD**2) + (zD**2)
d = math.sqrt(dSquared)
print d
if d < 2.11:
correctdisulfide = False
SSbond = pose.xyz(sulfidefour) – pose.xyz(sulfide_25)
xD = SSbond.x
yD = SSbond.y
zD = SSbond.z
dSquared = (xD**2) + (yD**2) + (zD**2)
d = math.sqrt(dSquared)
print d
if d < 2.11:
correctdisulfide = False
You will have to modify it someway to select for a distance, in that if the distance is higher then maximum, then change the energy function in a way that selects against this. You can make a table of kT vs. acceptance rate in excel to make sure you change kT and apply the change in a way that makes the MonteCarlo function throw out the move.
Hope this helps get you started.
-J