New Lua functions, any suggestions?

Started by Timo van der Laan

Bruno Kestemont Lv 1

Great it's implemented ! Thanks !

But old related functions were deactivated. I would keep them in order to protect the recipes using them.

Bruno Kestemont Lv 1

Just to thank Timo who implemented some of the ideas here.

I noticed the bonus functions, the set wiggle power functions, the save local function etc. (is it possible to get the list of new functions here?)

Bruno Kestemont Lv 1

Thanks,

The following functions has been created:

Load, save, share solutions (3 votes):

Wiggle power function (11 votes):

Bruno Kestemont Lv 1

Table filter GetNames() Get all filter names
Table filter GetEnabledNames() Get active filter names
Table filter GetDisabledNames() Get disabled filter names
Bool filter AreAllEnabled() True if all filters are active
Void filter Enable(string) Enables the named filter
void filter Disable(string) Disables the named filter
void filter EnableAll() Enables all filters
void filter DisableAll() Disables all filters
number filter GetBonusTotal() Total bonus score of the filters
number filter GetBonus(string) Bonus score of the named filter
bool filter ConditionSatisfied(string) Is the condition satisfied or the filter active
bool filter IsEnabled(string) Is the filter Enabled
string puzzle GetStructureName() Get the structure name of (multistart) puzzle
bool save LoadSolutionByName(string) Load the highest scoring solution by name
void save SaveSolution(string) Save a solution
string structure SetSecondaryStructure (string) now can specify 'a' to auto-assign structure by DSSP
bool structure InsertResidue(nr) Inserts after nr (So to reverse the operation you should use nr+1 in the Delete.)
bool structure DeleteResidue(nr) Delete the segment nr
string behavior GetWigglePower()
string behavior SetWigglePower(string) l, m, h, a

jeff101 Lv 1

It would also be useful in Symmetry Puzzles if Foldit would display the axis 
of symmetry. Any point on the axis of symmetry should be the same distance from 
residue 1 on monomer 1 as it is from residue 1 on all the other monomers in the 
symmetric complex. Similarly, any point on the symmetry axis should be the same 
distance from residue n on monomer 1 as it is from residue n on all the other 
monomers in the complex.

Being able to see the symmetry axis would help us add bands from the protein 
to this axis. With a single hub band from the protein to a point on the symmetry 
axis, one could use BandOntoSphere1.0 (https://fold.it/portal/recipe/102961) with 
one-way bands (https://fold.it/portal/node/996372#comment-27202) to make a sphere 
of bands that would keep all of the monomers of the symmetric complex within a sphere 
of fixed diameter. This sphere's diameter could be set based on the total # of amino 
acids in the symmetric complex as at http://www.calctool.org/CALC/prof/bio/protein_size
Since this tool assumes the protein volume is proportional to the # of amino acids in 
the protein, it gives protein diameters proportional to the cube-root of the # of 
amino acids. This means that the effective diameter of a dimer should be the effective 
diameter of each monomer times 1.26, the cube-root of 2. Similarly, a trimer's effective
diameter should be its monomer's effective diameter times 1.44, the cube-root of 3.

Confining the symmetric complex to a sphere as in the above paragraph is a bit like
running a compression recipe on the protein. If one uses shorter bands (smaller sphere
radii) or stronger bands, the protein will behave like it is more compressed.

Bruno Kestemont Lv 1

Delete a solution from disk.

void save DeleteSolution(string) Delete a solution

(if no string, does nothing)

This would be usefull to clean old temporary solutions when automatically saving regularilly to disk.

johnnydela Lv 1

Hi,
newbie here. I'm trying to understand how the behavior.SetWigglePower() function is applied. In my lua script, I've tried using behavior.SetWigglePower ( l ), but get an error. Is there a correct syntax to be aware of? Thanks in advance.

johnnydela Lv 1

All good now. Should have used: - behavior.SetWigglePower ( "l" ). I forgot its a string parameter.
Cheers