<%inherit file="base.html.mako"/> <%def name="bits(x)"> ${'%.2fb'%(-x)}

Overall

<%! SCORE_PARTS=[ ('Total', 'total'), ('Amino Acid Score', 'amino_acid_score' ), ('Graph Score', 'structure_cost'), ] %> % for (title, key) in SCORE_PARTS: % endfor
LHS RHS
${title} ${bits(getattr(lhs.score, key))} ${bits(getattr(rhs.score, key))} ${bits(getattr(lhs.score, key) - getattr(rhs.score, key))}

Amino Acids

<% positions = sorted(enumerate(zip(lhs.positions, rhs.positions)), key = lambda x: -abs(x[1][0].score - x[1][1].score)) %> %for (index, (lhs_position, rhs_position)) in positions: %endfor
${index} ${bits(lhs_position.score)} ${bits(rhs_position.score)} ${bits(lhs_position.score - rhs_position.score)}