Code
newprog = "649 comment structs"
--
-- autogenerated code
local Struct_Types = {
["L"] = "Loop",
["E"] = "Sheet",
["H"] = "Helix",
["M"] = "Ligand" }
function Make_All_Loop()
selection.SelectAll()
structure.SetSecondaryStructureSelected("L")
print("everything has been changed to a loop")
selection.DeselectAll()
end -- function Make_All_Loop
function Restore_One_Stuct(s_start,s_end,s_type)
selection.SelectRange(s_start,s_end)
print(Struct_Types[s_type].."("..s_start..","..s_end..")")
structure.SetSecondaryStructureSelected(s_type)
selection.DeselectAll()
end -- function Restore_One_Stuct
function Restore_Structs()
Restore_One_Stuct(1,11,"L")
Restore_One_Stuct(12,12,"H")
Restore_One_Stuct(13,49,"L")
Restore_One_Stuct(50,50,"E")
Restore_One_Stuct(51,56,"L")
Restore_One_Stuct(57,60,"E")
Restore_One_Stuct(61,69,"L")
Restore_One_Stuct(70,76,"E")
Restore_One_Stuct(77,80,"L")
Restore_One_Stuct(81,83,"E")
Restore_One_Stuct(84,86,"L")
Restore_One_Stuct(87,93,"E")
Restore_One_Stuct(94,97,"L")
Restore_One_Stuct(98,104,"E")
Restore_One_Stuct(105,114,"L")
Restore_One_Stuct(115,117,"E")
Restore_One_Stuct(118,126,"L")
Restore_One_Stuct(127,130,"E")
Restore_One_Stuct(131,133,"H")
Restore_One_Stuct(134,136,"L")
Restore_One_Stuct(137,140,"E")
Restore_One_Stuct(141,143,"L")
Restore_One_Stuct(144,167,"H")
Restore_One_Stuct(168,171,"L")
end -- function Restore_Structs
print("begin ",newprog)
if structure.GetCount() == 171 then -- num segs match
Make_All_Loop()
Restore_Structs()
else -- print warning line
print("segment number mismatch -- no action taken")
end
print("end ",newprog)