Icon representing a recipe

Recipe: gentle_compress_V1

created by robgee

Profile


Name
gentle_compress_V1
ID
47673
Shared with
Public
Parent
None
Children
None
Created on
January 04, 2014 at 19:36 PM UTC
Updated on
January 04, 2014 at 19:36 PM UTC
Description

Gentle compress.

Best for


Code


--Gentle compress LuaV2 code by robgee. --seems to work best on structures that have symmetry. --Options at end. print("Gentle compressor") SegCount=structure.GetCount() print("Protein length ",SegCount) local score=current.GetScore() print("Start score: ",score) function compress(num,stren) local loop=1 repeat print("Loop: ",loop) for i=1,(SegCount-1),2 do j=(SegCount-i) qid=band.AddBetweenSegments(i,j) if qid>=1 then band.SetStrength(qid,stren) end end for l=2,(SegCount-2),2 do k=(SegCount-l) qed=band.AddBetweenSegments(l,k) if qed>=1 then band.SetStrength(qed,stren) end end --########################################################################### -- You can add or comment out any of these lines, or change the wiggle iters structure.WiggleAll(1 , true, true)--wiggle for compress band.DeleteAll() behavior.SetClashImportance(0.09) structure.ShakeSidechainsAll(1) --############################################################## behavior.SetClashImportance(0.24) structure.ShakeSidechainsAll(1) behavior.SetClashImportance(0.49) structure.ShakeSidechainsAll(1) structure.WiggleAll(1 , false, true)--wiggle sidechains --############################################################### behavior.SetClashImportance(0.73) --Hmmm? structure.WiggleAll(1 , true, true) --penultimate wiggle --structure.ShakeSidechainsAll(1) --Hmmm? --############################################################### behavior.SetClashImportance(1) structure.ShakeSidechainsAll(1) structure.WiggleAll(1 , true, true)--final full wiggle structure.ShakeSidechainsAll(1) local score=current.GetScore() print(score) loop=loop+1 until loop>num end --############################################################### --Options cycles=3 --how many times compressor will run ( a cycle takes about 5 mins) StrengthofBands=0.04 --Band strength, it's this low because 1 iter of wiggle is a long time[works best around 0.03-0.08]. --If you set it higher you can always watch it work and stop the wiggle by pressing spacebar. compress(cycles,StrengthofBands)

Comments


robgee Lv 1

This is a very simple compressor recipe.
It bands the stucture symmetricaly then does a wiggle at low band strength,
followed by shake and wiggle at 3 different CI.
-
It has the options (in the code):
To change amount of cycles(a single run of recipe).[default is 3.]
To change band strength.[default is 0.04]
-
Recipe seems to work best on structures that have some symmetry.
Tried and tested on Puzzle:826.
Suggestions or feedback would be welcome.
[This is beginners code, it works, but not very well]
N.B on small proteins, best to do another wiggle after its finished.