duplicate energies after calling SetRotamer( num, ix ) when ix == max count and max_count - 1

Case number:845813-996019
Topic:Game: Tools
Opened by:brgreening
Status:Open
Type:Question
Opened on:Monday, September 30, 2013 - 00:51
Last modified:Wednesday, October 2, 2013 - 14:50

I ran the following script to check how setting the Rotamer to its possible states would change the energy in an amino acid. The energies for the last two Rotamer states were the same. Why is this? Should I do a wiggle or shake before before calling the get segment energy score?

--- lua script ---

r_count = rotamer.GetCount( num )
en_max = current.GetSegmentEnergyScore( num )

for ix = 1, r_count do
rotamer.SetRotamer( num, ix )
energy = current.GetSegmentEnergyScore( num )
if energy > en_max then
en_max = energy
save.Quicksave( 1 )
max_ix = ix
end
print( " rotamer energy ", am_abbrev, ix, energy )
end

-- partial output ---

rotamer energy Glu 1 5.7030009276598
rotamer energy Glu 2 8.461221615632
rotamer energy Glu 3 -4.5904142777494
rotamer energy Glu 4 2.0629600410551
rotamer energy Glu 5 3.1492604903132
rotamer energy Glu 6 2.6994823955709
rotamer energy Glu 7 -3.3224021882244
rotamer energy Glu 8 -8.7518863091105
rotamer energy Glu 9 -6.6415317797437
rotamer energy Glu 10 -9.2565518335673
rotamer energy Glu 11 -5.0781213732778
rotamer energy Glu 12 -14.19414306858
rotamer energy Glu 13 -168.79497510026
rotamer energy Glu 14 -22.440256947935
rotamer energy Glu 15 -22.440256947875 (same energy)

rotamer energy Lys 22 -92.553010469293
rotamer energy Lys 23 -1587.2196824963
rotamer energy Lys 24 -103.00652946222
rotamer energy Lys 25 -1015.9325363513
rotamer energy Lys 26 -110.36559386476
rotamer energy Lys 27 -110.36559386472 (same energy)

rotamer energy Glu 10 24.017342345462
rotamer energy Glu 11 -3466.766180372
rotamer energy Glu 12 -3723.7938246772
rotamer energy Glu 13 -1661.5766368909
rotamer energy Glu 14 -1661.5766368909 (same energy )

The text in the lua program and the output were aligned nicely. Cutting and pasting it to here caused some problems.

(Mon, 09/30/2013 - 00:51  |  3 comments)


brow42's picture
User offline. Last seen 1 day 5 hours ago. Offline
Joined: 09/19/2011
Groups: None

Confirmed. Interesting. I hadn't noticed this before. I have no explanation, but have a sneaking suspicion it is an array bounds error. eep!

In general, the # of available rotamers depends on the EXACT configuration of the protein. If you select a rotamer conformation and then wiggle, the number of rotamers, and the conformation associated with each, can and probably will change. The usual process for testing rotamers is to do a quicksave first, and then quickload before each rotamer selection.

I don't know if selecting a rotamer invalidates the rotamer list. I haven't observed this but an authoritative answer from the dev team would be helpful.

Joined: 07/21/2013
Groups: Beta Folders

Before I read Brow42's message I put in the wiggle and got several "Bad argument #2 to SetRotamer" error messages.

After I read Brow42's message I put in the quicksaves and quickloads to restore the initial state then do one SetRotamer(). I still see some equal values, but it is not all the time in the last two that happened in the my original e-mail.

I formated the energy values and added a sort and equality ( less than 0.001 energy points means its equal ). It seems the first and last SetRotamer() energies are often equal.

r_count = rotamer.GetCount( num )
en_max = current.GetSegmentEnergyScore( num )
save.Quicksave( 1 )
save.Quicksave( 2 )
print( " Initial energy: ", string.format( " %17.8f", en_max ) )
rot_tab = {}

for ix = 1, r_count do -- line 163
--new_count = rotamer.GetCount( num )
--if ix <= new_count then
rotamer.SetRotamer( num, ix )
--end
-- structure.WiggleSelected( 1, true, false )
energy = current.GetSegmentEnergyScore( num )
table.insert( rot_tab, energy )

if energy > en_max then
en_max = energy
save.Quicksave( 2 )
max_ix = ix
end

print( " rotamer energy ", am_abbrev, string.format( "%2d %17.8f", ix, energy ) )
save.Quickload( 1 ) -- reload initial state
end

table.sort( rot_tab )
for ix = 2, r_count do
if rot_tab[ix] - rot_tab[ix-1] < 0.001 then
print( " equal values: ", string.format( " %17.8f and %17.8f", rot_tab[ix-1], rot_tab[ix] ) )
end
end
The following is part of the output when looking at Puzzle #768 DeNovo Freestype 30:

energy: Ile 3 -446.22107300
Initial energy: -446.22107300
rotamer energy Ile 1 -31.40542505
rotamer energy Ile 2 -1687.39651106
rotamer energy Ile 3 -178.87901621
rotamer energy Ile 4 -56.17452194
rotamer energy Ile 5 -179.79567458
rotamer energy Ile 6 -446.22107300
Finial energy: -31.40542505

energy: Lys 6 -104.68118135
Initial energy: -104.68118135
rotamer energy Lys 1 -104.68118135
rotamer energy Lys 2 -106.03328292
rotamer energy Lys 3 -119.52726745
rotamer energy Lys 4 -115.83636809
rotamer energy Lys 5 -113.88318970
rotamer energy Lys 6 -117.86061481
rotamer energy Lys 7 -120.26236273
rotamer energy Lys 8 -123.55360069
rotamer energy Lys 9 -122.99134855
rotamer energy Lys 10 -111.12007348
rotamer energy Lys 11 -116.83140897
rotamer energy Lys 12 -128.70787218
rotamer energy Lys 13 -131.62329714
rotamer energy Lys 14 -114.32086229
rotamer energy Lys 15 -114.79012326
rotamer energy Lys 16 -124.68094276
rotamer energy Lys 17 -117.96208295
rotamer energy Lys 18 -130.17232488
rotamer energy Lys 19 -127.85912809
rotamer energy Lys 20 -117.07232186
rotamer energy Lys 21 -104.68118135
equal values: -104.68118135 and -104.68118135
Finial energy: -104.68118135

energy: Glu 8 -7.99964114
Initial energy: -7.99964114
rotamer energy Glu 1 -7.99968145
rotamer energy Glu 2 -10.64442454
rotamer energy Glu 3 -12.24594002
rotamer energy Glu 4 -13.75526188
rotamer energy Glu 5 -11.92494437
rotamer energy Glu 6 -14.02474484
rotamer energy Glu 7 -16.42190510
rotamer energy Glu 8 -17.22370321
rotamer energy Glu 9 -16.63371195
rotamer energy Glu 10 -18.00789714
rotamer energy Glu 11 -20.49120595
rotamer energy Glu 12 -24.46981659
rotamer energy Glu 13 -52.34805254
rotamer energy Glu 14 -28.02276098
rotamer energy Glu 15 -7.99964114
equal values: -7.99968145 and -7.99964114
Finial energy: -7.99964114

energy: Ile 13 -20.01167015
Initial energy: -20.01167015
rotamer energy Ile 1 -20.01168926
rotamer energy Ile 2 -25.38541943
rotamer energy Ile 3 -41.50180169
rotamer energy Ile 4 -35.18145425
rotamer energy Ile 5 -20.01167015
equal values: -20.01168926 and -20.01167015

brow42's picture
User offline. Last seen 1 day 5 hours ago. Offline
Joined: 09/19/2011
Groups: None

Rotmer locations are computed by (I think, its been a while since we tried to figure this out):

Each degree of freedom is sampled at discrete angles. This could be uniform, like every 5 degrees, or it could be from a specific distribution for each bond. There is a probability cut applied, something like 98% likely? Then the product of all these positions is computed as a rotamer configuration, with another cutoff,like 95%.

The current configuration is NOT one of the rotamers (you have to fake it with the quicksave).

It's possible that maybe one of the configurations is sampled twice? (these are circles after all). Oops.

We used to be able to control the cutoff but the controls were removed at player request. -_-

Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons