Profile


Name
Idealize
ID
46700
Shared with
Public
Parent
None
Children
Created on
July 26, 2013 at 16:19 PM UTC
Updated on
July 26, 2013 at 16:19 PM UTC
Description

See first comment

Best for


Code


n_residues = 0 ss_starts = {} ss_ends = {} kOriginalStructureOrNewBest = 8 function r3 ( i ) -- printing convenience return i - i % 0.001 end function GetScore () score = current.GetEnergyScore () return score end function get_structures ( starts , ends ) curr_type = 'x' for i = 1, n_residues do ss_type = structure.GetSecondaryStructure ( i ) if ( ss_type ~= curr_type ) then -- start of a new struct curr_type = ss_type starts [ #starts + 1 ] = i if ( i > 1 ) then ends [ #ends + 1 ] = i -1 end end end -- for i ends [ #ends + 1 ] = n_residues end function main () print ( "Idealize sections" ) curr_best_score = GetScore () print ( "Init score : " .. r3 ( curr_best_score ) ) save.Quicksave ( kOriginalStructureOrNewBest ) n_residues = structure.GetCount () behavior.SetClashImportance ( 1 ) get_structures ( ss_starts , ss_ends ) --for i = 1 , #ss_starts do --print ( ss_starts [ i ] .. " " .. ss_ends [ i ] ) --end for i = 1 , #ss_starts do save.Quickload ( kOriginalStructureOrNewBest ) selection.DeselectAll () selection.SelectRange ( ss_starts [ i ] , ss_ends [ i ] ) print ( "Idealizing " .. ss_starts [ i ] .. "-" .. ss_ends [ i ] ) structure.IdealizeSelected () score = GetScore () if ( math.abs ( score - curr_best_score ) > 1e-3 ) then selection.SelectAll () structure.WiggleSelected ( 8 ) score = GetScore () if ( score > curr_best_score ) then curr_best_score = score save.Quicksave ( kOriginalStructureOrNewBest ) print ( "Improvement to : " .. r3 ( curr_best_score ) ) end end end save.Quickload ( kOriginalStructureOrNewBest ) end function cleanup () save.Quickload ( kOriginalStructureOrNewBest ) end --main () xpcall ( main , cleanup )

Comments


spvincent Lv 1

A quick little script that does the following:

For each Secondary Structure element
Idealize
Wiggle