Icon representing a recipe

Recipe: 661 comment structs

created by gramps

Profile


Name
661 comment structs
ID
45000
Shared with
Public
Parent
None
Children
None
Created on
December 17, 2012 at 23:39 PM UTC
Updated on
December 17, 2012 at 23:39 PM UTC
Description

yields the predicted structs from the comment under the puzzle 661 home page

Best for


Code


newprog = "661 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,9,"L") Restore_One_Stuct(10,13,"E") Restore_One_Stuct(14,17,"L") Restore_One_Stuct(18,24,"H") Restore_One_Stuct(25,29,"L") Restore_One_Stuct(30,33,"H") Restore_One_Stuct(34,37,"L") Restore_One_Stuct(38,39,"H") Restore_One_Stuct(40,49,"L") Restore_One_Stuct(50,57,"H") Restore_One_Stuct(58,65,"L") Restore_One_Stuct(66,69,"E") Restore_One_Stuct(70,73,"L") Restore_One_Stuct(74,85,"H") Restore_One_Stuct(86,91,"L") Restore_One_Stuct(92,92,"E") Restore_One_Stuct(93,112,"L") Restore_One_Stuct(113,120,"H") Restore_One_Stuct(121,131,"L") Restore_One_Stuct(132,136,"H") Restore_One_Stuct(137,141,"L") Restore_One_Stuct(142,143,"E") Restore_One_Stuct(144,144,"L") end -- function Restore_Structs print("begin ",newprog) if structure.GetCount() == 144 then -- num segs match Make_All_Loop() Restore_Structs() else -- print warning line print("segment number mismatch -- no action taken") end print("end ",newprog)

Comments


gramps Lv 1

begin 661 comment structs
everything has been changed to a loop
Loop(1,9)
Sheet(10,13)
Loop(14,17)
Helix(18,24)
Loop(25,29)
Helix(30,33)
Loop(34,37)
Helix(38,39)
Loop(40,49)
Helix(50,57)
Loop(58,65)
Sheet(66,69)
Loop(70,73)
Helix(74,85)
Loop(86,91)
Sheet(92,92)
Loop(93,112)
Helix(113,120)
Loop(121,131)
Helix(132,136)
Loop(137,141)
Sheet(142,143)
Loop(144,144)
end 661 comment structs

puzzle home page
http://fold.it/portal/node/994167