Icon representing a recipe

Recipe: 634 comment structs

created by gramps

Profile


Name
634 comment structs
ID
44263
Shared with
Public
Parent
None
Children
None
Created on
September 27, 2012 at 14:33 PM UTC
Updated on
September 27, 2012 at 14:33 PM UTC
Description

puts in the predicted structures from the comment under the 634 puzzle page

Best for


Code


newprog = "634 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,40,"H") Restore_One_Stuct(41,46,"L") Restore_One_Stuct(47,63,"H") Restore_One_Stuct(64,74,"L") Restore_One_Stuct(75,81,"H") Restore_One_Stuct(82,82,"L") Restore_One_Stuct(83,95,"H") Restore_One_Stuct(96,100,"L") Restore_One_Stuct(101,106,"H") Restore_One_Stuct(107,118,"L") end -- function Restore_Structs print("begin ",newprog) if structure.GetCount() == 118 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 634 comment structs
everything has been changed to a loop
Loop(1,11)
Helix(12,40)
Loop(41,46)
Helix(47,63)
Loop(64,74)
Helix(75,81)
Loop(82,82)
Helix(83,95)
Loop(96,100)
Helix(101,106)
Loop(107,118)
end 634 comment structs

The above structures are taken from the predicted structures listed in the first comment under the puzzle 634 page here:
http://fold.it/portal/node/993487

gramps Lv 1

Here is how I created the above recipe "634 comment structs" …

The puzzle page is here:
http://fold.it/portal/node/993487

Clicking on the thumbnail pic in the first comment brings up the predicted structures:
http://fold.it/portal/node/993603

Reading off the predicted structures under the listing of AAs, it's all loops except for five helices as follows:
H(12,40)
H(47,63)
H(75,81)
H(83,95)
H(101,106)

[pic: helix selection from comment structs see below]

In selection mode it's easy to select, for example, segments 12 to 40 using public Recipe: Note range V1.1
https://fold.it/portal/recipe/43977

then after you've used the "make helix" on that selection use public Recipe: Note remove all Notes V1.0 to clean up that set of notes and go onto the next helix (or sheet)
https://fold.it/portal/recipe/43888

When the structures on your model match the predicted structures in the puzzle page's comment, run public Recipe: autogen structure code V1
https://fold.it/portal/recipe/43480

Note the name of the track you're using and locate the "foldit" directory on your local hard drive and the recipe output file for the "autogen" you just ran. Windows users should be able to right-mouse and select Open with –> Notepad to retrieve the recipe output.

[pic: recipe output text grab see below]

NB: in the Notepad window under Format de-select Word Wrap before copying

Now copy the recipe output (but not the script description stuff at beginning and end of the file). Open the puzzle's recipe editor (lower left of the Cookbook window, select "New (ScriptV2)" and paste the recipe output you just copied into this window and press the Run arrow. That should "restore" the structs as modified earlier. If the script fails you've probably just got a word-wrapped (too long) line. Consider saving your structure code in the text file where you keep your notes for the puzzle, or as a recipe.

For the present puzzle the "changeme" in the first line of the code got changed to "634 comment structs" and I saved and public-share this.

Of course, after you have made manual adjustments to the structures in the course of working on a puzzle, you can rerun the autogen to capture code to restore your manual structure work. Just add your new code to your puzzle notes text file so that you can bring back your work later if, say, a later recipe leaves the model all loops.helix selection from predicted structshelix selection from predicted structsrecipe output text grabrecipe output text grab