Profile


Name
Jolter 3.0
ID
102932
Shared with
Public
Parent
None
Children
None
Created on
October 27, 2018 at 20:26 PM UTC
Updated on
October 27, 2018 at 20:26 PM UTC
Description

See first comment.

Best for


Code


best_score = 0 min_residue = 0 max_residue = 0 n_residues = 0 post_rebuild = 3 score_type = 1 ss_stepper = 5 original_slow_filters_setting = 0 curr_base_score = 0 use_remix = true random_sections = false random_length = 7 -- Quicksave slots kCurrBaseStructure = 1 kBestPostRebuild = 2 kTemp = 3 kRemixQuicksaveStart = 20 n_rebuilds = 4 max_loss_threshold = 5 change_threshold = false threshold_change_made = false start_score = 0 new_threshold = 0 time_allowed_before_changing_threshold = 1 max_allowable_score_drop = 100 convert_to_loop = false -- If true, any non-loop residues will be temporarily converted to loops sphere_radius = 12 SphereSegList = {} -- store list of residues within sphere_radius of any residue in the segment. -- speeds things up when shaking original_secondary_structure = {} -- SS info ss_starts = {} ss_ends = {} ss_types = {} helix_spacer = 3 sheet_spacer = 0 loop_spacer = 0 use_helices = true use_sheets = true use_loops = true min_loop_length = 4 -- Performance monitoring post_sw_gains = {} post_sw_threshold = 200 post_sw_skipped = 0 total_actions = 0 monit = false monit_n_remixes = 0 start_time = 0 original_residues = {} new_residues = {} function r3 ( x ) -- Round to 3 decimal places t = 10 ^ 3 return math.floor ( x*t + 0.5 ) / t end function GetScore () if ( score_type == 1 ) then score = current.GetScore () elseif ( score_type == 2 ) then behavior.SetFiltersDisabled ( false ) score = current.GetScore () behavior.SetFiltersDisabled ( true ) elseif ( score_type == 3 ) then behavior.SetFiltersDisabled ( false ) score_1 = current.GetScore () behavior.SetFiltersDisabled ( true ) score_2 = current.GetScore () score = score_1 - score_2 end return score end function IsPuzzleMutable () for i = 1 , n_residues do if ( structure.IsMutable ( i ) ) then return true end end return false end function DoesPuzzleHaveSlowFilters () init_setting = behavior.GetSlowFiltersDisabled () if ( init_setting == false ) then score_without_sf = current.GetScore () behavior.SetSlowFiltersDisabled ( true ) score_with_sf = current.GetScore () else score_with_sf = current.GetScore () behavior.SetSlowFiltersDisabled ( false ) score_without_sf = current.GetScore () end behavior.SetSlowFiltersDisabled ( init_setting ) if ( math.abs ( score_without_sf - score_with_sf ) >1e-3 ) then return true else return false end end function GetSecondaryStructures () within_sequence = false for i = 1, n_residues do if ( ( BackboneFrozen ( i , i ) == true ) or ( BackboneLocked ( i , i ) == true ) ) then if ( within_sequence == true ) then ss_ends [ #ss_ends + 1 ] = i - 1 within_sequence = false end else s_type = structure.GetSecondaryStructure ( i ) if ( within_sequence == false ) then ss_starts [ #ss_starts + 1 ] = i ss_types [ #ss_types + 1 ] = s_type within_sequence = true elseif ( s_type ~= prev_s_type ) then ss_ends [ #ss_ends + 1 ] = i - 1 ss_starts [ #ss_starts + 1 ] = i ss_types [ #ss_types + 1 ] = s_type end prev_s_type = s_type end end if ( within_sequence == true ) then ss_ends [ #ss_ends + 1 ] = n_residues end -- for i = 1 , #ss_types do -- print ( ss_types [ i ] .. " " .. ss_starts [ i ] .. "-" .. ss_ends [ i ] ) -- end end function SelectSphere () selection.DeselectAll () for i = 1 , n_residues do if ( SphereSegList [ i ] == true ) then selection.Select ( i ) end end end function ConstructListOfResiduesWithinRange ( start_idx , end_idx ) for i = 1 , n_residues do SphereSegList [ i ] = false end for j = start_idx , end_idx do for i = 1 , n_residues do if ( ( i >= start_idx and i <= end_idx ) or ( structure.GetDistance ( i , j ) < sphere_radius ) ) then SphereSegList [ i ] = true end end end end function FinalIdealize ( c_score , start_idx , end_idx ) kFallApartThreshold = 1000 save.Quicksave ( kTemp ) selection.DeselectAll () selection.SelectRange ( start_idx , end_idx ) structure.IdealizeSelected () score_after_idealize = GetScore () selection.SelectAll () if ( ( c_score - score_after_idealize ) > kFallApartThreshold ) then structure.WiggleAll ( 1, false , true ) -- wiggle sidechains end structure.WiggleSelected ( 12 ) score = GetScore () if ( score < c_score ) then save.Quickload ( kTemp ) end end function NudgeWiggle () score_in_kTemp = GetScore () save.Quicksave ( kTemp) behavior.SetClashImportance ( 0.3 ) structure.WiggleSelected ( 1 ) behavior.SetClashImportance ( 1 ) structure.WiggleSelected ( 6 ) score = GetScore () if ( score < score_in_kTemp ) then save.Quickload ( kTemp ) end end function ConvertToLoop ( first , last ) selection.DeselectAll ( ) selection.SelectRange ( first , last ) structure.SetSecondaryStructureSelected ( "L" ) end function RebuildPreamble ( start_idx , end_idx ) save.Quickload ( kCurrBaseStructure ) if ( convert_to_loop == true ) then ConvertToLoop ( start_idx , end_idx ) end selection.DeselectAll () selection.SelectRange ( start_idx , end_idx ) end function Rebuild ( start_idx , end_idx ) local score_before_sm = 0 local i local n_r monit_n_remixes = 0 ConstructListOfResiduesWithinRange ( start_idx , end_idx ) best_post_rebuild_score = -999999 good_rebuild_found = false if ( use_remix == true ) then RebuildPreamble ( start_idx , end_idx ) n_r = structure.RemixSelected ( kRemixQuicksaveStart , n_rebuilds ) monit_n_remixes = n_r if ( n_r == 0 ) then return; end else n_r = n_rebuilds end i = 1 while ( i <= n_r ) do total_actions = total_actions + 1 if ( use_remix == true ) then save.Quickload ( kRemixQuicksaveStart -1 + i ) else RebuildPreamble ( start_idx , end_idx ) structure.RebuildSelected ( 1 ) end SelectSphere () structure.ShakeSidechainsSelected ( 1 ) score_before_wiggle = GetScore () structure.WiggleSelected ( 10 ) score_after_wiggle = GetScore () if ( post_rebuild == 2 or post_rebuild == 3 ) then score_before_sm = GetScore () if ( curr_base_score - score_before_sm < post_sw_threshold ) then good_rebuild_found = true if ( post_rebuild == 2 ) then structure.ShakeSidechainsSelected ( 1 ) else structure.MutateSidechainsSelected ( 1 ) end score_after_sm = GetScore () if ( score_after_sm - score_before_sm > 1e-3 ) then structure.WiggleSelected ( 10 ) end if ( GetScore () > curr_base_score - max_loss_threshold ) then table.insert ( post_sw_gains , curr_base_score - score_before_sm ) end else post_sw_skipped = post_sw_skipped + 1 end end score = GetScore () if ( score > best_post_rebuild_score ) then best_post_rebuild_score = score save.Quicksave ( kBestPostRebuild ) end i = i + 1 end if ( ( post_rebuild == 2 or post_rebuild == 3 ) and ( good_rebuild_found == false ) ) then return end if ( post_rebuild == 4 ) then save.Quickload ( kBestPostRebuild ) structure.MutateSidechainsSelected ( 1 ) structure.WiggleSelected ( 10 ) save.Quicksave( kBestPostRebuild ) end if ( post_rebuild > 1 ) then save.Quickload ( kBestPostRebuild ) NudgeWiggle () best_post_rebuild_score = GetScore () save.Quicksave( kBestPostRebuild ) end if ( best_post_rebuild_score > curr_base_score - max_loss_threshold ) then save.Quickload ( kBestPostRebuild ) FinalIdealize ( best_post_rebuild_score , start_idx , end_idx ) if ( convert_to_loop == true ) then save.LoadSecondaryStructure () end score_after_idealize = GetScore () --print ( "Gain from idealize " .. r3 ( score_after_idealize - best_post_rebuild_score ) ) save.Quicksave ( kCurrBaseStructure ) curr_base_score = score_after_idealize print ( " new working score " .. r3 ( curr_base_score ) ) end end function Go () for j = 1 , ss_stepper do for i = j , #ss_starts , ss_stepper do if ( random_sections == true ) then start_idx = math.random ( min_residue , max_residue - random_length + 1 ) end_idx = start_idx + random_length - 1 if ( ( BackboneFrozen ( start_idx , end_idx ) == false ) and ( BackboneLocked ( start_idx , end_idx ) == false ) ) then print ( "rb " .. start_idx .. "-" .. end_idx ) Rebuild ( start_idx , end_idx ) end else start_idx = ss_starts [ i ] end_idx = ss_ends [ i ] print ( "rb " .. start_idx .. "-" .. end_idx .. " (" .. ss_types [ i ] .. ")" ) Rebuild ( start_idx , end_idx ) end if ( monit == true ) then print ( " rm : " .. monit_n_remixes ) end if ( convert_to_loop == true ) then save.LoadSecondaryStructure () end if ( change_threshold == true ) then --print ( "Score drop " .. r3 ( start_score - curr_base_score ) ) --print ( "Seconds elapsed " .. r3 ( os.difftime ( os.time() , start_time ) ) ) if ( threshold_change_made == false ) then if ( ( start_score - curr_base_score > max_allowable_score_drop ) or ( os.difftime ( os.time() , start_time ) > time_allowed_before_changing_threshold * 3600 ) ) then max_loss_threshold = new_threshold print ( "Changing threshold to " .. r3 ( max_loss_threshold ) ) threshold_change_made = true end end end end end end function AddSpacers () for i = 1 , #ss_starts do start_idx = ss_starts [ i ] end_idx = ss_ends [ i ] if ( ss_types [ i ] == "H" ) then start_idx = start_idx - helix_spacer end_idx = end_idx + helix_spacer elseif ( ss_types [ i ] == "E" ) then start_idx = start_idx - sheet_spacer end_idx = end_idx + sheet_spacer elseif ( ss_types [ i ] == "L" ) then start_idx = start_idx - loop_spacer end_idx = end_idx + loop_spacer end ss_starts [ i ] = math.max ( 1 , start_idx ) ss_ends [ i ] = math.min ( n_residues , end_idx ) end end function BackboneFrozen ( start_idx , end_idx ) for i = start_idx , end_idx do seg_backbone_frozen, seg_sidechain_frozen = freeze.IsFrozen ( i ) if ( seg_backbone_frozen == true ) then return true end end return false end function BackboneLocked ( start_idx , end_idx ) for i = start_idx , end_idx do s = structure.IsLocked ( i ) if ( s == true ) then return true end end return false end function FilterSS () -- Delete any Secondary structures that are outside the range, locked, or consist of small loops for i = #ss_types , 1 , -1 do if ( ( ss_starts [ i ] > max_residue ) or ( ss_ends [ i ] < min_residue ) or ( ss_types [ i ] == "M" ) or ( ss_types [ i ] == "H" and use_helices == false ) or ( ss_types [ i ] == "E" and use_sheets == false ) or ( ss_types [ i ] == "L" and use_loops == false ) or ( ss_types [ i ] == "L" and ss_ends [ i ] - ss_starts [ i ] + 1 < min_loop_length ) ) then table.remove ( ss_starts , i ) table.remove ( ss_ends , i ) table.remove ( ss_types , i ) end end end function PrintParameters () print ( "Range " .. min_residue .. " to " .. max_residue ) print ( "N rebuilds " .. n_rebuilds ) print ( "Post sw threshold " .. r3 ( post_sw_threshold ) ) if ( random_sections == true ) then print ( "Random sequences of length " .. random_length ) else print ( "Rebuild helices " .. tostring ( use_helices ) ) if ( use_helices == true ) then print ( "Helix spacer " .. helix_spacer ) end print ( "Rebuild sheets " .. tostring ( use_sheets ) ) if ( use_sheets == true ) then print ( "Sheet spacer " .. sheet_spacer ) end print ( "Rebuild loops " .. tostring ( use_loops ) ) if ( use_loops == true ) then print ( "Loop spacer " .. loop_spacer ) end end if ( post_rebuild == 1 ) then print ( "Post rebuild : Shake/Wiggle" ) elseif ( post_rebuild == 2 ) then print ( "Post rebuild : Shake/Wiggle/Shake/Wiggle" ) elseif ( post_rebuild == 3 ) then print ( "Post rebuild : Shake/Wiggle/MutateWiggle" ) elseif ( post_rebuild == 4 ) then print ( "Post rebuild : Shake/Wiggle/delayed Mutate/Wiggle" ) end if ( score_type == 1 ) then print ( "Score type : Normal" ) elseif ( score_type == 2 ) then print ( "Score type : Normal/Slow Filters" ) elseif ( score_type == 3 ) then print ( "Score type : Filters" ) end print ( "Rejection threshold " .. r3 ( max_loss_threshold ) ) print ( "Selection sphere radius " .. r3 ( sphere_radius ) ) print ( "Min loop length " .. min_loop_length ) if ( change_threshold == true ) then print ( "Changing threshold" ) print ( " New threshold " .. r3 ( new_threshold ) ) print ( " Time threshold " .. r3 ( time_allowed_before_changing_threshold ) .. " hours" ) print ( " Max allowable score drop threshold " .. r3 ( max_allowable_score_drop ) ) end if ( use_remix == true ) then print ( "Using remix" ) end if ( convert_to_loop == true ) then print ( "Converting to loops" ) end print () end function GetOptionalParameters () local dlog = dialog.CreateDialog ( "Options" ) dlog.post_sw_threshold = dialog.AddSlider ( "Post sw threshold" , post_sw_threshold , 10 , 1000 , 0 ) dlog.sphere_radius = dialog.AddSlider ( "Sphere radius" , sphere_radius , 1 , 30 , 1 ) dlog.min_loop_length = dialog.AddSlider ( "Min loop length" , min_loop_length , 1 , 8 , 0 ) dlog.ss_stepper = dialog.AddSlider ( "SS stepper" , ss_stepper , 1 , 8 , 0 ) dlog.cnvt_loops = dialog.AddCheckbox ( "Convert to loops" , convert_to_loop ) dlog.random_sections = dialog.AddCheckbox ( "Random sections" , random_sections ) dlog.random_length = dialog.AddSlider ( "Random length" , random_length , 3, 20 , 0 ) dlog.change_threshold = dialog.AddCheckbox ( "Change threshold" , change_threshold ) dlog.new_threshold = dialog.AddSlider ( "New maximum loss" , new_threshold , -1 , 100 , 0 ) dlog.time_allowed_before_changing_threshold = dialog.AddSlider ( "Time threshold" , time_allowed_before_changing_threshold , 0 , 8 , 1 ) dlog.max_allowable_score_drop = dialog.AddSlider ( "Max allowable score drop" , max_allowable_score_drop , 0 , 200 , 1 ) dlog.monit = dialog.AddCheckbox ( "Monit" , monit ) dlog.ok = dialog.AddButton ( "OK" , 1 ) dlog.cancel = dialog.AddButton ( "Cancel" , 0 ) if ( dialog.Show ( dlog ) > 0 ) then post_sw_threshold = dlog.post_sw_threshold.value sphere_radius = dlog.sphere_radius.value min_loop_length = dlog.min_loop_length.value ss_stepper = dlog.ss_stepper.value convert_to_loop = dlog.cnvt_loops.value random_sections = dlog.random_sections.value random_length = dlog.random_length.value change_threshold = dlog.change_threshold.value new_threshold = dlog.new_threshold.value time_allowed_before_changing_threshold = dlog.time_allowed_before_changing_threshold.value max_allowable_score_drop = dlog.max_allowable_score_drop.value monit = dlog.monit.value return true else return false end end function GetParameters () local dlog = dialog.CreateDialog ( "Jolter 3.0" ) dlog.min_residue = dialog.AddSlider ( "Min residue" , min_residue , 1 , n_residues , 0 ) dlog.max_residue = dialog.AddSlider ( "Max residue" , max_residue , 1 , n_residues , 0 ) dlog.n_rebuilds= dialog.AddSlider ( "N Rebuilds" , n_rebuilds , 1 , 12 , 0 ) dlog.use_remix = dialog.AddCheckbox ( "Use remix" , use_remix ) dlog.post_rebuild = dialog.AddSlider ( "Post rebuild" , post_rebuild , 1 , 4 , 0 ) dlog.pr = dialog.AddLabel ( "1 = Sh/W : 2 = Sh/W/Sh/W : 3 = Sh/W/Mu/W : 4 = Sh/W/d(Mu/W)" ) dlog.max_loss_threshold = dialog.AddSlider ( "Maximum loss" , max_loss_threshold , -1 , 100 , 0 ) dlog.use_helix = dialog.AddCheckbox ( "Rebuild helices" , use_helices ) dlog.helix_spacer = dialog.AddSlider ( "Helix spacer" , helix_spacer , 0 , 5 , 0 ) dlog.use_sheet = dialog.AddCheckbox ( "Rebuild sheets" , use_sheets ) dlog.sheet_spacer = dialog.AddSlider ( "Sheet spacer" , sheet_spacer , 0 , 4 , 0 ) dlog.use_loop = dialog.AddCheckbox ( "Rebuild loops" , use_loops ) dlog.loop_spacer = dialog.AddSlider ( "Loop spacer" , loop_spacer , 0 , 4 , 0 ) dlog.score_type = dialog.AddSlider ( "Score type" , score_type , 1 , 3 , 0 ) dlog.tp = dialog.AddLabel ( "1 = Normal : 2 = Normal for Filters : 3 = Filters" ) dlog.ok = dialog.AddButton ( "OK" , 1 ) dlog.cancel = dialog.AddButton ( "Cancel" , 0 ) dlog.other_options = dialog.AddButton ( "Other options" , 2 ) return_code = dialog.Show ( dlog ) if ( return_code > 0 ) then min_residue = dlog.min_residue.value max_residue = dlog.max_residue.value n_rebuilds = dlog.n_rebuilds.value use_remix = dlog.use_remix.value post_rebuild = dlog.post_rebuild.value max_loss_threshold = dlog.max_loss_threshold.value use_helices = dlog.use_helix.value helix_spacer = dlog.helix_spacer.value use_sheets = dlog.use_sheet.value sheet_spacer = dlog.sheet_spacer.value use_loops = dlog.use_loop.value loop_spacer = dlog.loop_spacer.value score_type = dlog.score_type.value end return return_code end function main () print ( "Jolter 3.0" ) n_residues = structure.GetCount () min_residue = 1 max_residue = n_residues for i = 1, n_residues do original_secondary_structure [ i ] = structure.GetSecondaryStructure ( i ) end save.SaveSecondaryStructure () save.Quicksave ( kCurrBaseStructure ) behavior.SetClashImportance ( 1 ) original_slow_filters_setting = behavior.GetSlowFiltersDisabled () if ( DoesPuzzleHaveSlowFilters () == true ) then score_type = 2 else score_type = 1 end if ( IsPuzzleMutable () == true ) then use_remix = true else use_remix = false end post_rebuild = 4 repeat dialog_code = GetParameters () if ( dialog_code == 2 ) then GetOptionalParameters () end until ( dialog_code < 2 ) if ( dialog_code == 0 ) then return end max_residue = math.min ( n_residues , max_residue ) min_residue = math.max ( 1 , min_residue ) if ( max_residue < min_residue ) then print ( "Range error." ) print ( "Max residue (" .. max_residue .. ") must be greater than or equal to Min residue (" .. min_residue .. ")" ) return end curr_base_score = GetScore () print ( "Start score " .. r3 ( curr_base_score ) ) PrintParameters () GetSecondaryStructures () FilterSS () AddSpacers () start_time = os.time () start_score = GetScore () if ( ( post_rebuild == 3 ) or ( post_rebuild == 4 ) ) then for i = 1 , n_residues do original_residues [ i ] = structure.GetAminoAcid ( i ) end end while true do Go () end end function cleanup () print ( "Cleaning up" ) behavior.SetClashImportance ( 1.0 ) save.Quickload ( kCurrBaseStructure ) if ( convert_to_loop == true ) then save.LoadSecondaryStructure () end print ( "Elapsed time : " .. os.difftime ( os.time () , start_time ) .. " secs" ) if ( score_type == 2 ) then behavior.SetSlowFiltersDisabled ( original_slow_filters_setting ) end print () print ( "Post sw performance data" ) if ( #post_sw_gains > 0 ) then table.sort ( post_sw_gains ) mid_pt = math.ceil ( #post_sw_gains / 2 ) print ( "Median gain from working post_sw " .. r3 ( post_sw_gains [ mid_pt ] ) ) print ( "Best gains from working post_sw " ) for i = #post_sw_gains , math.max ( 1 , #post_sw_gains - 5 ) , -1 do print ( r3 ( post_sw_gains [ i ] ) ) end end print ( "Post sw skipped " .. post_sw_skipped .. "/" .. total_actions ) print () if ( ( post_rebuild == 3 ) or ( post_rebuild == 4 ) ) then for i = 1 , n_residues do new_residues [ i ] = structure.GetAminoAcid ( i ) end for i = 1 , n_residues do if ( new_residues [ i ] ~= original_residues [ i ] ) then print ( i .. " : " .. aa1_to_aa3 ( original_residues [ i ] ) .. " -> " .. aa1_to_aa3 ( new_residues [ i ] ) ) end end end end --main () xpcall ( main , cleanup )

Comments


spvincent Lv 1

Still a work in progress.

Jolter is a rebuild script that's designed, as the name suggests, to jolt the protein out of a local minimum (that's the intent anyway), although it does seem very useful as a general purpose rebuild script to use in the middle game.

It successively rebuilds /remixes alternate structural elements in the protein, being prepared to accept a small loss in score after the usual quota of shakes and wiggles that normally follow a rebuild (gains are also accepted, needless to say).

The script never terminates: it's best run overnight or at least for a couple of hours. After cancelling the script you can start from the existing position, or, since the score meanders up and down when running the script, reset best.

The defaults seem to work pretty well, although it's necessary to check that remix is enabled for the current puzzle: if not uncheck.

Algorithm outline

Get list of secondary structure elements (helix, sheet, loop)

For each element (going alternately)
Repeat 4 times (default value of N rebuilds below)
Rebuild element
Shake/Wiggle etc (Post Rebuild below)
end

Take best scoring position from above
Wiggle at low CI/wiggle
If score is better than the current score minus the rejection threshold then
make this the new current position
end

end

Min residue: max residue

Used to define the region of the protein to be rebuilt. Any secondary structure element that lies at least partially within this region will be processed.

Additionally, an element that contains a residue with a frozen backbone will not be processed.

Further control over which elements are to be rebuilt is provided by the Rebuild helices (etc) checkboxes below.

N Rebuilds

How many times to rebuild each structure. Reducing this value may result in a more structurally diverse result, albeit at the likely expense of a poorer score.

Use remix

Selects remix rather than rebuild: enabled by default.

Post Rebuild

The actions to be taken after each rebuild, The default value for non-design puzzles is (Shake/Wiggle/Shake/Wiggle) but for design puzzles number the default action is (Shake/Wiggle/Mutate/Wiggle). There's an option (4) for design puzzles to just do mutation on the two best scoring sequences: useful since it avoids doing expensive mutations on unpromising poses.

Maximum loss

Specifies how big a loss in score is permissible. The larger the value the greater the change in structure that will be allowed at the possible expense of score.
Setting this to zero means that only gains will be permitted. I suspect that the default value of 5 is too low and that something higher would work well in practise.

(See also under Change threshold below)

Rebuild helices, Rebuild sheets, Rebuild loops

Control over which structural elements to rebuild. Irrelevant if Random sections in options is selected.

Helix spacer, Sheet spacer, Loop spacer

When rebuilding, specifies the length of a spacer at either end of the structural element that will be included in the rebuild. So if the value of Helix spacer were 3, then when working on a helix from 63 to 75, the actual rebuild length would be 60 to 78. I've found the most useful values to be 0 or 1 for loops and sheets and 3 or 4 for helices. It probably depends on whether remix or rebuild is selected: if the former helices won't be rebuilt at all.

Ignored if Random sections in options is selected.

Score type

If set to 2, toggles filters off except when determining the score. For better performance on slow design puzzles. If set to 3 it looks at the filter score only. Can't remember why I put that in there.

Other options

Post sw threshold

This is an optimization to prevent unnecessary processing being done subsequent to rebuilds which are clearly going nowhere. If Post Rebuild above is set to either of the last two positions, then, after the first Shake/Wiggle, further processing is only done if the score is lower than that of the current starting pose by less than the Post sw Threshold.

The default value of 200 works quite well but at script termination, some performance data is printed out to aid in determining a good value for this parameter. Of the rebuilds that were processed (i.e. passed this threshold test), the best gains from the subsequent Shake (or Mutate)/ Wiggle are printed. If these values are close to the rejection threshold, then the threshold should probably be increases: on the other hand if they are all much lower the rejection threshold can probably be safely reduced.

Sphere radius

Only mutate those residues that within a sphere of this radius from the section being rebuilt (actually the union of three spheres centred on the start, middle and end of the section)

Min loop length

Will only rebuild/remix loops of this length or higher. So 2-loop residues that join strands in sheets won't be rebuilt unless the loop spacer value is set to 1 or higher.

SS Stepper

Secondary structures can be viewed as lyeing sequential along the protein. Rather than go though them consecutively (although this could be done by setting the value of ss_stepper to 1), it seems better to mix things up by allowing this gap between secondary structure elements.

Convert to loops

Will temporarily convert the segment sequence to loops before rebuilding.

Random sections

Rather than rebuild secondary structure elements, it will select random sequences within the region defined by min and max residue.

Random length

Used in conjunction with Random sections to select the length of sequence.

Change threshold

The idea here is to dynamically change the maximum loss threshold during the script. The thinking is to take a protein that's stuck; run jolter with a reasonably high loss threshold (maybe 15) for a bit; then, when its been jolted out of a possible local minimum, change the threshold to zero so no more reductions in score are permitted and it runs like a regular rebuilder.

New maximum loss

Relevant iff Change threshold above is set. Will likely be 0 could be set to something else I suppose.

Time threshold

Relevant iff Change threshold above is set. The number of hours the script will run until the threshold change takes place.

New maximum loss

Relevant iff Change threshold above is set. How much loss is tolerated before the threshold change takes place (or'd with the time threshold criterion: i.e. the change will be made if either condition is met)

Bruno Kestemont Lv 1

I use a modified version with maximum loss able to be negative (to -100).

This is very useful for sketchbook puzzles or other strategies where you only want to accept big gains, discarding marginal gains.

I suggest you to embed this amendment in your original recipe.