Icon representing a recipe

Recipe: iwdn ufreeze SS 1.0

created by ichwilldiesennamen

Profile


Name
iwdn ufreeze SS 1.0
ID
104255
Shared with
Public
Parent
sel_freeze_SS
Children
Created on
December 29, 2020 at 20:16 PM UTC
Updated on
December 29, 2020 at 20:16 PM UTC
Description

Freeze/unfreeze selected secondary structure

Best for


Code


--iwdn ufreeze SS --Version 1.0 201229 --Recipe to freeze/unfreeze selected segments. The selection is freeze-inverted afterwards. 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 --freeze/unfreeze all selected residues function process() for m=1,#toWorkOn do local frzback, frzside = freeze.IsFrozen(toWorkOn[m]) if (frzback == true) then freeze.Unfreeze(toWorkOn[m], true, false) --backbone, sidechain else freeze.Freeze(toWorkOn[m], true, false) --backbone, sidechain end end end function main() findToWorkOn() process() end --xpcall(main, cleanup) main()

Comments


ichwilldiesennamen Lv 1

This recipe is part of my typical design-toolbox.
Equivalent to ufreeze SC but freezing only the backbone instead of the sidechain.
This tool freezes selected backbones (Secondary Structure: SS) or all backbones. If there are selected segments before this recipe is run then only these will be frozen/unfrozen. If there is no selection before it is run then all freezable backbone-segemets are frozen. This recipe is invertive so that already frozen segments in the selection become unfrozen after running this recipe.
I hope this is helpful. It sure was for me.

Happy folding to all!