# set constraints

Member Site Forums PyRosetta PyRosetta – General set constraints

• This topic has 3 replies, 2 voices, and was last updated 13 years, 9 months ago by Anonymous.
• Author
Posts
• #440 Anonymous

Are there any way to set constraints for example, the maximum distance between two residues? It seems to me that rosetta can do this, but i’m not shure.

• #4366 Anonymous

Do you mean bond length?
Or distance between two independent residues from different parts of a chain?

• #4367 Anonymous

Two residues from different chains or different parts of a chain.

• #4375 Anonymous

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