Icon representing a recipe

Recipe: jfryk Renovate v0.1 (ScriptV2)

created by jfryk

Profile


Name
jfryk Renovate v0.1 (ScriptV2)
ID
33914
Shared with
Public
Parent
jfryk Renovate v0.1
Children
None
Created on
October 16, 2011 at 21:25 PM UTC
Updated on
October 16, 2011 at 21:25 PM UTC
Description

Attempts to predict the structure of each segment based on Amino Acid type after converting to all loops. WARNING: Results are very average at the moment. Don't expect much.

Best for


Code


--Renovate sets secondary structures to most common structure for AA --I am not a programmer, advice is appreciated! numSegs = structure.GetCount() freeze.UnfreezeAll() selection.SelectAll() structure.SetSecondaryStructureSelected("l") -- Convert to loops print("Starting Renovate...") --Checks Amino Acid type and converts to most common structure, leave frist and last as Loops for seg = 2, numSegs - 1 do selection.DeselectAll() ca= structure.GetAminoAcid(seg) if ca == "a" then selection.Select(seg) structure.SetSecondaryStructureSelected("h") elseif ca == "c" then selection.Select(seg) structure.SetSecondaryStructureSelected("l") -- trying Loop instead of Sheet elseif ca == "d" then selection.Select(seg) structure.SetSecondaryStructureSelected("l") elseif ca == "e" then selection.Select(seg) structure.SetSecondaryStructureSelected("h") elseif ca == "f" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "g" then selection.Select(seg) structure.SetSecondaryStructureSelected("l") elseif ca == "h" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "i" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "k" then selection.Select(seg) structure.SetSecondaryStructureSelected("h") elseif ca == "l" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "m" then selection.Select(seg) structure.SetSecondaryStructureSelected("h") elseif ca == "n" then selection.Select(seg) structure.SetSecondaryStructureSelected("l") elseif ca == "p" then selection.Select(seg) structure.SetSecondaryStructureSelected("l") elseif ca == "q" then selection.Select(seg) structure.SetSecondaryStructureSelected("l") --Any structure is OK so try loop elseif ca == "r" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "s" then selection.Select(seg) structure.SetSecondaryStructureSelected("l") elseif ca == "t" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "v" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "w" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") elseif ca == "y" then selection.Select(seg) structure.SetSecondaryStructureSelected("e") else end end -- Look for "sandwiched" structures and convert them to be the same type for segHome = 2, numSegs -1 do cs = structure.GetSecondaryStructure(segHome) ps = structure.GetSecondaryStructure(segHome-1) ns = structure.GetSecondaryStructure(segHome+1) print(ps, cs, ns) if ps == ns then if ps ~= cs then if freeze.IsFrozen(segHome) ~= 1 then print("Found Sandwich!") selection.Select(segHome) structure.SetSecondaryStructureSelected(ps) selection.Select(segHome) freeze.FreezeSelected(1, 0) else end else end else end end freeze.UnfreezeAll() -- Find Helicies that are alone and convert to loop for seg = 2, numSegs - 1 do cs = structure.GetSecondaryStructure(seg) ps = structure.GetSecondaryStructure(seg-1) ns = structure.GetSecondaryStructure(seg+1) print(ps, cs, ns) if cs == "H" then if cs ~= ps then if cs ~= ns then print("Lonely Helix!") selection.Select(seg) structure.SetSecondaryStructureSelected("l") else end else end else end end print("Done!")

Comments


jfryk Lv 1

I Learned LUA yesterday and I am not a programmer. This is a ScriptV2 recipe so it only works on the Beta right now.

Like the description says, this recipe is supposed to predict the structures of your segments based on amino acid type.

I plan on using it on De-novo puzzles to help me guess where the structures should be. Do NOT expect it to build complete structures. At least not at this time.

This recipe will NOT gain points, if you didn't already assume that.