Since this is a journal you may find starting from earlier articles helpful. I have covered a bit about the science, the FoldIT user interface, GUI recipes, and Script recipes. If you give me hints where I could be helpful I will focus in that general direction to my discretion. Currently I am going though the basic concepts of LUA script recipes. Once I get past intoductory LUA scripting I can start exploring the science of folding proteins by using LUA scripts.

Saturday, October 2, 2010

Using LUA scripts in FoldIt.

Unlike GUI recipes Script recipes look like regular computer programs.  FoldIT doesn't implement the full LUA language.  If it implemented the full language the shared recipes could contain viruses that could infect your computer.  None the less it's a pretty powerful language giving you the same controls as the GUI recipes plus some exta stuff that lets you do different things at different times.  Here is the link to the FoldIt functions.  You can get the complete list by using the function help.

The LUA editor isn't very good.  Most script writers do their work in the editor of their choice then copy and paste into the LUA editor window.  The only hot keys I know for the LUA editor are:
  • ctl-A -- Select All.
  • ctl-X -- Cut Selected.
  • ctl-C -- Copy Selected.
  • ctl-V -- Paste from Clipboard.
Windows uses the pair of control characters Carriage Return, Line Feed to separate rows.  This is a holdover from MS-DOS days.  Unix just uses the Line Feed.  When you copy from Notepad into the LUA editor the Carriage Return is displayed as a box with an x in it.  LUA ignore it but it looks ugly.  If you see the box with x in it at the end of the line you can copy from LUA directly into Notepad but if you don't see it you have to copy from LUA into Wordpad.  Wordpad is smart enough to recognize the Line Feed as a record delimiter and automatically inserts the Carriage Return.  I don't like programming in Wordpad so I copy the text from Wordpad into Notepad.  I do my programming in Notepad then use ctl-A ctl-X in the LUA editor to remove the old code then copy and paste the new code from Notepad into the LUA editor.  Before I can save the revised script in FoldIt I have to use Set Info, making changes to name or description or leaving it alone, then Save.

Next time I'll go into some actual LUA code.  You can always bring up the code behind existing scripts and review how others are doing things.  Learning from others is a good way to learn.

Have fun.  Let me know how I can be more helpful.

No comments:

Post a Comment