Icon representing a recipe

Recipe: Robotic protein factory

created by furi0us

Profile


Name
Robotic protein factory
ID
108126
Shared with
Public
Parent
None
Children
None
Created on
November 28, 2022 at 14:18 PM UTC
Updated on
November 28, 2022 at 18:37 PM UTC
Description

A script that allows you to automate the creation of proteins

Best for


Code


-- -- RPF - A script that allows you to automate the creation of proteins -- function StartFactory () structure.WiggleAll(1) structure.MutateSidechainsAll(1) structure.ShakeSidechainsAll(1) end function ShowFactory () StartFactory() local ask = dialog.CreateDialog ( ReVersion ) ask.l15 = dialog.AddLabel ( "Factory finished" ) ask.OK = dialog.AddButton ( "OK", 1 ) dialog.Show ( ask ) end function main () Recipe = "Robotic protein factory" Version = "1.0" ReVersion = Recipe .. " " .. Version ShowFactory () cleanup () end function cleanup ( errmsg ) -- cleanup v0.3 if CLEANUPENTRY ~= nil then return end CLEANUPENTRY = true print ( "---" ) local reason local start, stop, line, msg if errmsg == nil then reason = "complete" else start, stop, line, msg = errmsg:find ( ":(%d+):%s()" ) if msg ~= nil then errmsg = errmsg:sub ( msg, #errmsg ) end if errmsg:find ( "Cancelled" ) ~= nil then reason = "cancelled" else reason = "error" end end print ( ReVersion .. " " .. reason ) if reason == "error" then print ( "Unexpected error detected" ) print ( "Error line: " .. line ) print ( "Error: \"" .. errmsg .. "\"" ) end end xpcall ( main, cleanup )

Comments