Profile
- Name
- Note_score(recipe)
- ID
- 109067
- Shared with
- Public
- Parent
- Score_note
- Children
- Created on
- June 02, 2025 at 16:45 PM UTC
- Updated on
- June 02, 2025 at 16:51 PM UTC
- Description
prints top_x worst scoring segments
it works!!
Best for
Code
Recipe = "Note_score"
Version = "1.0"
ReVersion = Recipe .. " " .. Version
function note_score(to_xth)
protienlength=structure.GetCount()
totalscore=current.GetEnergyScore()
min={}
for i=1,protienlength do
segmentscore=current.GetSegmentEnergyScore(i)
if table.getn(min)<to_xth then
table.insert(min, {i,segmentscore})
else
if min[to_xth][2]>segmentscore then
table.remove(min)
table.insert(min, {i,segmentscore})
end
end
table.sort(min, function (left, right) return left[2] < right[2] end)
end
for i=1,to_xth do
structure.SetNote(min[i][1], "#"..tostring(i).." : "..tostring(min[i][2]))
end
end
function create_dialog()
protienlength=structure.GetCount()
dlog=dialog.CreateDialog ( ReVersion )
dlog.sc0 = dialog.AddLabel ( "segment count = " .. protienlength )
dlog.top_x = dialog.AddSlider("top x scoring AAs",0,0,protienlength,0)
dlog.exit = dialog.AddButton ( "Exit" , 0 )
dlog.start = dialog.AddButton ( "Start" , 1 )
repeat
rc = dialog.Show ( dlog )
until rc < 2
return {rc,dlog.top_x.value}
end
rc=create_dialog()
if rc[1]==1 then
note_score(rc[2])
end