{% from "variants/indicators.html" import clinical_assessments_badge, research_assessments_badge %} {% from "clinvar/clinvar_howto.html" import clinvar_howto_modal %} {% macro matchmaker_modal(institute, case, suspects, mme_nodes ) %} {% endmacro %} {% macro modal_mme_delete(institute, case) %}
{% endmacro %} {% macro beacon_modal(institute, case) %}
{% endmacro %} {% macro variant_transcripts(gene) %} {% set n_primary_txs = namespace(count=0) %} {% if n_primary_txs.count > 5 %} .. other transcripts available for this variant are not shown.

{% endif %} {% endmacro %} {% macro pretty_variant(variant) %} {% if variant.category %} {% if variant.category in "str" %} {{ variant.str_repid }} {{ variant.alternative | replace("<", " ") | replace(">", "")}} {% elif variant.category in ("snv", "cancer") %} {% set display_genes = [] %} {% for gene in variant.genes %} {% if gene.hgvs_identifier and gene.hgnc_symbol %} {{ "" if display_genes.append(gene.hgnc_symbol + ' ' + gene.hgvs_identifier|truncate(20,True)) }} {% elif gene.hgnc_symbol %} {{ "" if display_genes.append(gene.hgnc_symbol) }} {% elif gene.hgvs_identifier and gene.hgnc_id %} {{ "" if display_genes.append( gene.hgnc_id|string + ' ' + gene.hgvs_identifier|truncate(20,True)) }} {% endif %} {% endfor %} {% if not display_genes %} {{ "" if display_genes.append( variant.simple_id|truncate(40,True) ) }} {% endif %} {{ display_genes|join(", ") }} {% elif variant.category == "outlier" %} {{ variant.sub_category|upper }} - {% if variant.genes %} {% for gene in variant.genes %} {% if gene.hgnc_symbol %} {{ gene.hgnc_symbol }} {% else %} {{gene.hgnc_id}} {% endif %} {% endfor %} - {% if variant.sub_category == "splicing" %} {{ variant.delta_psi }}Δψ {{ variant.potential_impact }} - fs {{ variant.causes_frameshift }} {% else %} {{ variant.l2fc }}{% if variant.l2fc > 0 %}↑{% elif variant.l2fc < 0 %}↓{% endif %} {% endif %} {% else %} {{ variant.gene_name_orig }} {% endif %} {% else %} {{ variant.sub_category|upper }}({{ variant.chromosome }}{{ variant.cytoband_start }}-{{ variant.end_chrom }}{{ variant.cytoband_end }}) {% endif %} {% endif %} {% endmacro %} {% macro pretty_link_variant(variant, case) %} {# Returns human readable links to the corresponding variant page #} {% if variant.category in ("mei", "str", "snv", "cancer") %} {% if variant.category == "cancer" %} {% else %} {% endif %} {% elif variant.category == "outlier" %} {% else %} {% endif %} {{ pretty_variant(variant) }} {% endmacro %} {% macro variant_validation_badge(variant) %} {% if variant.validation == 'True positive' %} Validated {% elif variant.validation == 'False positive' %} Validated {% elif variant.sanger_ordered %} Verification ordered {% endif %} {% endmacro %} {% macro tumor_allele_freq(variant) %} {% if variant.tumor %} {{ allele_div(variant.tumor, "Tumor") }} {% endif %} {% if variant.normal %} {{ allele_div(variant.normal, "Normal") }} {% endif %} {% endmacro %} {% macro causatives_list(causatives, partial_causatives, evaluated_variants, institute, case, manual_rank_options, cancer_tier_options) %} {% set already_displayed_variant_ids = [] %}
{% if case.track == 'cancer' %} Clinically significant {% else %} Causative variants ({{causatives|length + partial_causatives|length}}) {% endif %}
{% if not case.causatives|length and not case.partial_causatives|length %}
No causative variants
{% endif %}
{% endmacro %} {% macro allele_div(allele, type) %} {% if 'alt_freq' in allele %}
{{ allele.alt_freq|round(4) }}
{% endif %} {% endmacro %} {% macro suspects_list(suspects, institute, case, manual_rank_options, cancer_tier_options) %} {{ clinvar_howto_modal() }}
 Variants pinned ({{suspects|length}}) or included in a ClinVar submission({{ case.clinvar_variants.items()|length }}) ?
{{ clinvar_vars_summary(suspects, case, institute) }}
{% endmacro %} {% macro clinvar_var_status(variant, case, institute) %} {% if variant._id and variant.category != 'str' %}
{% if case.clinvar_variants and variant._id in case.clinvar_variants.keys() %} (included in ClinVar submission) {% elif variant.category in ('cancer', 'cancer_sv') %} {% else %} {% endif %}
{% endif %} {% endmacro %} {% macro clinvar_vars_summary(suspects, case, institute) %} {% if case.clinvar_variants %} {% if case.clinvar_variants_not_in_suspects | length >0 %}
 Variants present in a ClinVar submission, no longer pinned:
{% for entry in case.clinvar_variants_not_in_suspects %}
{{ pretty_link_variant(entry, case) }}
{% endfor %}
{% endif %} {% endif %} {% endmacro %} {% macro matching_causatives(other_causatives, institute, case, default=False) %}
{% endmacro %} {% macro matching_managed_variants(managed_variants, institute, case, default=False) %}
{% endmacro %} {% macro remove_form(url, hidden_input=None, button_name=None, button_value=None) %}
{% if hidden_input %} {% endif %}
{% endmacro %} {% macro sex_table_cell_content(ind) %} {% if ind.sex_human in ['female','male'] %} {% if ind.sex_human == 'female' %} F {% elif ind.sex_human == 'male' %} M {% else %} {{ind.sex_human}} {% endif %} {% endif %} {% if ind.confirmed_sex %} {% else %} {% endif %} {% endmacro %} {% macro filter_audits(audits, edit=none) %} {% set audit_query = namespace() %} {% for audit in audits %} {% set audit_query = audit.link|url_args %} {% endfor %}
Filters marked audited for case
{{ audit.subject }} ({{audit_query.variant_type if audit_query.variant_type else "type unavailable -"}} {{ audit_query.category if audit_query.category else "category unavailable"}}) was marked checked by {{ audit.user_name }} on {{audit.created_at.strftime('%Y-%m-%d')}}. {% if edit is true %} {% endif %}
{% endmacro %}