Snap count change during snapping?

Started by Rav3n_pl

Rav3n_pl Lv 1

Code:

for s=1, structure.GetCount () do
save.Quicksave(4)
scr=current.GetSegmentEnergySubscore(s,'sidechain')
for r=1,rotamer.GetCount(s) do
rotamer.SetRotamer(s, r)
if current.GetSegmentEnergySubscore(s,'sidechain')>scr then
save.Quicksave(4)
end
end
save.Quickload(4)
end

For some reason script is crashing sometimes on SetRotamer line "snap index out of bounds".
I know that number of roamers are changing when wiggle/rebuild, but it should change between snaps too?

Observed it in 503 on cys residue when it is not bonded in start position and bond is created during snapping.

Tony Origami Lv 1

I am pretty sure that this a bug in detecting the correct rotamer count - because the rotamer count is not affected by the position of the rotamer. Interestingly, the rotamer count of other segments that are not being currently snapped can also be affected, but only rarely.

Sometimes the rotamer count increases and then your program does not crash!