{% extends "humanization/humanness_layout.html" %} {% set title = result.input.name + " - Humanness Report" %} {% set MIN_SUBJ = result.oasis_params.min_fraction_subjects %} {% set RARE_FAMILY_FREQUENCY = 0.01 %} {% from 'humanization/humanize_alignment_component.html' import chain_humanness_header, format_sequence_tooltip, format_percent_subjects, format_aa_frequency_tooltip, format_aa_frequency, annot_num with context %} {% block main %}
{{ icon('chevron-left') }} Results
{% if result_index > 1 or result_index < len_results %}
{% if result_index > 1 %} {{ icon('caret-left-fill') }} {% else %} {% endif %} {{result_index}}/{{len_results}} {% if result_index < len_results %} {{ icon('caret-right-fill') }} {% else %} {% endif %}
{% endif %}

Humanness report {{ result.input.name }}

{{ '{:.0%}'.format(result.humanness.get_oasis_identity(MIN_SUBJ)) }} OASis identity

{{ result.humanness.get_num_human_peptides(MIN_SUBJ) }}/{{ result.humanness.get_num_peptides() }} peptides are considered human
(are found in at least {{ '{:.0%}'.format(MIN_SUBJ) }} of human subjects)

This corresponds to the {{ '{:.0%}'.format(result.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.humanness.get_germline_content()) }} germline content

Sequence identity with nearest heavy and light human germline sequences.

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

{% if result.humanness.vh %}

Heavy chain {{ chain_humanness_header(result.humanness.vh, MIN_SUBJ) }}

{{ oasis_sequence(result.humanness.vh) }} {% endif %} {% if result.humanness.vl %}

Light chain {{ chain_humanness_header(result.humanness.vl, MIN_SUBJ) }}

{{ oasis_sequence(result.humanness.vl) }} {% endif %} {% if result.humanness.vh %}

Heavy chain table

{{ oasis_table(result.humanness.vh) }} {% endif %} {% if result.humanness.vl %}

Light chain table

{{ oasis_table(result.humanness.vl) }} {% endif %} {% endblock %} {% macro oasis_sequence(chain_humanness) %}
{% for pos, aa, non_human_peptides in chain_humanness.get_positional_humanness(MIN_SUBJ) %}{% set peptide = chain_humanness.get_peptide(pos, edges=True) %}{% set num_non_human = (non_human_peptides | length) %}{% set freqs = chain_humanness.germline_family_residue_frequency.get(pos) %}{{ aa }}{% endfor %}
{% set v_germlines = chain_humanness.get_v_germline_chains(5) %} {% set j_germlines = chain_humanness.get_j_germline_chains(5) %} {% for i in range(v_germlines | length) %}
{% for pos, seq_aa in chain_humanness.imgt_chain %}{% set germline_aa = v_germlines[i][pos] or j_germlines[i][pos] or '-' %}{{ germline_aa }}{% endfor %} {{ v_germlines[i].name }}, {{ j_germlines[i].name }}
{% endfor %}
{% endmacro %} {% macro oasis_table(chain_humanness) %} {% for position, aa in chain_humanness.chain %} {{ oasis_table_row( position, aa, chain_humanness.peptides.get(position), chain_humanness.chain_type_residue_frequency.get(position), chain_humanness.germline_family_residue_frequency.get(position), chain_humanness.v_germline_family ) }} {% endfor %}
Position Amino acid OASis 9-mer peptide search
Region {{ list(chain_humanness.peptides)[0].scheme.title() }} AA Chain
Freq {{ info_icon('Residue frequency in {} chain at given {} position'.format(chain_humanness.chain.chain_type, chain_humanness.chain.scheme.title())) }}
Family
Freq {{ info_icon('Residue frequency in {} germline family at given {} position'.format(chain_humanness.v_germline_family, chain_humanness.chain.scheme.title())) }}
Peptide {{ info_icon('9-mer peptide starting at given position.') }} OAS
Subjects {{ info_icon('Percentage of OAS human subjects containing this peptide in their repertoire.') }}
OAS
Sequences {{ info_icon('Number of total antibody sequences containing this peptide across across all human subjects in OAS.') }}
{% endmacro %} {% macro oasis_table_row(position, aa, peptide, chain_freqs, family_freqs, v_germline_family) %} {{ position.get_region() }} {{ position }} {{ aa }} {{ format_aa_frequency(chain_freqs.get(aa, 0) if chain_freqs else None) }} {{ format_aa_frequency(family_freqs.get(aa, 0) if family_freqs else None) }} {% if peptide %} {{ peptide.seq }} {{ format_percent_subjects(peptide.fraction_oas_subjects) }} subjs {{ annot_num(peptide.num_oas_occurrences, 'seqs', 'seq') }} {% endif %} {% endmacro %}