Foldit Wiki
Register
Advertisement
LuaFunctions

Some of the functions which make up the Foldit Lua interface.

Note: This page is generated from the output of the help command in the Foldit client. Please don't make changes to this page. Changes will be overwritten when the page is regenerated.

To add details for a particular function, click on the 'Details' link for the function and add comments there.

Use the 'Comments' section below for comments on this page as a whole. Comments are preserved when the page is updated.

The functions listed here are for the "V2" Foldit Lua interface. For each function, the "V1" equivalent, if any, is listed. The functions are grouped by namespace.

Note: many arguments and return values have type "integer" specified, but this is not a Lua type. The correct Lua type for these values is "number". Type "integer" is used for values like segment numbers and atom counts, to indicate "whole numbers" are expected or returned.

Last updated: release 20220902-937c461719-win_x64


no namespace functions

The "no namespace" functions are general utilities.

help

Function
void help(function Func)
Description
Prints the signature and description of Func, or signature of all Foldit functions if no argument is given.
V1 Function Name
none
More Information
Details

halt_and_catch_fire

Function
void halt_and_catch_fire()
Description
Crash the program.
V1 Function Name
New to V2
More Information
Details

print

Function
void print([arg1,...,argN])
Description
Print values to the output window and log file.
V1 Function Name
print
More Information
Details

absolutebest functions

The absolutebest functions work with the highest-scoring pose, regardless of whether the pose is valid. For example, a pose with open cutpoints may have the highest score, but the score is not valid until the cutpoints are closed

absolutebest.AreConditionsMet

Function
boolean absolutebest.AreConditionsMet()
Description
Return whether the absolute best pose satisfies all conditions.
V1 Function Name
New to V2
More Information
Details

absolutebest.GetEnergyScore

Function
number absolutebest.GetEnergyScore()
Description
Get the score for the absolute best pose.
V1 Function Name
New to V2
More Information
Details

absolutebest.GetExplorationMultiplier

Function
number absolutebest.GetExplorationMultiplier()
Description
Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name
New to V2
More Information
Details

absolutebest.GetScore

Function
number absolutebest.GetScore()
Description
Get the score for the absolute best pose.
V1 Function Name
New to V2
More Information
Details

absolutebest.GetSegmentEnergyScore

Function
number absolutebest.GetSegmentEnergyScore(integer segmentIndex)
Description
Get the current score of the given segment.
V1 Function Name
New to V2
More Information
Details

absolutebest.GetSegmentEnergySubscore

Function
number absolutebest.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description
Get the current score part of the given segment.
V1 Function Name
New to V2
More Information
Details

absolutebest.Restore

Function
void absolutebest.Restore()
Description
Load the absolute best pose.
V1 Function Name
restore_abs_best
More Information
Details

band functions

The band functions create and manipulate bands.

band.Add

Function
integer band.Add(integer segmentOrigin, integer segmentXAxis, integer segmentYAxis, number rho, number theta, number phi, [integer atomIndexOrigin], [integer atomIndexXAxis], [integer atomIndexYAxis])
Description
Add a band to empty space. Returns band number.
V1 Function Name
New to V2
More Information
Details

band.AddBetweenSegments

Function
integer band.AddBetweenSegments(integer segmentIndex1, integer segmentIndex2, [integer atomIndex1], [integer atomIndex2], [integer symnr2])
Description
Add a band between the two segments. By default bands to the backbone. Specify an atom number from 0 to structure.GetAtomCount() to band to a different atom. (0 for the default backbone atom) Returns band number. Specify an symnr from 0 to structure.GetSymCount() to band to segmentIndex2 of a symmetric copy.
V1 Function Name
band_add_segment_segment
More Information
Details

band.AddToBandEndpoint

Function
integer band.AddToBandEndpoint(integer segmentIndex, integer bandIndex, [integer atomIndex])
Description
Add a band to the endpoint of an existing band. Returns band number.
V1 Function Name
New to V2
More Information
Details

band.Delete

Function
void band.Delete(integer bandIndex)
Description
Delete a band.
V1 Function Name
band_delete
More Information
Details

band.DeleteAll

Function
void band.DeleteAll([boolean recipeBandsOnly])
Description
Delete all bands.
V1 Function Name
band_delete
More Information
Details

band.Disable

Function
void band.Disable(integer bandIndex)
Description
Disable a band.
V1 Function Name
similar to band_disable
More Information
Details

band.DisableAll

Function
void band.DisableAll([boolean recipeBandsOnly])
Description
Disable all bands.
V1 Function Name
band_disable
More Information
Details

band.Enable

Function
void band.Enable(integer bandIndex)
Description
Enable a band.
V1 Function Name
similar to band_enable
More Information
Details

band.EnableAll

Function
void band.EnableAll([boolean recipeBandsOnly])
Description
Enable all bands.
V1 Function Name
band_enable
More Information
Details

band.GetAtomBase

Function
integer band.GetAtomBase(integer bandIndex)
Description
Get the atom index at the base of a band.
V1 Function Name
New to V2
More Information
Details

band.GetAtomEnd

Function
integer band.GetAtomEnd(integer bandIndex)
Description
Get the atom index at the end of a band.
V1 Function Name
New to V2
More Information
Details

band.GetCount

Function
number band.GetCount([boolean recipeBandsOnly])
Description
Get the number of bands.
V1 Function Name
get_band_count
More Information
Details

band.GetGoalLength

Function
number band.GetGoalLength(integer bandIndex)
Description
Get the goal length of a band.
V1 Function Name
New to V2
More Information
Details

band.GetLength

Function
number band.GetLength(integer bandIndex)
Description
Get the current length of a band.
V1 Function Name
New to V2
More Information
Details

band.GetResidueBase

Function
integer band.GetResidueBase(integer bandIndex)
Description
Get the residue index at the base of a band.
V1 Function Name
New to V2
More Information
Details

band.GetResidueEnd

Function
integer band.GetResidueEnd(integer bandIndex)
Description
Get the residue index at the end of a band.
V1 Function Name
New to V2
More Information
Details

band.GetStrength

Function
number band.GetStrength(integer bandIndex)
Description
Get the strength of a band.
V1 Function Name
New to V2
More Information
Details

band.IsEnabled

Function
boolean band.IsEnabled(integer bandIndex)
Description
Return whether a band is enabled.
V1 Function Name
New to V2
More Information
Details

band.IsRecipeBand

Function
boolean band.IsRecipeBand(integer bandIndex)
Description
Return whether a band was modified by a recipe.
V1 Function Name
New to V2
More Information
Details

band.SetGoalLength

Function
void band.SetGoalLength(integer bandIndex, number length)
Description
Set the goal length of a band. (Range 0.0 to 10000.0)
V1 Function Name
band_set_length
More Information
Details

band.SetStrength

Function
void band.SetStrength(integer bandIndex, number strength)
Description
Set the strength of a band. (Range 0.0 to 10.0)
V1 Function Name
band_set_strength
More Information
Details

behavior functions

The behavior functions control clashing importance and other properties found the client's behavior dialog and related places.

behavior.GetBackboneHBondImportance

Function
number behavior.GetBackboneHBondImportance()
Description
Get the backbone hydrogen bond importance.
V1 Function Name
New to V2
More Information
Details

behavior.GetClashImportance

Function
number behavior.GetClashImportance()
Description
Get the clashing importance.
V1 Function Name
New to V2
More Information
Details

behavior.GetDensityImportance

Function
number behavior.GetDensityImportance()
Description
Get the density importance.
V1 Function Name
New to V2
More Information
Details

behavior.GetFiltersDisabled

Function
boolean behavior.GetFiltersDisabled()
Description
Return whether any filters are currently disabled. If they are, filters are skipped and your score will not officially count.
V1 Function Name
New to V2
More Information
Details

behavior.GetHidingImportance

Function
number behavior.GetHidingImportance()
Description
Get the hiding importance.
V1 Function Name
New to V2
More Information
Details

behavior.GetPackingImportance

Function
number behavior.GetPackingImportance()
Description
Get the packing importance.
V1 Function Name
New to V2
More Information
Details

behavior.GetPairwiseImportance

Function
number behavior.GetPairwiseImportance()
Description
Get the pairwise importance.
V1 Function Name
New to V2
More Information
Details

behavior.GetSidechainHBondImportance

Function
number behavior.GetSidechainHBondImportance()
Description
Get the sidechain hydrogen bond importance.
V1 Function Name
New to V2
More Information
Details

behavior.GetSlowFiltersDisabled

Function
boolean behavior.GetSlowFiltersDisabled()
Description
(Deprecated - use GetFiltersDisabled) Return whether slow filters are currently disabled. If they are, CPU intensive filters are skipped and your score will not officially count.
V1 Function Name
New to V2
More Information
Details

behavior.GetWigglePower

Function
string behavior.GetWigglePower()
Description
Get the wiggle power.
V1 Function Name
New to V2
More Information
Details

behavior.HighPowerAllowed

Function
bool behavior.HighPowerAllowed()
Description
True if High Power Wiggle is allowed
V1 Function Name
New to V2
More Information
Details

behavior.SetBackboneHBondImportance

Function
void behavior.SetBackboneHBondImportance(number importance)
Description
Set the backbone hydrogen bond importance. (Range 0.0 to 3.0)
V1 Function Name
New to V2
More Information
Details

behavior.SetClashImportance

Function
void behavior.SetClashImportance(number importance)
Description
Set the clashing importance. (Range 0.0 to 1.0)
V1 Function Name
set_behavior_clash_importance
More Information
Details

behavior.SetDensityImportance

Function
void behavior.SetDensityImportance(number importance)
Description
Set the density importance. (Range 0.0 to 3.0)
V1 Function Name
New to V2
More Information
Details

behavior.SetFiltersDisabled

Function
void behavior.SetFiltersDisabled(boolean setting)
Description
Set whether filters should be disabled. Setting to true will disable all filters. Set to false to get credit for your score.
V1 Function Name
New to V2
More Information
Details

behavior.SetHidingImportance

Function
void behavior.SetHidingImportance(number importance)
Description
Set the hiding importance. (Range 0.0 to 3.0)
V1 Function Name
New to V2
More Information
Details

behavior.SetPackingImportance

Function
void behavior.SetPackingImportance(number importance)
Description
Set the packing importance. (Range 0.0 to 3.0)
V1 Function Name
New to V2
More Information
Details

behavior.SetPairwiseImportance

Function
void behavior.SetPairwiseImportance(number importance)
Description
Set the pairwise importance. (Range 0.0 to 3.0)
V1 Function Name
New to V2
More Information
Details

behavior.SetSidechainHBondImportance

Function
void behavior.SetSidechainHBondImportance(number importance)
Description
Set the sidechain hydrogen bond importance. (Range 0.0 to 3.0)
V1 Function Name
New to V2
More Information
Details

behavior.SetSlowFiltersDisabled

Function
void behavior.SetSlowFiltersDisabled(boolean setting)
Description
(Deprecated - use SetFiltersDisabled) Set whether slow filters should be disabled. Turn on to skip some CPU intensive filters. Turn off to get credit for your score.
V1 Function Name
New to V2
More Information
Details

behavior.SetWigglePower

Function
void behavior.SetWigglePower(string power)
Description
Set the wiggle power. (l=low,m=medium,h=high,a=auto)
V1 Function Name
New to V2
More Information
Details

behavior.UseCutBands

Function
void behavior.UseCutBands(boolean enable)
Description
Enables or disables Cut Bands.
V1 Function Name
New to V2
More Information
Details

contactmap functions

The contactmap functions access contact map information in puzzles which use it.

contactmap.GetHeat

Function
number contactmap.GetHeat(integer segmentIndex1, integer segmentIndex2)
Description
Gets the heat of two segments.
V1 Function Name
New to V2
More Information
Details

contactmap.IsContact

Function
bool contactmap.IsContact(integer segmentIndex1, integer segmentIndex2)
Description
Gets whether two segments are in contact.
V1 Function Name
New to V2
More Information
Details

creditbest functions

The creditbest functions work with the best valid pose, in contrast to the absolutebest functions

creditbest.AreConditionsMet

Function
boolean creditbest.AreConditionsMet()
Description
Return whether the credit best pose satisfies all conditions.
V1 Function Name
New to V2
More Information
Details

creditbest.GetEnergyScore

Function
number creditbest.GetEnergyScore()
Description
Get the current energy score.
V1 Function Name
New to V2
More Information
Details

creditbest.GetExplorationMultiplier

Function
number creditbest.GetExplorationMultiplier()
Description
Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name
New to V2
More Information
Details

creditbest.GetScore

Function
number creditbest.GetScore()
Description
Get the score for the credit best pose.
V1 Function Name
New to V2
More Information
Details

creditbest.GetSegmentEnergyScore

Function
number creditbest.GetSegmentEnergyScore(integer segmentIndex)
Description
Get the current score of the given segment.
V1 Function Name
New to V2
More Information
Details

creditbest.GetSegmentEnergySubscore

Function
number creditbest.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description
Get the current score part of the given segment.
V1 Function Name
New to V2
More Information
Details

creditbest.Restore

Function
void creditbest.Restore()
Description
Load the credit best pose.
V1 Function Name
restore_credit_best
More Information
Details

current functions

The current functions work with the current pose of the protein.

current.AreConditionsMet

Function
boolean current.AreConditionsMet()
Description
Return whether the current pose satisfies all conditions.
V1 Function Name
are_conditions_met
More Information
Details

current.GetEnergyScore

Function
number current.GetEnergyScore()
Description
Get the current energy score.
V1 Function Name
New to V2
More Information
Details

current.GetExplorationMultiplier

Function
number current.GetExplorationMultiplier()
Description
Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name
get_exploration_score
More Information
Details

current.GetScore

Function
number current.GetScore()
Description
Get the current score.
V1 Function Name
get_ranked_score
More Information
Details

current.GetSegmentEnergyScore

Function
number current.GetSegmentEnergyScore(integer segmentIndex)
Description
Get the current score of the given segment.
V1 Function Name
similar to get_segment_score
More Information
Details

current.GetSegmentEnergySubscore

Function
number current.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description
Get the current score part of the given segment.
V1 Function Name
similar to get_segment_score_part
More Information
Details

dialog functions

The dialog functions create the dialog boxes found in many recipes.

dialog.AddButton

Function
table dialog.AddButton(string label, integer value)
Description
Add button.
V1 Function Name
New to V2
More Information
Details

dialog.AddCheckbox

Function
table dialog.AddCheckbox(string label, boolean value)
Description
Add checkbox.
V1 Function Name
New to V2
More Information
Details

dialog.AddLabel

Function
table dialog.AddLabel(string label)
Description
Add label.
V1 Function Name
New to V2
More Information
Details

dialog.AddSlider

Function
table dialog.AddSlider(string label, number value, number minimum, number maximum, number precision)
Description
Add slider.
V1 Function Name
New to V2
More Information
Details

dialog.AddTextbox

Function
table dialog.AddTextbox(string label, string value)
Description
Add textbox.
V1 Function Name
New to V2
More Information
Details

dialog.CreateDialog

Function
table dialog.CreateDialog(string title)
Description
Create a dialog.
V1 Function Name
New to V2
More Information
Details

dialog.SelectBands

Function
table dialog.SelectBands()
Description
Prompt for segment selection, get a list of band indices.
V1 Function Name
New to V2
More Information
Details

dialog.SelectSegments

Function
table dialog.SelectSegments()
Description
Prompt for segment selection, get a list of segment indices.
V1 Function Name
New to V2
More Information
Details

dialog.Show

Function
integer dialog.Show(table dialogTable)
Description
Show dialog.
V1 Function Name
New to V2
More Information
Details

filter functions

filter.AreAllEnabled

Function
bool filter.AreAllEnabled()
Description
True if all filters are active
V1 Function Name
New to V2
More Information
Details

filter.ConditionSatisfied

Function
bool filter.ConditionSatisfied(string name)
Description
Is the condition satisfied or the filter active
V1 Function Name
New to V2
More Information
Details

filter.Disable

Function
void filter.Disable(string name)
Description
Disables the named filter
V1 Function Name
New to V2
More Information
Details

filter.DisableAll

Function
void filter.DisableAll()
Description
Disables all filters
V1 Function Name
New to V2
More Information
Details

filter.Enable

Function
void filter.Enable(string name)
Description
Enables the named filter
V1 Function Name
New to V2
More Information
Details

filter.EnableAll

Function
void filter.EnableAll()
Description
Enables all filters
V1 Function Name
New to V2
More Information
Details

filter.GetBonus

Function
number filter.GetBonus(string name)
Description
Bonus score of the filter
V1 Function Name
New to V2
More Information
Details

filter.GetBonusTotal

Function
number filter.GetBonusTotal()
Description
Total bonus score of the filters
V1 Function Name
New to V2
More Information
Details

filter.GetData

Function
table filter.GetData(string name)
Description
Get filter-specific data. Returns an empty table when no data is available.
V1 Function Name
New to V2
More Information
Details

filter.GetDisabledNames

Function
table filter.GetDisabledNames()
Description
Get disabled filter names
V1 Function Name
New to V2
More Information
Details

filter.GetEnabledNames

Function
table filter.GetEnabledNames()
Description
Get active filter names
V1 Function Name
New to V2
More Information
Details

filter.GetNames

Function
table filter.GetNames()
Description
Get all filter names
V1 Function Name
New to V2
More Information
Details

filter.HasBonus

Function
bool filter.HasBonus(string name)
Description
Does the filter have a valid bonus score
V1 Function Name
New to V2
More Information
Details

filter.IsEnabled

Function
bool filter.IsEnabled(string name)
Description
Is the filter Enabled
V1 Function Name
New to V2
More Information
Details

freeze functions

The freeze functions freeze and unfreeze the backbone or sidechains of specified segments.

freeze.Freeze

Function
void freeze.Freeze(integer segmentIndex, boolean backbone, boolean sidechain)
Description
Freeze a segment's backbone and/or sidechain.
V1 Function Name
New to V2
More Information
Details

freeze.FreezeAll

Function
void freeze.FreezeAll()
Description
Freeze all segments. Freezes both the backbone and the sidechains.
V1 Function Name
New to V2
More Information
Details

freeze.FreezeSelected

Function
void freeze.FreezeSelected(boolean backbone, boolean sidechain)
Description
Freeze the selected segments. The backbone and sidechain arguments indicate which parts of the segment to freeze.
V1 Function Name
do_freeze
More Information
Details

freeze.GetCount

Function
integer,integer freeze.GetCount()
Description
Get the count of frozen segments. Returns backbone and sidechains counts.
V1 Function Name
New to V2
More Information
Details

freeze.IsFrozen

Function
boolean,boolean freeze.IsFrozen(integer segmentIndex)
Description
Returns whether the backbone and/or sidechain is frozen.
V1 Function Name
New to V2
More Information
Details

freeze.Unfreeze

Function
void freeze.Unfreeze(integer segmentIndex, boolean backbone, boolean sidechain)
Description
Unfreeze a segment's backbone and/or sidechain.
V1 Function Name
New to V2
More Information
Details

freeze.UnfreezeAll

Function
void freeze.UnfreezeAll()
Description
Unfreeze all segments.
V1 Function Name
do_unfreeze_all
More Information
Details

metric functions

metric.GetBonus

Function
number metric.GetBonus(string name)
Description
Bonus score of the metric with the given name
V1 Function Name
New to V2
More Information
Details

metric.GetBonusTotal

Function
number metric.GetBonusTotal()
Description
Total bonus score of the metrics
V1 Function Name
New to V2
More Information
Details

metric.GetNames

Function
table metric.GetNames()
Description
Get all metric names
V1 Function Name
New to V2
More Information
Details

puzzle functions

The puzzle functions get information about the current puzzle. They also allow the puzzle to be reset to a starting point.

puzzle.GetDescription

Function
string puzzle.GetDescription()
Description
Get the description of the puzzle.
V1 Function Name
New to V2
More Information
Details

puzzle.GetExpirationTime

Function
integer puzzle.GetExpirationTime()
Description
Get the date and time that the puzzle expires.
V1 Function Name
New to V2
More Information
Details

puzzle.GetName

Function
string puzzle.GetName()
Description
Get the name of the puzzle.
V1 Function Name
New to V2
More Information
Details

puzzle.GetPuzzleID

Function
string puzzle.GetPuzzleID()
Description
Get the ID Number of the puzzle.
V1 Function Name
New to V2
More Information
Details

puzzle.GetPuzzleSubscoreNames

Function
table puzzle.GetPuzzleSubscoreNames()
Description
Get the possible subscores for this puzzle.
V1 Function Name
New to V2
More Information
Details

puzzle.GetStructureName

Function
string puzzle.GetStructureName()
Description
Get the structure name of the (multistart) puzzle.
V1 Function Name
New to V2
More Information
Details

puzzle.StartOver

Function
void puzzle.StartOver()
Description
Reset puzzle to the starting pose.
V1 Function Name
reset_puzzle
More Information
Details

recentbest functions

The recentbest functions work with the "recent best" pose. Unlike the absolutebest, creditbest, and current poses, the recentbest pose can be reset under recipe control.

recentbest.AreConditionsMet

Function
boolean recentbest.AreConditionsMet()
Description
Return whether the recent best pose satisfies all conditions.
V1 Function Name
New to V2
More Information
Details

recentbest.GetEnergyScore

Function
number recentbest.GetEnergyScore()
Description
Get the current energy score.
V1 Function Name
New to V2
More Information
Details

recentbest.GetExplorationMultiplier

Function
number recentbest.GetExplorationMultiplier()
Description
Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name
New to V2
More Information
Details

recentbest.GetScore

Function
number recentbest.GetScore()
Description
Get the score for the recent best pose.
V1 Function Name
New to V2
More Information
Details

recentbest.GetSegmentEnergyScore

Function
number recentbest.GetSegmentEnergyScore(integer segmentIndex)
Description
Get the current score of the given segment.
V1 Function Name
New to V2
More Information
Details

recentbest.GetSegmentEnergySubscore

Function
number recentbest.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description
Get the current score part of the given segment.
V1 Function Name
New to V2
More Information
Details

recentbest.Restore

Function
void recentbest.Restore()
Description
Load the recent best pose.
V1 Function Name
restore_recent_best
More Information
Details

recentbest.Save

Function
void recentbest.Save()
Description
Save the current pose as the recent best pose.
V1 Function Name
reset_recent_best
More Information
Details

recipe functions

The recipe functions perform general housekeeping tasks.

recipe.CompareNumbers

Function
boolean recipe.CompareNumbers(number num1, number num2)
Description
Returns true if the two real numbers are the same to the precision that Lua prints.
V1 Function Name
New to V2
More Information
Details

recipe.GetMetadata

Function
string recipe.GetMetadata()
Description
Get the name and ID of the currently-running recipe.
V1 Function Name
New to V2
More Information
Details

recipe.GetRandomSeed

Function
number recipe.GetRandomSeed()
Description
Returns a good seed for the math.randomseed() function.
V1 Function Name
New to V2
More Information
Details

recipe.ReportStatus

Function
number recipe.ReportStatus()
Description
Reports the current status to the recipe output window and log file. Returns the improvement to the score from the SectionStart call.
V1 Function Name
New to V2
More Information
Details

recipe.SectionEnd

Function
number recipe.SectionEnd()
Description
Ends a reporting section. Returns the improvement to the score from the SectionStart call.
V1 Function Name
New to V2
More Information
Details

recipe.SectionStart

Function
void recipe.SectionStart(string sectionName)
Description
Starts a reporting section.
V1 Function Name
New to V2
More Information
Details

rotamer functions

The rotamer functions recipes to manipulate sidechain positions, or rotamers, of a particular segment.

rotamer.GetCount

Function
integer rotamer.GetCount(integer segmentIndex)
Description
Return the number of rotamers the sidechain at the given index can snap to. This number may change if the backbone moves.
V1 Function Name
get_sidechain_snap_count
More Information
Details

rotamer.SetRotamer

Function
void rotamer.SetRotamer(integer segmentIndex, integer position)
Description
Snap the sidechain at the given segment to a rotamer. (Range 1 to rotamer.GetCount()).
V1 Function Name
do_sidechain_snap
More Information
Details

save functions

The save functions allow the current pose to be saved to or restored from numbered "slots".

save.GetSolutions

Function
table save.GetSolutions()
Description
Get a list of solutions.
V1 Function Name
New to V2
More Information
Details

save.LoadSecondaryStructure

Function
void save.LoadSecondaryStructure()
Description
Load previously saved structure assignment.
V1 Function Name
load_structure
More Information
Details

save.LoadSolution

Function
void save.LoadSolution(solution)
Description
Load a solution.
V1 Function Name
New to V2
More Information
Details

save.LoadSolutionByName

Function
bool save.LoadSolutionByName(string name)
Description
Load the highest scoring solution by name.
V1 Function Name
New to V2
More Information
Details

save.Quickload

Function
void save.Quickload(integer slot)
Description
Quickload from a slot.
V1 Function Name
quickload
More Information
Details

save.Quicksave

Function
void save.Quicksave(integer slot)
Description
Quicksave to a slot. (Range 1 to 100)
V1 Function Name
quicksave
More Information
Details

save.QuicksaveEmpty

Function
bool save.QuicksaveEmpty(integer slot)
Description
Is a quicksave slot empty.
V1 Function Name
New to V2
More Information
Details

save.SaveSecondaryStructure

Function
void save.SaveSecondaryStructure()
Description
Save current structure assignment.
V1 Function Name
save_structure
More Information
Details

save.SaveSolution

Function
void save.SaveSolution(string name)
Description
Save a solution.
V1 Function Name
New to V2
More Information
Details

scoreboard functions

The scoreboard functions return information about how the current solution relative to other players.

scoreboard.GetGroupRank

Function
integer scoreboard.GetGroupRank()
Description
Get the group rank.
V1 Function Name
New to V2
More Information
Details

scoreboard.GetGroupScore

Function
number scoreboard.GetGroupScore()
Description
Get the group score.
V1 Function Name
New to V2
More Information
Details

scoreboard.GetRank

Function
integer scoreboard.GetRank([scoretype])
Description
Get the rank.
V1 Function Name
New to V2
More Information
Details

scoreboard.GetScore

Function
number scoreboard.GetScore([scoretype])
Description
Get the score.
V1 Function Name
New to V2
More Information
Details

scoreboard.GetScoreType

Function
scoretype scoreboard.GetScoreType()
Description
Get the current type of score. Returns one of the scoretype enum values.
V1 Function Name
New to V2
More Information
Details

selection functions

The selection functions allows segment to be selected and deselected. Many other functions only work on selected segments.

selection.Deselect

Function
void selection.Deselect(integer segmentIndex)
Description
Deselect the segment at the given index
V1 Function Name
similar to deselect_index
More Information
Details

selection.DeselectAll

Function
void selection.DeselectAll()
Description
Deselect all segments.
V1 Function Name
deselect_all
More Information
Details

selection.GetCount

Function
integer selection.GetCount()
Description
Get the number of selected segments.
V1 Function Name
New to V2
More Information
Details

selection.IsSelected

Function
boolean selection.IsSelected(integer segmentIndex)
Description
Returns whether a segment is selected.
V1 Function Name
New to V2
More Information
Details

selection.Select

Function
void selection.Select(integer segmentIndex)
Description
Select segment at the given index.
V1 Function Name
similar to select_index
More Information
Details

selection.SelectAll

Function
void selection.SelectAll()
Description
Select all segments.
V1 Function Name
select_all
More Information
Details

selection.SelectRange

Function
void selection.SelectRange(integer segmentIndex1, integer segmentIndex2)
Description
Select segments from segmentIndex1 to segmentIndex2.
V1 Function Name
select_index_range
More Information
Details

structure functions

The structure functions perform a variety of tasks related to specific segments of the puzzle.Most of these tasks can also be performed manually in the client.

structure.CanMutate

Function
boolean structure.CanMutate(integer segmentIndex, string aminoAcid)
Description
Returns whether a segment is mutable into the given amino acid.
V1 Function Name
New to V2
More Information
Details

structure.DeleteCut

Function
void structure.DeleteCut(integer segmentIndex)
Description
Delete a cut at the index.
V1 Function Name
New to V2
More Information
Details

structure.DeleteResidue

Function
boolean structure.DeleteResidue(integer segmentIndex)
Description
Delete residue from the structure. Returns whether it succeeds.
V1 Function Name
New to V2
More Information
Details

structure.GetABEGO

Function
string structure.GetABEGO(integer segmentIndex)
Description
Return a letter indicating the ABEGO type of a segment
V1 Function Name
New to V2
More Information
Details

structure.GetABEGOAll

Function
table structure.GetABEGOAll()
Description
Return a table with the ABEGO types of all segments
V1 Function Name
New to V2
More Information
Details

structure.GetAminoAcid

Function
string structure.GetAminoAcid(integer segmentIndex)
Description
Get amino acid type.
V1 Function Name
similar to get_aa
More Information
Details

structure.GetAtomCount

Function
integer structure.GetAtomCount(integer segmentIndex)
Description
Return the number of atoms in a segment.
V1 Function Name
New to V2
More Information
Details

structure.GetCount

Function
integer structure.GetCount()
Description
Return the number of segments.
V1 Function Name
get_segment_count
More Information
Details

structure.GetCuts

Function
table structure.GetCuts()
Description
Returns a list of segment indices of all cuts.
V1 Function Name
New to V2
More Information
Details

structure.GetDistance

Function
number structure.GetDistance(integer segmentIndex1, integer segmentIndex2)
Description
Return distance between two segments.
V1 Function Name
get_segment_distance
More Information
Details

structure.GetHBonds

Function
integer structure.GetHBonds()
Description
Returns table of hydrogen bond information.
V1 Function Name
New to V2
More Information
Details

structure.GetNote

Function
string structure.GetNote(integer segmentIndex)
Description
Gets the note assigned to a segment.
V1 Function Name
New to V2
More Information
Details

structure.GetSecondaryStructure

Function
string structure.GetSecondaryStructure(integer segmentIndex)
Description
Get segment secondary structure type.
V1 Function Name
similar to get_ss
More Information
Details

structure.GetSymCount

Function
integer structure.GetSymCount()
Description
Return the number of symmetry copies. 0 if there are no copies.
V1 Function Name
New to V2
More Information
Details

structure.IdealSSSelected

Function
void structure.IdealSSSelected()
Description
Ideal SS selected segments.
V1 Function Name
New to V2
More Information
Details

structure.IdealizeSelected

Function
void structure.IdealizeSelected()
Description
Idealize selected segments.
V1 Function Name
New to V2
More Information
Details

structure.InsertCut

Function
void structure.InsertCut(integer segmentIndex)
Description
Insert a cut at the index.
V1 Function Name
New to V2
More Information
Details

structure.InsertResidue

Function
boolean structure.InsertResidue(integer segmentIndex)
Description
Inserts a residue after the segmentIndex. Use segmentIndex 0 to insert before the first segment. Returns whether it succeeds.
V1 Function Name
New to V2
More Information
Details

structure.IsHydrophobic

Function
boolean structure.IsHydrophobic(integer segmentIndex)
Description
Returns segment hydrophobicity.
V1 Function Name
similar to is_hydrophobic
More Information
Details

structure.IsLocked

Function
boolean structure.IsLocked(integer segmentIndex)
Description
Returns whether a segment is locked and whether its sidechain is locked (two values).
V1 Function Name
New to V2
More Information
Details

structure.IsLockedAll

Function
boolean structure.IsLockedAll()
Description
Returns a table with values of IsLocked for all segments and sidechains, indexed by segment number
V1 Function Name
New to V2
More Information
Details

structure.IsMutable

Function
boolean structure.IsMutable(integer segmentIndex)
Description
Returns whether a segment is mutable.
V1 Function Name
New to V2
More Information
Details

structure.LocalWiggleAll

Function
void structure.LocalWiggleAll(integer iterations[, backbone, sidechains])
Description
Local wiggle all segments.
V1 Function Name
New to V2
More Information
Details

structure.LocalWiggleSelected

Function
void structure.LocalWiggleSelected(integer iterations[, backbone, sidechains])
Description
Local wiggle selected segments.
V1 Function Name
similar to do_local_wiggle
More Information
Details

structure.MutateSidechainsAll

Function
void structure.MutateSidechainsAll(integer iterations)
Description
Mutate all sidechains.
V1 Function Name
New to V2
More Information
Details

structure.MutateSidechainsSelected

Function
void structure.MutateSidechainsSelected(integer iterations)
Description
Mutate selected sidechains.
V1 Function Name
similar to do_mutate
More Information
Details

structure.NeuralNetMutateSidechainsAll

Function
void structure.NeuralNetMutateSidechainsAll()
Description
Mutate all sidechains with a neural net algorithm.
V1 Function Name
New to V2
More Information
Details

structure.NeuralNetMutateSidechainsSelected

Function
void structure.NeuralNetMutateSidechainsSelected()
Description
Mutate selected sidechains with a neural net algorithm.
V1 Function Name
New to V2
More Information
Details

structure.RebuildSelected

Function
void structure.RebuildSelected(integer iterations)
Description
Run rebuild on selection.
V1 Function Name
do_local_rebuild
More Information
Details

structure.RemixSelected

Function
integer structure.RemixSelected(integer start_quicksave, integer num_results)
Description
Run remix on selection.
V1 Function Name
New to V2
More Information
Details

structure.SetAminoAcid

Function
void structure.SetAminoAcid(integer segmentIndex, string aminoAcid)
Description
Replace amino acid.
V1 Function Name
New to V2
More Information
Details

structure.SetAminoAcidSelected

Function
void structure.SetAminoAcidSelected(string aminoAcid)
Description
Changed the selected segments to the specified amino acid.
V1 Function Name
replace_aa
More Information
Details

structure.SetNote

Function
void structure.SetNote(integer segmentIndex, string note)
Description
Sets the note assigned to a segment.
V1 Function Name
New to V2
More Information
Details

structure.SetSecondaryStructure

Function
void structure.SetSecondaryStructure(integer segmentIndex, string secondaryStructure)
Description
Set segments secondary structure. Valid values are e=sheet, h=helix, l=loop, m=molecule, a=auto.
V1 Function Name
New to V2
More Information
Details

structure.SetSecondaryStructureSelected

Function
void structure.SetSecondaryStructureSelected(string secondaryStructure)
Description
Set the selected segments secondary structure. Valid values are e=sheet, h=helix, l=loop, m=molecule, a=auto.
V1 Function Name
replace_ss
More Information
Details

structure.ShakeSidechainsAll

Function
void structure.ShakeSidechainsAll(integer iterations)
Description
Shake all sidechains.
V1 Function Name
New to V2
More Information
Details

structure.ShakeSidechainsSelected

Function
void structure.ShakeSidechainsSelected(integer iterations)
Description
Shake selected sidechains.
V1 Function Name
similar to do_shake
More Information
Details

structure.WiggleAll

Function
void structure.WiggleAll(integer iterations[, boolean backbone, boolean sidechains])
Description
Global wiggle all segments.
V1 Function Name
New to V2
More Information
Details

structure.WiggleSelected

Function
void structure.WiggleSelected(integer iterations[, boolean backbone, boolean sidechains])
Description
Global wiggle selected segments.
V1 Function Name
similar to do_global_wiggle_all
More Information
Details

ui functions

The ui functions perform miscellaneous "user interface" tasks.

ui.AlignGuide

Function
void ui.AlignGuide([integer segmentIndex])
Description
Aligns the guide. Aligns to a given segmentIndex if passed in.
V1 Function Name
New to V2
More Information
Details

ui.CenterViewport

Function
void ui.CenterViewport()
Description
Centers the viewport.
V1 Function Name
New to V2
More Information
Details

ui.GetPlatform

Function
string ui.GetPlatform()
Description
Gets the platform name.
V1 Function Name
get_platform
More Information
Details

ui.GetTrackName

Function
string ui.GetTrackName()
Description
Gets the track name.
V1 Function Name
New to V2
More Information
Details

undo functions

The undo functions control the undo stack.

undo.SetUndo

Function
void undo.SetUndo(boolean enable)
Description
Enable or disable pushes onto the undo stack.
V1 Function Name
New to V2
More Information
Details

user functions

The user functions return information about the logged-in user (player).

user.GetGroupID

Function
integer user.GetGroupID()
Description
Gets the group name.
V1 Function Name
New to V2
More Information
Details

user.GetGroupName

Function
string user.GetGroupName()
Description
Gets the group name.
V1 Function Name
New to V2
More Information
Details

user.GetPlayerID

Function
integer user.GetPlayerID()
Description
Gets the user name.
V1 Function Name
New to V2
More Information
Details

user.GetPlayerName

Function
string user.GetPlayerName()
Description
Gets the user name.
V1 Function Name
New to V2
More Information
Details

Unimplemented/disabled functions

Functions in this category do nothing. They were either never implemented, or implemented and then removed.

behavior.GetBandStrengthFactor

Function
number behavior.GetBandStrengthFactor()
Description
Get the global band strength factor.
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.GetBuriedSidechainShakeAccuracy

Function
number behavior.GetBuriedSidechainShakeAccuracy()
Description
Get the buried sidechain shake accuracy.
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.GetExposedSidechainShakeAccuracy

Function
number behavior.GetExposedSidechainShakeAccuracy()
Description
Get the exposed sidechain shake accuracy.
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.GetShakeAccuracy

Function
integer behavior.GetShakeAccuracy()
Description
Get the shake accuracy.
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.GetWiggleAccuracy

Function
number behavior.GetWiggleAccuracy()
Description
Get the wiggle accuracy.
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.SetBandStrengthFactor

Function
void behavior.SetBandStrengthFactor(number factor)
Description
Set the global band strength factor. (Range 0.5 to 1.5)
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.SetBuriedSidechainShakeAccuracy

Function
void behavior.SetBuriedSidechainShakeAccuracy(number accuracy)
Description
Set the buried sidechain shake accuracy. (Range 0 to 1)
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.SetExposedSidechainShakeAccuracy

Function
void behavior.SetExposedSidechainShakeAccuracy(number accuracy)
Description
Set the exposed sidechain shake accuracy. (Range 0 to 1)
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.SetShakeAccuracy

Function
void behavior.SetShakeAccuracy(integer accuracy)
Description
Set the shake accuracy. (Range 0 to 4)
V1 Function Name
Unimplemented V2 function
More Information
Details

behavior.SetWiggleAccuracy

Function
void behavior.SetWiggleAccuracy(number accuracy)
Description
Set the wiggle accuracy. (Range 0.0 to 7.0)
V1 Function Name
Unimplemented V2 function
More Information
Details
Advertisement