Profile


Name
iwdn hxb 1.0
ID
104254
Shared with
Public
Parent
iwdn_hxb_1.0
Children
None
Created on
December 29, 2020 at 19:53 PM UTC
Updated on
December 29, 2020 at 19:53 PM UTC
Description

Helix bander

Best for


Code


--iwdn hxb --Version: 1.0 201226 --Adds bands in helix to segment n+3 and n+4. This can be used to safely clean up a helix or to close a cut in a helix. function wait(seconds) local start = os.time() repeat until os.time() > start + seconds end function round(inNum) return inNum-inNum%0.001 end --Determine which sidechains shall be processed. The user needs to select them before running this recipe! toWorkOn = {} toWorkOnIdx = 1 function findToWorkOn() residues = structure.GetCount() for m=1,residues do if (selection.IsSelected(m) == true) then toWorkOn[toWorkOnIdx] = m toWorkOnIdx = toWorkOnIdx+1 end end --If user has not selected anything beforehand then choose all non-locked residues. if (toWorkOnIdx == 1) then for m=1,residues do if (structure.IsLocked(m) == false) then toWorkOn[toWorkOnIdx] = m toWorkOnIdx = toWorkOnIdx+1 end end end --If still toWorkOn is empty then this is an error. if (toWorkOnIdx == 1) then print("Error. No residues to work on could be found!") return end end function getScore() if (metrics_enable == 1) then tmpVal = metric.GetBonusTotal()+current.GetScore() return tmpVal else return current.GetScore() end end function process() endSegment = toWorkOn[#toWorkOn] for m=1, #toWorkOn do currSegment = toWorkOn[m] if (currSegment+4 <= endSegment) then band.AddBetweenSegments(currSegment, currSegment+3) band.AddBetweenSegments(currSegment, currSegment+4) end end band.AddBetweenSegments(currSegment, endSegment-3) end function main() print("Running iwdn hxb...") findToWorkOn() process() print("iwdn_hxb has finished!") end --main --xpcall(main, cleanup) main()

Comments


ichwilldiesennamen Lv 1

This recipe is part of my typical design-toolbox.
hxb stands for "helix bander". There are already some recipes out there that do this but I wanted to keep it as simple as possible.
This recipe should be used on helix only. It will add bands to n+3 and n+4 segment.
To use this, select the consecutive segment-range of the helix that you want to add these bands on. Then run this recipe and the bands will be created over all the selected helix-range. Attention: If you have not selected anything before running this recipe then bands will be applied to all non-locked segements which could be a mess :).
That's it. This has been quite helpful for me especially with linker-puzzles and when a helix has deformed.

Happy folding to all!