FANDOM


structure.SetAminoAcid Edit

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

Remarks Edit

This function is useful only for segments that are "mutable", 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.

Sample Edit

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 )

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.