{% extends "humanization/designer_layout.html" %} {% set title = result.input.name + " - Designer" %} {% set MIN_SUBJ = result.oasis_params.min_fraction_subjects %} {% set MIN_SAPIENS_SCORE = 0.01 %} {% set MIN_FAMILY_FREQ = 0.005 %} {% set RARE_FAMILY_FREQ = 0.01 %} {% from 'humanization/humanize_alignment_component.html' import format_percent_subjects, format_aa_frequency with context %} {% macro format_aa_frequency_tooltip(v_germline_family, aa, freqs) %} {% if freqs %} Frequency in {{ v_germline_family }}: {{ aa }}={{ format_aa_frequency(freqs.get(aa, 0) if freqs else none) }} {% else %} Frequency for {{ v_germline_family }} not available {% endif %} {% endmacro %} {% block main %}

Antibody Designer {{ result.input.name }}

{{ '{:.0%}'.format(result.humanized_humanness.get_oasis_identity(MIN_SUBJ)) }} OASis identity ({{ '+{:.0%}'.format(result.humanized_humanness.get_oasis_identity(MIN_SUBJ) - result.parental_humanness.get_oasis_identity(MIN_SUBJ)) }})  {{ info_icon('{}/{} peptides are considered human (are found in at least {:.0%} of human subjects)'.format(result.humanized_humanness.get_num_human_peptides(MIN_SUBJ), result.humanized_humanness.get_num_peptides(), MIN_SUBJ), s=22) }}

This corresponds to the {{ '{:.0%}'.format(result.humanized_humanness.get_oasis_percentile(MIN_SUBJ)) }} percentile {{ info_icon('Percentile of OASis identity among therapeutic mAbs at the current prevalence threshold. Zero percentile corresponds to the least human and 100% percentile corresponds to the most human mAb in the clinic, including all clinical stage human, humanized and murine therapeutics.') }}

{{ '{:.0%}'.format(result.humanized_humanness.get_germline_content()) }} germline content ({{ '+{:.0%}'.format(result.humanized_humanness.get_germline_content() - result.parental_humanness.get_germline_content()) }}) {{ info_icon('Sequence identity with nearest heavy and light human germline sequences', s=22) }}

{{ result.humanized_humanness.vh.v_germline_family }}{{ result.humanized_humanness.vh.v_germline_suffix }} {% if result.humanized_humanness.vh and result.humanized_humanness.vl %}+{% endif %} {{ result.humanized_humanness.vl.v_germline_family }}{{ result.humanized_humanness.vl.v_germline_suffix }}

{% if result.humanized_humanness.vh %}

Heavy chain

{{ chain_designer(result, result.parental_humanness.vh, result.humanized_humanness.vh, result.humanization.vh, 'vh') }} {% endif %} {% if result.humanized_humanness.vl %}

Light chain

{{ chain_designer(result, result.parental_humanness.vl, result.humanized_humanness.vl, result.humanization.vl, 'vl') }} {% endif %} {% endblock %} {% macro pos_tooltip(pos) %} {{ pos.scheme.title() }} {{ pos }} {% if pos.is_in_cdr() %} ({{ pos.get_region() }}) {% elif pos.cdr_definition == 'kabat' and pos.is_in_vernier() %} (Vernier zone) {% endif %} {% endmacro %} {% macro mutation_tooltip(pos, current_aa, new_aa, backmutate=False) %} {{ pos_tooltip(pos) }} {% if current_aa != new_aa and new_aa != '-' %} {% if backmutate %}
{{ aa_name(new_aa) }} → {{ aa_name(current_aa) }}
Click to revert mutation {% else %}
Click to mutate
{{ aa_name(current_aa) }} → {{ aa_name(new_aa) }} {% endif %} {% else %}
{{ aa_name(new_aa) }} {% endif %} {% endmacro %} {% macro chain_designer(result, parental_humanness, humanized_humanness, humanization, id) %}
{% for pos, aa, non_human_peptides in parental_humanness.get_positional_humanness(MIN_SUBJ) %}{% set num_non_human = (non_human_peptides | length) %}{% set peptide = parental_humanness.get_peptide(pos, edges=True) %}{% set freqs = parental_humanness.germline_family_residue_frequency.get(pos) %}{{ aa }}{% endfor %} Parental
{% for pos, aa, non_human_peptides in humanized_humanness.get_positional_humanness(MIN_SUBJ) %}{% set num_non_human = (non_human_peptides | length) %}{% set peptide = humanized_humanness.get_peptide(pos, edges=True) %}{% set freqs = humanized_humanness.germline_family_residue_frequency.get(pos) %}{{ aa }}{% endfor %} Result
{% for scores in humanization.get_top_scores(5, next=True) %}
{% for pos, aa, score in scores %}{% if score > MIN_SAPIENS_SCORE %}{{ aa if humanized_humanness.chain[pos] != aa else '·' }}{% else %}{% endif %}{% endfor %} Top #{{ loop.index }} score
{% endfor %}
{% for freqs in humanized_humanness.get_top_freqs(5) %}
{% for pos, aa, freq in freqs %}{% if freq > MIN_FAMILY_FREQ %}{{ aa if humanized_humanness.chain[pos] != aa else '·' }}{% else %}{% endif %}{% endfor %} Top #{{ loop.index }} frequency
{% endfor %}
{% set v_germlines = humanized_humanness.get_v_germline_chains(5) %} {% set j_germlines = humanized_humanness.get_j_germline_chains(5) %} {% for i in range(v_germlines | length) %}
{% for (imgt_pos, seq_aa), (pos, _) in zip(humanized_humanness.imgt_chain, humanized_humanness.chain) %}{% set germline_aa = v_germlines[i][imgt_pos] or j_germlines[i][imgt_pos] or '-' %}{{ germline_aa if humanized_humanness.chain[pos] != germline_aa else '·' }}{% endfor %} {{ v_germlines[i].name }}, {{ j_germlines[i].name }}
{% endfor %}
{% endmacro %} {% block scripts %} {% endblock %}