Profile


Name
Residue
ID
100355
Shared with
Public
Parent
MicroIdealize 1.1
Children
None
Created on
December 04, 2014 at 20:31 PM UTC
Updated on
December 04, 2014 at 20:31 PM UTC
Description

Locate the selected residue

Best for


Code


-- thanks to MicroIdealize score=0 best_score = 0 min_residue = 1 n_min=1 function GetScore () score = current.GetEnergyScore () return score end function Go () freeze.Freeze(min_residue, true,false) end function GetParameters () local dlog = dialog.CreateDialog ( "Residue" ) dlog.min_residue = dialog.AddSlider ( "Residue" , n_min , n_min , n_residues , 0 ) dlog.ok = dialog.AddButton ( "OK" , 1 ) dlog.cancel = dialog.AddButton ( "Cancel" , 0 ) if ( dialog.Show ( dlog ) > 0 ) then min_residue = dlog.min_residue.value return true else return false end end function main () print ( "Residue") band.DisableAll () best_score = GetScore () -- print ( "Start score " .. r3 ( best_score ) ) n_residues = structure.GetCount () if ( GetParameters () == false ) then return -- graceful exit end Go () end function fin() end --main () xpcall ( main, fin )

Comments