Code
newprog = "647 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,12,"L")
Restore_One_Stuct(13,18,"E")
Restore_One_Stuct(19,27,"L")
Restore_One_Stuct(28,29,"E")
Restore_One_Stuct(30,34,"L")
Restore_One_Stuct(35,38,"E")
Restore_One_Stuct(39,42,"L")
Restore_One_Stuct(43,50,"E")
Restore_One_Stuct(51,54,"L")
Restore_One_Stuct(55,60,"E")
Restore_One_Stuct(61,61,"L")
Restore_One_Stuct(62,65,"E")
Restore_One_Stuct(66,70,"L")
Restore_One_Stuct(71,77,"H")
Restore_One_Stuct(78,89,"L")
Restore_One_Stuct(90,96,"E")
Restore_One_Stuct(97,99,"L")
Restore_One_Stuct(100,107,"E")
Restore_One_Stuct(108,115,"L")
Restore_One_Stuct(116,123,"E")
Restore_One_Stuct(124,134,"L")
Restore_One_Stuct(135,137,"H")
Restore_One_Stuct(138,139,"L")
end -- function Restore_Structs
print("begin ",newprog)
if structure.GetCount() == 139 then -- num segs match
Make_All_Loop()
Restore_Structs()
else -- print warning line
print("segment number mismatch -- no action taken")
end
print("end ",newprog)