Profile


Name
Set SS
ID
49161
Shared with
Public
Parent
None
Children
Created on
May 19, 2014 at 22:58 PM UTC
Updated on
May 19, 2014 at 22:58 PM UTC
Description

Sets secondary structure. For use with Get SS or similar. Replace the ssList variable with the output from Get SS or similar recipes.

Best for


Code


-- -- set secondary structure -- -- example of setting secondary structure -- -- replace ssList with your secondary structure -- -- 1 2 3 4 5 6 7 8 9 -- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 ssList = "LLLLLLEEEEELLLLLLLLLEEEEEEELLLLLLLLLLLEEELLEELLLLLEELLLLLEEEELLLLLLLLLLEEELLLLLLLLEELLLLLLLLLLL" -- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 -- 1 2 3 4 5 6 7 8 9 -- -- function -- function setSS ( tab ) for ii = 1, math.min ( #tab, structure.GetCount () ) do print ( "position " .. ii .. " = \'" .. string.sub ( tab, ii, ii ) .. "\'" ) structure.SetSecondaryStructure ( ii, string.sub ( tab, ii, ii ) ) end if #tab > structure.GetCount () then print ( "specified structure list is longer than protein, ignored last " .. #tab - structure.GetCount () .. "entries" ) end if #tab < structure.GetCount () then print ( "specified structure list is shorter than protein, last " .. structure.GetCount () - #tab .. "segments unchanged" ) end end --call setSS ( ssList )

Comments


LociOiling Lv 1

After releasing this quick and dirty recipe, it turned out Brow42 had created something better a long time back. Brow's version of the recipe displays the primary and secondary structures, and lets you change them right in the recipe dialog. This is a lot better than my initial approach, which requires running one recipe to write out the structures, editing the scriptlog file to save the results, and running another recipe to restore the structures.

See "AA Copy Paste Compare v 1.1.1 – Brow42" for a full-function recipe that works with both primary and secondary structure. https://fold.it/portal/recipe/38147

I created "SS Edit" as simpler version of Brow's recipe, that works only with secondary structures in a single dialog box. https://fold.it/portal/recipe/49164