The problem of folding proteins is an inherently geometrically hard problem.
People have been found to have intuitive ideas on what the shape of the protein should look like. The game Fold.it was created to allow people to express this intuition.
The 3D shape of the protein is the most important property of a protein. The shape allows scientists to determine how the protein functions.
So how is all this something for a computer science blog?
Fold.It introduced a scripting language to allow repetitive folding tasks to be automated. There is a GUI scripting tool and a Lua scripting tool.
The Lua language allowed with Fold.it is a subset of the official langue. http://www.lua.org/ with an additional API for folding and client functions.
At Fold.it, a Lua script is called a 'recipe'.
Below is a user's guide for the Fold.it Lua Version 2.0. There was a version 1.0. It has been deprecated. Old version 1.0 scripts can still be run, but one cannot create new 1.0 scripts or modify 1.0 scripts without upgrading to version 2.0 API.
See the following two Lua recipes for the mapping of Lua 1.0 to Lua 2.0 functions. You will need to be running the Fold.it client in order to get a human readable version of the recipes.
Fold.it Lua 2.0 API
|Showing segment information for segment #15, Glycine|
The segment had been mutated as its original amino acide was Iosleucine
- those functions that get information ("getters)
- those functions that set information ("setters)
- those functions that physically change the puzzle ("doers").
- The 'Undo' GUI feature is not available in the Lua V2.0. One cannot go back through the 'undo' list using Lua V2.0 scripts.
- Tweak features are not available with Lua V2.0
When using tracks, the name of the track will be used for the file. If the name of the track was Wigglefast, then the log file would be C:\foldit\scriptlog.Wigglefast.xml.
|Shows number output generated by print().|
Shows start of function output generated by help()
|This text 'No bonuses or conditions' always returns true.|
- 0 - SCORE_SOLOIST
- 1 -SCORE_EVOLVER
- 2 - SCORE_ALL_HANDS
- 3 - SCORE_NO_SCORE
A Glimpse into the Future
With a little investigating, one is able to find that there are several functions that are available to be called, but do not do anything.
One can only speculate what the functions will do. Get and Set give some hint. structure.Tweakxxx() is obvious. behavior.xxxAccuracy() would seem to be a feature to make wiggle and shake run until the change in points is within a range and simply wait however many iterations it takes to get there.
The following code will expose the functions of each of the major objects.
for key,value in pairs(object) do
print("found member " .. key);
where object is one of the Fold.it Lua 2.0 objects, such as structure, band, or current.
These functions are:
structure.TweakRotate(segmentindex,angle) - Rotate segment by angle, angle in radians, -pi to +pi. Segment must be a sheet or helix.
structure.TweakShift(segmentindex,shiftDirection) - Shift segment index one way or other. Segment must be a sheet.
structure.TweakStraighten(segmentindex) - Straighten segment index. Segment must be a sheet.