Icon representing a recipe

Recipe: Josh's Fuse

created by joshmiller

Profile


Name
Josh's Fuse
ID
104100
Shared with
Public
Parent
Blue Fuse 2020
Children
Created on
November 06, 2020 at 17:47 PM UTC
Updated on
November 06, 2020 at 17:47 PM UTC
Description

Variant of Blue Fuse 2020 to include new sliders!

Best for


Code


-- -- Josh's Fuse - 6 Nov 2020 - see notes at end -- print ( "Josh's Fuse" ) startScore = current.GetEnergyScore () -- Get the current energy score. print ( "starting score = " .. startScore ) -- print the starting score recentbest.Save () -- Save the current pose as the recent best pose. behavior.SetPackingImportance(0.17) seventeen = behavior.GetPackingImportance() behavior.SetPackingImportance(0.18) eighteen = behavior.GetPackingImportance() modding = true if (seventeen == eighteen) then modding = false end local ask = dialog.CreateDialog("Josh's Fuse") ask.Clashing = dialog.AddCheckbox("Clashing", true) ask.SidechainHBonds = dialog.AddCheckbox("Sidechain HBonds", true) ask.BackboneHBonds = dialog.AddCheckbox("Backbone HBonds", true) ask.Packing = dialog.AddCheckbox("Packing", true) ask.Hiding = dialog.AddCheckbox("Hiding", true) ask.Pairwise = dialog.AddCheckbox("Pairwise", true) if (modding == false) then ask.Warning = dialog.AddLabel("WARNING: Recipe Modding is currently OFF\nPlease turn it on before running this recipe.") end ask.OK = dialog.AddButton("OK", 1) ask.Cancel = dialog.AddButton("Cancel", 0) function resetBehavior() behavior.SetClashImportance ( 1.0 ) behavior.SetSidechainHBondImportance ( 1.0 ) behavior.SetBackboneHBondImportance ( 1.0 ) behavior.SetPackingImportance ( 1.0 ) behavior.SetHidingImportance ( 1.0 ) behavior.SetPairwiseImportance ( 1.0 ) end resetBehavior() if (dialog.Show(ask) > 0) then if (ask.Clashing.value) then behavior.SetClashImportance ( 0.05 ) -- Set the clashing importance. end if (ask.SidechainHBonds.value) then behavior.SetSidechainHBondImportance ( 3.0 ) -- Set the schbonds importance. end if (ask.BackboneHBonds.value) then behavior.SetBackboneHBondImportance ( 3.0 ) -- Set the bbhbonds importance. end if (ask.Packing.value) then behavior.SetPackingImportance ( 3.0 ) -- Set the packing importance. end if (ask.Hiding.value) then behavior.SetHidingImportance ( 3.0 ) -- Set the hiding importance. end if (ask.Pairwise.value) then behavior.SetPairwiseImportance ( 3.0 ) -- Set the pairwise importance. end structure.ShakeSidechainsAll ( 1 ) -- Shake all sidechains. resetBehavior() structure.WiggleAll ( 8 ) -- Global wiggle all segments. print ( "after first shake/wiggle, score = " .. current.GetEnergyScore () ) if (ask.Clashing.value) then behavior.SetClashImportance ( 0.07 ) -- Set the clashing importance. end if (ask.SidechainHBonds.value) then behavior.SetSidechainHBondImportance ( 2.0 ) -- Set the schbonds importance. end if (ask.BackboneHBonds.value) then behavior.SetBackboneHBondImportance ( 2.0 ) -- Set the bbhbonds importance. end if (ask.Packing.value) then behavior.SetPackingImportance ( 2.0 ) -- Set the packing importance. end if (ask.Hiding.value) then behavior.SetHidingImportance ( 2.0 ) -- Set the hiding importance. end if (ask.Pairwise.value) then behavior.SetPairwiseImportance ( 2.0 ) -- Set the pairwise importance. end structure.ShakeSidechainsAll ( 1 ) -- Shake all sidechains. resetBehavior() structure.WiggleAll ( 8 ) -- Global wiggle all segments. print ( "after second shake/wiggle, score = " .. current.GetEnergyScore () ) recentbest.Restore () -- Load the recent best pose. print ( "after restoring recent best, score = " .. current.GetEnergyScore () ) if (ask.Clashing.value) then behavior.SetClashImportance ( 0.3 ) -- Set the clashing importance. end if (ask.SidechainHBonds.value) then behavior.SetSidechainHBondImportance ( 1.5 ) -- Set the schbonds importance. end if (ask.BackboneHBonds.value) then behavior.SetBackboneHBondImportance ( 1.5 ) -- Set the bbhbonds importance. end if (ask.Packing.value) then behavior.SetPackingImportance ( 1.5 ) -- Set the packing importance. end if (ask.Hiding.value) then behavior.SetHidingImportance ( 1.5 ) -- Set the hiding importance. end if (ask.Pairwise.value) then behavior.SetPairwiseImportance ( 1.5 ) -- Set the pairwise importance. end structure.WiggleAll ( 1 ) -- Global wiggle all segments. resetBehavior() if (ask.Clashing.value) then behavior.SetClashImportance ( 0.5 ) -- Set the clashing importance. end if (ask.SidechainHBonds.value) then behavior.SetSidechainHBondImportance ( 0.3 ) -- Set the schbonds importance. end if (ask.BackboneHBonds.value) then behavior.SetBackboneHBondImportance ( 0.3 ) -- Set the bbhbonds importance. end if (ask.Packing.value) then behavior.SetPackingImportance ( 0.3 ) -- Set the packing importance. end if (ask.Hiding.value) then behavior.SetHidingImportance ( 0.3 ) -- Set the hiding importance. end if (ask.Pairwise.value) then behavior.SetPairwiseImportance ( 0.3 ) -- Set the pairwise importance. end structure.WiggleAll ( 3 ) -- Global wiggle all segments. resetBehavior() print ( "after third wiggle, score = " .. current.GetEnergyScore () ) recentbest.Restore () -- Load the recent best pose. structure.WiggleAll ( 8 ) -- Global wiggle all segments. print ( "after final wiggle, score = " .. current.GetEnergyScore () ) recentbest.Restore () -- Load the recent best pose. finalScore = current.GetEnergyScore () -- Get the current energy score. print ( "final score = " .. finalScore ) -- print the final score gain = finalScore - startScore -- calculate the gain print ( "gain = " .. gain ) -- print the gain end print ( "Josh's Fuse complete" ) -- -- original: Blue Fuse v1.1 by Vertex 3 January 2010 - https://fold.it/portal/recipe/2052 -- -- BlueFuse 2020a - LociOiling - 21 March 2020 -- + converted to Foldit Lua interface V1 to V2 -- + added printing scores and gain -- + dropped "select_all", not needed with ShakeSidechainsAll and WiggleAll -- -- Some potential improvements: -- -- TODO: round the score to three decimals -- TODO: repeat the process if there's a gain -- TODO: try different values for clashing importance -- TODO: try a different number of iterations for wiggle -- TODO: turn off filters during shake and wiggle for better performance -- TODO: add a dialog to control settings -- -- -- original: Blue Fuse v1.1 by Vertex 3 January 2010 - https://fold.it/portal/recipe/2052 -- -- BlueFuse 2020a - LociOiling - 21 March 2020 -- + converted to Foldit Lua interface V1 to V2 -- + added printing scores and gain -- + dropped "select_all", not needed with ShakeSidechainsAll and WiggleAll -- -- Some potential imp

Comments


ZeroLeak7 Lv 1

have tried your Recipe! should be longer running with different settings, but it's ok! I play a littlebit with it! thank you josh!