Fandom

Foldit Wiki

Foldit Lua Function rotamer.SetRotamer

1,465pages on
this wiki
Add New Page
Comments0 Share

rotamer.SetRotamer Edit

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


rotamer.GetCount Edit

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

Remarks Edit

Sample Edit

Code will set all sidechains to best "sidechain" score part position. It will kill global score in the process (create clashes).

for s=1, structure.GetCount() do
  save.Quicksave(4)
  scr=current.GetSegmentEnergySubscore(s,'sidechain')
  for r=1,rotamer.GetCount(s) do
    rotamer.SetRotamer(s, r)
    if current.GetSegmentEnergySubscore(s,'sidechain')>scr then
      save.Quicksave(4)
    end
  end
  save.Quickload(4)
end

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.