Pikamander2 Lv 1
Consider a Lua function that continuously wiggles the protein until it's no longer showing any significant improvement:
function wiggle_until_done(min_improvement)
if (min_improvement == nil or min_improvement == 0) then
min_improvement = 1;
end
wiggle_improvement = nil;
repeat
score_before_wiggle = current.GetScore();
structure.WiggleAll(1);
wiggle_improvement = current.GetScore() - score_before_wiggle;
print("Wiggle improvement: " .. wiggle_improvement);
until (wiggle_improvement < min_improvement) end
This function normally works great, but it runs into a problem when the protein's score is below -999,999 because current.GetScore() returns -999,999 instead.
So, for example, let's say that the protein's score is -1,753,728 and one wiggle iteration improves that score to -1,234,168. That's a significant improvement, but current.GetScore() returns -999,999 for both values, so the function thinks that no improvement has been made and stops wiggling.
It would be nice if current.GetScore() reported the true value rather than the capped value. The capped value makes some sense for the GUI so that the text doesn't overflow, but it serves zero purpose when Lua scripting.