Profile
- Name
- Freeze Backbone
- ID
- 103596
- Shared with
- Public
- Parent
- Freeze Secondary Structures
- Children
- None
- Created on
- June 15, 2020 at 05:13 AM UTC
- Updated on
- June 15, 2020 at 05:13 AM UTC
- Description
Freeze all backbone segments, leaving sidechains unfrozen.
Does so very rapidly by selecting all element to freeze, then freezing selection. it will remember what the selection was before running and restore it afterwards.
Best for
Code
-- I have found it faster to select elements to freeze and freeze by selection than it is to
-- loop through all elements and freeze one by one.
preSelected = {}
for i=1, structure.GetCount() do
-- Keep track of what is already selected, so we can revert selection later
if selection.IsSelected(i) then
preSelected[#preSelected+1] = i
selection.Deselect(i)
end
end
-- Select the entire protein
selection.SelectAll()
freeze.FreezeSelected(true, false)
selection.DeselectAll()
for i=1, #preSelected do
selection.Select(preSelected[i])
end