{% import "bootstrap/wtf.html" as wtf %} {% from "utils.html" import comments_table %} {% from "cases/utils.html" import pretty_link_variant %} {% from "variants/indicators.html" import pin_indicator, causative_badge, clinical_assessments_badge, comments_badge, dismissals_badge, evaluations_badge, group_assessments_badge, matching_manual_rank, research_assessments_badge %} {% macro variant_rank_score(variant, uid, other_score_as_tooltip=False) %} {% if variant.rank_score is defined and variant.rank_score is not none %} {{ variant.rank_score|int }} {% endif %} {% if variant.norm_rank_score is defined and variant.norm_rank_score is not none %} ({{ variant.norm_rank_score|round(2) }}) {% endif %} {% if variant.rank_score_other %} {% if other_score_as_tooltip %} {# Capture the macro output as a string #} {% set badge_html = variant_rank_score_other(variant, other_score_as_tooltip) | replace('"', '"') %} ... {% else %} {{ variant_rank_score_other(variant, other_score_as_tooltip) }} {% endif %} {% endif %} {% endmacro %} {% macro variant_rank_score_other(variant, other_score_as_tooltip) %} {% if variant.rank_score_other %} {% for score_name, score in variant.rank_score_other.items() %} {{ score_name }}: {{ '%.6f'|format(score.value) }} {% endfor %} {% endif %} {% endmacro %} {% macro filter_script_main(cytobands) %} {% endmacro %} {% macro callers_cell(variant) %} {% for filter in variant.filters %} {{ filter.label }} {% endfor %} {% for name, caller in variant.callers %} {{ name }} {% endfor %} {% endmacro %} {% macro mark_heteroplasmic_mt(individuals, samples) %} {% for ind in individuals if ind.phenotype == 2 %} {% for gt in samples|selectattr("sample_id", "equalto", ind.individual_id) %} {% if gt.alt_frequency and gt.alt_frequency < 0.9 and gt.alt_frequency != -1 %} {{ (100*gt.alt_frequency)|round(1) }}% {% endif %} {% endfor %} {% endfor %} {% endmacro %} {% macro archived_observations_filter(form) %} {% if config.SHOW_OBSERVED_VARIANT_ARCHIVE and config.SHOW_OBSERVED_VARIANT_ARCHIVE is true %} {{ form.local_obs_old.label(class="control-label") }} {{ form.local_obs_old(class="form-control") }} {% endif %} {% endmacro %} {% macro archived_observations_cancer_filters(form) %} {% if config.SHOW_OBSERVED_VARIANT_ARCHIVE and config.SHOW_OBSERVED_VARIANT_ARCHIVE is true %}
{{ wtf.form_field(form.local_obs_old) }}
{{ wtf.form_field(form.local_obs_cancer_somatic_old) }}
{{ wtf.form_field(form.local_obs_cancer_somatic_panel_old) }}
{{ wtf.form_field(form.local_obs_cancer_germline_old) }}
{% endif %} {% endmacro %} {% macro filter_form_footer(form, result_size, total_variants, page, nvars, institute) %} {% endmacro %} {% macro dismiss_variants_block(dismiss_variant_options, institute, case, show_dismiss_block) %}
Dismiss selected variants:
{% endmacro %} {% macro toggle_dismiss_variants_block() %} {% endmacro %} {% macro compounds_table(institute, case, compounds, is_popover) %} {% set is_popover = is_popover|default(false) %} {% endif %} {% for compound in compounds %} {% if compound.is_dismissed %} {% else %} {% endif %} {% endfor %}
Variant Combined score {% if not is_popover %} ? Rank score Gene annotation Func. annotation
{% if compound.not_loaded %} {{ compound.display_name|truncate(20, True) }} (not loaded) {% elif is_popover %} {{ compound.display_name|truncate(20, True) }} {% else %} {{ compound.display_name|truncate(20, True) }} {% if 'suspects' in case and compound.variant in case.suspects %} {% endif %} {% endif %} {{ compound.combined_score }} {{ compound.rank_score }} {% for annotation in compound.region_annotations %} {{ annotation }}
{% endfor %}
{% for annotation in compound.functional_annotations %} {{ annotation }}
{% endfor %}
{% endmacro %} {% macro overlapping_tooltip_table(institute, case, overlapping) %} {% for variant in overlapping %} {% endfor %}
Pos Type Length Rank score
{{ pretty_link_variant(variant, case) }} {{ variant.sub_category }} {{ variant.length if variant.length and variant.length < 100000000000 else '-' }} {{ variant.rank_score }}
{% endmacro %} {% macro variants_common_filters(form, type) %}
{{ form.gene_panels.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering. Panels marked with an asterisk do not belong to the case's clinical panels. ") }} {{ form.gene_panels_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Check this box to exclude from the search any gene listed in selected 'Gene Panels', 'Symbol file' or provided in the 'HGNC Symbols/Ids' field.") }} {{form.gene_panels_exclude}} {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
{% if type == "snv" %} {{ form.symbol_file.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Load an HGNC gene symbol list file; a text file with one gene symbol starting each row. Extra columns separated with tab are ignored. Comment rows starting with # are ignored.") }} {{ form.symbol_file(class="form-control-file") }} {% elif type == "sv" %} {{ form.svtype.label(class="control-label") }} {{ form.svtype(class="form-control selectpicker", data_style="btn-secondary") }} {% elif type == "mei" %} {{ form.mei_name.label(class="control-label") }} {{ form.mei_name(class="form-control", data_style="btn-secondary") }} {% endif %}
{{ form.region_annotations.label(class="control-label") }} {{ form.region_annotations(class="selectpicker", data_style="btn-secondary") }}
{{ form.functional_annotations.label(class="control-label") }} {{ form.functional_annotations(class="selectpicker", data_style="btn-secondary") }}
{{ form.genetic_models.label(class="control-label") }} {{ form.genetic_models(class="selectpicker", data_style="btn-secondary") }}
{{ form.genotypes.label(class="control-label") }} {{ form.genotypes(class="selectpicker", data_style="btn-secondary") }}
{% endmacro %} {% macro variant_size_filter(form) %}
{{ form.size_selector.label(class="control-label") }}
{{ form.size_selector(class="form-select") }} {{ form.size(class="form-control") }}
{% endmacro %} {% macro filters_form_header(result_size, total_variants) %}
Filter returns {{ result_size }} / {{ total_variants }} variants.
{% endmacro %} {% macro snv_filters(form, institute, case, filters)%} {{ variants_common_filters(form, "snv") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.cadd_score.label(class="control-label") }} {{ form.cadd_score(class="form-control") }}
{{ form.cadd_inclusive.label(class="form-check-label", data_bs_toggle="tooltip", data_bs_placement="top", title="Include empty CADD") }} {{ form.cadd_inclusive(class="form-check-input", type="checkbox") }}
{{ form.revel.label(class="control-label") }} {{ form.revel(class="form-control") }}
{{ form.spidex_human.label(class="control-label") }} {{ form.spidex_human(class="selectpicker", data_style="btn-secondary") }}
{{ form.clinsig.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Germline classification criteria.") }} {{ form.clinsig_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Exclude variants with clinical significance among the selected categories.") }} {{form.clinsig_exclude}} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ form.clinvar_trusted_revstat(class="form-check-input") }} {{ form.clinvar_trusted_revstat.label(class="form-check-label", data_bs_toggle="tooltip", data_bs_placement="top", title="Limit search to variants with trusted ClinVar revision status levels: mult, multiple_submitters, single, single_submitter, exp, reviewed_by_expert_panel, guideline, practice_guideline.") }}
{{ form.clinvar_tag(class="form-check-input") }} {{ form.clinvar_tag.label(class="form-check-label", data_bs_toggle="tooltip", data_bs_placement="top", title="Return only variants with annotated ClinVar significance.") }}
{{ form.prioritise_clinvar(class="form-check-input") }} {{ form.prioritise_clinvar.label(class="form-check-label", data_bs_toggle="tooltip", data_bs_placement="top", title="Include variants matching the selected ClinVar conditions, in addition to those found using the other search criteria (broadens the search). Note that variants excluded using ClinVar tags will still be returned when found using the other search criteria.") }}
{{ form.gnomad_frequency.label(class="control-label") }} {{ form.gnomad_frequency(class="form-control") }}
{{ archived_observations_filter(form) }}
{{ form.chrom.label(class="control-label") }} {{ form.chrom(class="selectpicker", data_style="btn-secondary") }}
{{ wtf.form_field(form.start) }}
{{ wtf.form_field(form.end) }}
{{ wtf.form_field(form.cytoband_start) }}
{{ wtf.form_field(form.cytoband_end) }}
{{ variant_size_filter(form) }}
{{ form.chrom_pos.label(class="control-label") }}
{{ form.chrom_pos(class="form-control") }}
{{ form.compound_rank_score.label(class="control-label", data_toggle="tooltip", data_placement="top", title="Shade compounds at this score or below as if dismissed") }}
{{ form.compound_rank_score(class="form-control", placeholder="example: 10", onchange="this.form.submit()") }}
{{ form.compound_follow_filter(class="form-check-input", type="checkbox", onchange="this.form.submit()") }}{{ form.compound_follow_filter.label(class="form-check-label ms-1", data_bs_toggle="tooltip", data_bs_placement="top", title="Shade compounds as if dismissed by essentially the same filter as the main variant. CADD, CLINSIG, Frequency, function, position, region, SPIDEX, and variant type shade and hide, but chromosome, gene panel, and inheritance model do not. Checkbox ClinVar hits is not considered. Checkbox Always show CLNSIG disables ClinVar shading for the compound. Not loaded compounds cannot be evaluated and instead become shaded.") }}
{{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
{{ form.clinical_filter(class="btn btn-secondary form-control", onclick="resetPage()") }}
{{ form.export(class="btn btn-warning form-control") }}
{{ stash_filter_buttons(form, institute, case) }}
{% endmacro %} {% macro mei_filters(form, institute, case, filters)%} {{ variants_common_filters(form, "mei") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.clinsig.label(class="control-label") }} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ form.swegen_freq.label(class="control-label", data_toggle="tooltip", data_placement="top", title="Display variants with less than this fraction of cases in SweGen.") }} {{ form.swegen_freq(class="form-control") }}
{{ archived_observations_filter(form) }}
{{ form.chrom.label(class="control-label") }} {{ form.chrom(class="selectpicker", data_style="btn-secondary") }}
{{ wtf.form_field(form.start) }}
{{ wtf.form_field(form.end) }}
{{ wtf.form_field(form.cytoband_start) }}
{{ wtf.form_field(form.cytoband_end) }}
{{ form.chrom_pos.label(class="control-label") }}
{{ form.chrom_pos(class="form-control") }}
{{ form.compound_rank_score.label(class="control-label", data_toggle="tooltip", data_placement="top", title="Shade compounds at this score or below as if dismissed") }}
{{ form.compound_rank_score(class="form-control", placeholder="example: 10", onchange="this.form.submit()") }}
{{ form.compound_follow_filter(class="form-check-input", type="checkbox", onchange="this.form.submit()") }}{{ form.compound_follow_filter.label(class="form-check-label ms-1", data_bs_toggle="tooltip", data_bs_placement="top", title="Shade compounds as if dismissed by essentially the same filter as the main variant. CADD, CLINSIG, Frequency, function, position, region, SPIDEX, and variant type shade and hide, but chromosome, gene panel, and inheritance model do not. Checkbox ClinVar hits is not considered. Checkbox Always show CLNSIG disables ClinVar shading for the compound. Not loaded compounds cannot be evaluated and instead become shaded.") }}
{{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
{{ form.clinical_filter(class="btn btn-secondary form-control", onclick="resetPage()") }}
{{ form.export(class="btn btn-warning form-control") }}
{{ stash_filter_buttons(form, institute, case) }}
{% endmacro %} {% macro str_filters(form, institute, case, filters) %}
{{ form.gene_panels.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering. Panels marked with an asterisk do not belong to the case's clinical panels.") }} {{ form.gene_panels_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Check this box to exclude from the search any gene listed in selected 'Gene Panels', 'Symbol file' or provided in the 'HGNC Symbols/Ids' field.") }} {{form.gene_panels_exclude}} {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.chrom.label(class="control-label") }} {{ form.chrom(class="selectpicker", data_style="btn-secondary") }}
{{ wtf.form_field(form.start) }}
{{ wtf.form_field(form.end) }}
{{ wtf.form_field(form.cytoband_start) }}
{{ wtf.form_field(form.cytoband_end) }}
{{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
{{ form.export(class="btn btn-warning form-control") }}
{{ stash_filter_buttons(form, institute, case) }}
{% endmacro %} {% macro sv_filters(form, institute, case) %}
{{ variants_common_filters(form, "sv") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.decipher.label(class="form-check-label") }} {{ form.decipher(class="form-check-input",type="checkbox") }}
{{ form.clinsig.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Germline classification criteria.") }} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ form.gnomad_frequency.label(class="control-label") }} {{ form.gnomad_frequency(class="form-control") }}
{{ archived_observations_filter(form) }}
{{ form.clingen_ngi.label(class="control-label") }} {{ form.clingen_ngi(class="form-control") }}
{{ form.swegen.label(class="control-label") }} {{ form.swegen(class="form-control") }}
{{ form.chrom.label(class="control-label") }} {{ form.chrom(class="selectpicker", data_style="btn-secondary") }}
{{ wtf.form_field(form.start) }}
{{ wtf.form_field(form.end) }}
{{ wtf.form_field(form.cytoband_start) }}
{{ wtf.form_field(form.cytoband_end) }}
{{ variant_size_filter(form) }}
{{ wtf.form_field(form.chrom_pos) }}
{{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
{{ form.clinical_filter(class="btn btn-secondary form-control", onclick="resetPage()") }}
{{ form.export(class="btn btn-warning form-control") }}
{{ stash_filter_buttons(form, institute, case) }}
{% endmacro %} {% macro cancer_filters(form, institute, case) %} {{ form.csrf_token }} {{ form.variant_type() }}
{{ form.gene_panels.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering. Panels marked with an asterisk do not belong to the case's clinical panels.") }} {{ form.gene_panels_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Check this box to exclude from the search any gene listed in selected 'Gene Panels', 'Symbol file' or provided in the 'HGNC Symbols/Ids' field.") }} {{form.gene_panels_exclude}} {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
{{ form.region_annotations.label(class="control-label") }} {{ form.region_annotations(class="selectpicker", data_style="btn-secondary") }}
{{ form.functional_annotations.label(class="control-label") }} {{ form.functional_annotations(class="selectpicker", data_style="btn-secondary") }}
{{ form.genetic_models.label(class="control-label") }} {{ form.genetic_models(class="selectpicker", data_style="btn-secondary") }}
{{ form.clinsig.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Germline classification criteria.") }} {{ form.clinsig_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Exclude variants with clinical significance among the selected categories.") }} {{form.clinsig_exclude}} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ form.clinsig_onc.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="ClinVar oncogenicity criteria will be applied alongside the other search criteria, not as an alternative. Oncogenicity annotations are still sparse in ClinVar, so relying solely on them could be too restrictive.") }} {{ form.clinsig_onc_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Exclude variants with oncogenicity among the selected categories.") }} {{form.clinsig_onc_exclude}} {{ form.clinsig_onc(class="selectpicker", data_style="btn-secondary") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.cadd_score.label(class="control-label") }} {{ form.cadd_score(class="form-control") }}
{{ form.cadd_inclusive.label(class="control-label", data_toggle="tooltip", data_placement="top", title="Include empty CADD") }}
{{ form.cadd_inclusive() }}
{{ form.depth.label(class="control-label") }} {{ form.depth(class="form-control") }}
{{ form.alt_count.label(class="control-label") }} {{ form.alt_count(class="form-control") }}
{{ form.tumor_frequency.label(class="control-label") }} {{ form.tumor_frequency(class="form-control", min="0", max=1) }}
{{ form.control_frequency.label(class="control-label") }} {{ form.control_frequency(class="form-control", min="0", max=1) }}
{{ form.mvl_tag(class="form-check-input",type="checkbox") }} {{ form.mvl_tag.label(class="ms-2 form-check-label") }}
{{ form.clinvar_tag(class="form-check-input",type="checkbox") }} {{ form.clinvar_tag.label(class="ms-2 form-check-label") }}
{{ form.cosmic_tag(class="form-check-input",type="checkbox") }} {{ form.cosmic_tag.label(class="ms-2 form-check-label") }}
{{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
{{ form.export(class="btn btn-warning form-control") }}
{{ stash_filter_buttons(form, institute, case) }}
{% endmacro %} {% macro cancer_sv_filters(form, institute, case) %} {{ form.csrf_token }} {{ form.variant_type() }}
{{ form.gene_panels.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering. Panels marked with an asterisk do not belong to the case's clinical panels.") }} {{ form.gene_panels_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Check this box to exclude from the search any gene listed in selected 'Gene Panels', 'Symbol file' or provided in the 'HGNC Symbols/Ids' field.") }} {{form.gene_panels_exclude}} {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
{{ form.svtype.label(class="control-label") }} {{ form.svtype(class="form-control selectpicker", data_style="btn-secondary") }}
{{ form.region_annotations.label(class="control-label") }} {{ form.region_annotations(class="selectpicker", data_style="btn-secondary") }}
{{ form.functional_annotations.label(class="control-label") }} {{ form.functional_annotations(class="selectpicker", data_style="btn-secondary") }}
{{ form.genetic_models.label(class="control-label") }} {{ form.genetic_models(class="selectpicker", data_style="btn-secondary") }}
{{ form.clinsig.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Germline classification criteria.") }} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.somatic_score.label(class="control-label", data_toggle="tooltip", data_placement="top", title="Somatic score from SV caller. Filter away variants called with a score lower or equal to this value.") }} {{ form.somatic_score(class="form-control") }}
{{ form.depth.label(class="control-label", data_toggle="tooltip", data_placement="top", title="Tumor read depth") }} {{ form.depth(class="form-control") }}
{{ form.alt_count.label(class="control-label") }} {{ form.alt_count(class="form-control") }}
{{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
{{ form.export(class="btn btn-warning form-control") }}
{{ stash_filter_buttons(form, institute, case) }}
{% endmacro %} {% macro fusion_filters(form, institute, case, filters) %}
{{ form.gene_panels.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering.") }} {{ form.gene_panels_exclude.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="left", title="Check this box to exclude from the search any gene listed in selected 'Gene Panels', 'Symbol file' or provided in the 'HGNC Symbols/Ids' field.") }} {{form.gene_panels_exclude}} {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.chrom.label(class="control-label") }} {{ form.chrom(class="selectpicker", data_style="btn-secondary") }}
{{ wtf.form_field(form.start) }}
{{ wtf.form_field(form.end) }}
{{ wtf.form_field(form.cytoband_start) }}
{{ wtf.form_field(form.cytoband_end) }}
{{form.fusion_caller.label(class ="control-label")}} {{form.fusion_caller( class ="selectpicker", data_style="btn-secondary")}}
{{ wtf.form_field(form.fusion_score) }}
{{ wtf.form_field(form.ffpm) }}
{{ wtf.form_field(form.junction_reads) }}
{{ wtf.form_field(form.split_reads) }}
{{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
{{ form.export(class="btn btn-warning form-control") }}
{{ stash_filter_buttons(form, institute, case) }}
{% endmacro %} {% macro modal_prompt_filter_name(form) %} {% endmacro %} {% macro stash_filter_buttons(form, institute, case) %}
{{ modal_prompt_filter_name(form) }}
{{ form.filters(class="form-control") }}
{{ form.load_filter(class="btn btn-secondary", title="Load selected filter", data_toggle="tooltip", data_placement="top", disabled=form.filters.choices|length==0) }} {{ form.audit_filter(class="btn btn-secondary bg-info", title="Note selected filter audited for this case. Filter name, user and date will then show up on general report.", data_toggle="tooltip", data_placement="top", disabled=form.filters.choices|length==0) }} {{ form.delete_filter(class="btn btn-secondary bg-danger", data_toggle="tooltip", data_placement="top", id="stash_filter_delete", title="Delete selected filter for this institute.", disabled=form.filters.choices|length==0) }}
{% endmacro %} {% macro update_stash_filter_button_status(current_user, filters) %} {% for filter in filters %} if ($("#filters").val() === "{{ filter._id }}") { {% if filter.lock %} $("#stash_filter_padlock").removeClass("fa-lock-open"); $("#stash_filter_padlock").addClass("fa-lock"); $("#stash_filter_delete").attr("disabled", true); {% if filter.owner == current_user._id %} $("#lock_filter").attr("disabled", false); {% elif filter.owner and filter.owner != current_user._id %} $("#lock_filter").attr("disabled",true); {% endif %} {% else %} $("#stash_filter_padlock").removeClass("fa-lock"); $("#stash_filter_padlock").addClass("fa-lock-open"); $("#stash_filter_delete").attr("disabled",false); $("#lock_filter").attr("disabled",false); {% endif %} }; {% endfor %} {% endmacro %} {% macro gene_variant_link_href(variant, institute_id, case_display_name) %} {% if variant.category in ("sv", "cancer_sv") %} {{ url_for('variant.sv_variant', institute_id=institute_id, case_name=case_display_name, variant_id=variant._id) }} {% elif variant.category in ("cancer") %} {{ url_for('variant.cancer_variant', variant_id=variant._id, institute_id=institute_id, case_name=case_display_name) }} {% else %} {{ url_for('variant.variant', institute_id=institute_id, case_name=case_display_name, variant_id=variant._id) }} {% endif %} {% endmacro %} {% macro variant_link_href(variant, institute, case) %} {% if variant.category in ("sv", "cancer_sv") %} {{ url_for('variant.sv_variant', institute_id=institute._id, case_name=case.display_name, variant_id=variant._id) }} {% elif variant.category in ("cancer") %} {{ url_for('variant.cancer_variant', variant_id=variant._id, institute_id=institute._id, case_name=case.display_name, cancer='yes') }} {% else %} {{ url_for('variant.variant', institute_id=institute._id, case_name=case.display_name, variant_id=variant._id) }} {% endif %} {% endmacro %} {% macro cell_rank(variant, institute, case, form, manual_rank_options) %} {{ variant.variant_rank }}  {{ evaluations_badge(variant.evaluations) }} {{ research_assessments_badge(variant) }} {{ clinical_assessments_badge(variant) }} {{ group_assessments_badge(variant) }} {{ dismissals_badge(variant) }} {{ matching_manual_rank(variant) }} {{ comments_badge(institute, case, variant) }} {{ causative_badge(variant, case) }} {{ pin_indicator(variant, case) }} {% endmacro %} {% macro pagination_hidden_div(page, result_size) %} {% set per_page = 50 %} {% if result_size is not none %} {% set total_pages = (result_size // per_page) + (1 if result_size % per_page > 0 else 0) %} {% else %} {% set total_pages = 1 %} {% endif %} {% endmacro %} {% macro pagination_footer(page, result_size) %} {% set per_page = 50 %} {% if result_size is not none %} {% set total_pages = (result_size // per_page) + (1 if result_size % per_page > 0 else 0) %} {% else %} {% set total_pages = 1 %} {% endif %} {% set window = 2 %} {# pages around current page #} {# Clamp page number #} {% if page < 1 %} {% set page = 1 %} {% elif page > total_pages %} {% set page = total_pages %} {% endif %} {% if total_pages > 1 %} {% endif %} {% endmacro %} {% macro zygosity_badges(variant, case) %} {%- for sample in variant.samples -%} {%- for ind in case.individuals -%} {%- if sample.sample_id == ind.individual_id -%} {% set allele_depths = ['ref depth', sample.allele_depths[0]]|join(":") + ' - ' + ['alt depth', sample.allele_depths[1]]|join(":") %} {{zygosity_icon(sample.genotype_call)}} GQ:{{sample.genotype_quality}} AD:{{sample.allele_depths[0]}}|{{sample.allele_depths[1]}} {%- endif -%} {%- endfor -%} {%- endfor -%} {% endmacro %} {% macro zygosity_icon(genotype) %} {% if genotype is not none %} {% endif %} {% endmacro %} {% macro enable_variants_hotkeys() %} {% endmacro %}