Profile


Name
DeleteMax 1.0
ID
103808
Shared with
Public
Parent
AddMax 1.0
Children
Created on
August 18, 2020 at 10:48 AM UTC
Updated on
August 18, 2020 at 10:48 AM UTC
Description

Deletes the maximum number of segments (residues) allowed. Useful for design puzzles with a variable number of segments.

Best for


Code


--DeleteMax -- AddMax -- -- adds as many segments as possible -- -- 1.0 - LociOiling - 2018/03/02 -- Recipe = "DeleteMax" Version = "1.0" ReVersion = Recipe .. " " .. Version print ( ReVersion ) undo.SetUndo ( false ) behavior.SetFiltersDisabled ( true ) local segcnti = structure.GetCount () local segcnt = segcnti print ( "initial segment count = " .. segcnti ) local ok = true repeat --local ss1 = structure.GetSecondaryStructure ( segcnt - 1 ) --structure.SetSecondaryStructure ( segcnt - 1, "E" ) --local ss2 = structure.GetSecondaryStructure ( segcnt ) --structure.SetSecondaryStructure ( segcnt, "E" ) --local aa2 = structure.GetAminoAcid ( segcnt ) -- -- add segment before the last segment -- ok = structure.DeleteResidue ( segcnt - 1 ) --structure.SetSecondaryStructure ( segcnt - 1, ss1 ) --structure.SetSecondaryStructure ( segcnt, ss2 ) segcnt = structure.GetCount () if ok then -- -- set secondary structure of last segment -- -- structure.SetSecondaryStructure ( segcnt, ss2 ) -- -- set amino acid of added segment -- --structure.SetAminoAcid ( segcnt - 1, aa2 ) end until not ok local segcnt = structure.GetCount () if segcnti == segcnt then print ( "no segments deleted" ) else print ( segcnt - segcnti .. " segments added" ) end print ( "final segment count = " .. segcnt ) print ( ReVersion .. " complete" ) undo.SetUndo ( true ) behavior.SetFiltersDisabled ( false )

Comments


zo3xiaJonWeinberg Lv 1

You must be logged into both the Foldit game client AND the Fold.it website (scroll far down for the login textboxes) to download recipes.