- table structure.GetCuts()
- Returns a list of segment indices of all cuts.
- V1 Function Name
- New to V2
structure.GetCuts returns a table listing the segment indices of all open cutpoints. Open cutpoints mean the protein's score is invalid for the purposes of competition in Foldit.
An open cutpoint can potentially be closed by structure.DeleteCut, but the ends of the cut must be close enough and in the proper spatial orientation, or the cutpoint remains open.
The cutpoint follows the segment index. For example, a segment index of 25 means there's a cutpoint between segments 25 and 26.
Example[edit | edit source]
The table returned by structure.GetCuts is a simple list of segment numbers.
This example lists each open cutpoint and attempts to close it. structure.DeleteCut doesn't return an indication of success or failure, so the solution is to list the open cuts again, to see what remains:
segs = structure.GetCuts () print ( #segs .. " open cutpoints found" ) for ii = 1, #segs do print ( "open cutpoint " .. ii .. " at segment " .. segs [ ii ] ) structure.DeleteCut ( segs [ ii ] ) end segs2 = structure.GetCuts () print ( #segs2 .. " open cutpoints found after attempting to close them" ) for ii = 1, #segs2 do print ( "open cutpoint " .. ii .. " at segment " .. segs2 [ ii ] ) end
Producing output like:
3 open cutpoints found open cutpoint 1 at segment 25 open cutpoint 2 at segment 64 open cutpoint 3 at segment 87 0 open cutpoints found after attempting to close them