Foldit Wiki
Register
Advertisement

structure.SetAminoAcid[]

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

structure.SetAminoAcid sets the amino acid for the specified segment of the protein.

This function is only useful for mutable segments, and fails silently is the segment is not mutable. A mutable segment can be changed to a different amino acid. Puzzles with mutable segments are called design puzzles.

See the description of the function structure.IsMutable for how to determine whether a segment is mutable.

The "aminoAcid" argument is a one-character code. See Amino Acids for the complete of amino acid codes.

Sample[]

This example shows a function that sets amino acids from a table for small 13-residue mutable puzzle.

-- variable
aaList =
{
    'a','g','n','v','p','q','a','g','g','y','r','s','n'
}
--function
function setAas ( tab )
    for ii = 1, #tab do
        structure.SetAminoAcid ( ii, tab [ ii ] )
    end
end
--call
setAas ( aaList )

A string can also be used instead of a table.

aaList = "agnvpqaggyrsn"
--function
function setAas ( tab )
    for ii = 1, #tab do
        structure.SetAminoAcid ( ii, aaList:sub ( ii, ii ) )
    end
end
--call
setAas ( aaList )
Advertisement