structure.SetSecondaryStructure Edit

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

structure.SetSecondaryStructure sets the secondary structure for the specified segment of the protein.

The following secondary structure codes are valid:

code type
H helix
E sheet
L loop
A auto

The "A" option applies the Auto Structures tool, which determines the presence of sheets and helixes based on patterns of hydrogen bonds.

The structure code "M" used for ligands (molecules) is accepted, but ignored. Any other code causes an error.


The following Lua codes sets segments with specific amino acids to helix. (The "MALEK" amino acids (M =methionine, A = alanine, L = leucine, E = glutamate, and K = lysine have a strong tendency to form helixes.)

for i=1,structure.GetCount() do
  local aaType=structure.GetAminoAcid(i)
  if  aaType=="m" 
      or aaType=="a" 
      or aaType=="l" 
      or aaType=="e" 
      or aaType=="k" then
Community content is available under CC-BY-SA unless otherwise noted.