Code
newprog = "662 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,3,"L")
Restore_One_Stuct(4,6,"H")
Restore_One_Stuct(7,18,"L")
Restore_One_Stuct(19,19,"E")
Restore_One_Stuct(20,25,"L")
Restore_One_Stuct(26,27,"H")
Restore_One_Stuct(28,30,"L")
Restore_One_Stuct(31,33,"H")
Restore_One_Stuct(34,39,"E")
Restore_One_Stuct(40,48,"L")
Restore_One_Stuct(49,52,"H")
Restore_One_Stuct(53,56,"E")
Restore_One_Stuct(57,60,"L")
Restore_One_Stuct(61,62,"E")
Restore_One_Stuct(63,67,"L")
Restore_One_Stuct(68,71,"E")
Restore_One_Stuct(72,74,"L")
Restore_One_Stuct(75,82,"E")
Restore_One_Stuct(83,85,"L")
Restore_One_Stuct(86,89,"E")
Restore_One_Stuct(90,91,"L")
Restore_One_Stuct(92,96,"E")
Restore_One_Stuct(97,101,"L")
Restore_One_Stuct(102,110,"H")
Restore_One_Stuct(111,117,"L")
end -- function Restore_Structs
print("begin ",newprog)
if structure.GetCount() == 117 then -- num segs match
Make_All_Loop()
Restore_Structs()
else -- print warning line
print("segment number mismatch -- no action taken")
end
print("end ",newprog)