FANDOM


current.GetSegmentEnergySubscore Edit

Function
number current.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description
Get the current score part of the given segment.
V1 Function Name
Similar to get_segment_score_part

current.GetSegmentEnergySubscore returns the subscore for the specified score part of the specified segment in the "current" pose of the protein.

The function puzzle.GetPuzzleSubscoreNames can be used get a table containing the valid score part names.

ExampleEdit

The following code prints out all non-zero subscores for a protein.

function round ( ii )
    return ii - ii % 0.001
end
local scoreparts = {}
scoreparts = puzzle.GetPuzzleSubscoreNames()
print ( "Available scoreparts:") 
for ii = 1, #scoreparts do
    print ( "score part " .. ii .. " = " .. scoreparts [ ii ] )
end

for ii = 1, structure.GetCount () do
    print ("active subscores for segment " .. ii )
    for jj = 1, #scoreparts do
        local sub = round ( current.GetSegmentEnergySubscore ( ii, scoreparts [ jj ] ) )
        if sub ~= 0 then
            print ( scoreparts [ jj ] .. ": " .. sub )
        end
    end
end
Community content is available under CC-BY-SA unless otherwise noted.