Profile


Name
Get SS
ID
49160
Shared with
Public
Parent
None
Children
None
Created on
May 19, 2014 at 22:57 PM UTC
Updated on
May 19, 2014 at 22:57 PM UTC
Description

Prints the secondary structure in a single line, suitable for use with Set SS.

Best for


Code


-- -- get secondary structure -- -- example of getting secondary structure -- -- outputs secondary structure in the format used by set_ss -- -- -- function -- function getSS ( tab ) ssList = {} for ii = 1, structure.GetCount () do ssList [ #ssList + 1 ] = structure.GetSecondaryStructure ( ii ) end ssOut = "ssList = \"" for ii = 1, #ssList do ssOut = ssOut .. ssList [ ii ] end ssOut = ssOut .. "\"" print ( ssOut ) end --call getSS ()

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