{% import "bootstrap/wtf.html" as wtf %} {% from "utils.html" import comments_table %} {% 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 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_germline_old) }}
{% endif %} {% endmacro %} {% macro filter_form_footer(form, result_size, total_variants, more_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 }} (not loaded) {% elif is_popover %} {{ compound.display_name }} {% 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 svs_table(institute, case, overlapping) %} {% for sv in overlapping %} {% endfor %}
Region Type Length Rank score
{{ sv.chromosome }}{{ sv.cytoband_start }} {{ sv.sub_category }} {{ sv.length if sv.length < 100000000000 else "-" }} {{ sv.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.") }} {{ 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 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") }} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ form.clinsig_confident_always_returned.label(class="control-label", data_bs_toggle="tooltip", data_bs_placement="top", title="Always show selected CLINSIG entries with trusted revision status levels.") }}
{{ form.clinsig_confident_always_returned() }}
{{ form.clinvar_tag() }} {{ form.clinvar_tag.label(class="ms-2") }}
{{ 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", data_actions_box="true") }}
{{ 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") }}
Reset filters
{{ 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", data_actions_box="true") }}
{{ 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") }}
Reset filters
{{ 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.") }} {{ 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", data_actions_box="true") }}
{{ 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") }}
Reset filters
{{ 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.size.label(class="control-label") }} {{ form.size(class="form-control", type="number") }}
{{ form.size_shorter.label(class="form-check-label") }} {{ form.size_shorter(class="form-check-input",type="checkbox") }}
{{ form.decipher.label(class="form-check-label") }} {{ form.decipher(class="form-check-input",type="checkbox") }}
{{ form.clinsig.label(class="control-label") }} {{ 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", data_actions_box="true") }}
{{ wtf.form_field(form.start) }}
{{ wtf.form_field(form.end) }}
{{ wtf.form_field(form.cytoband_start) }}
{{ wtf.form_field(form.cytoband_end) }}
{{ 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") }}
Reset filters
{{ 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.") }} {{ 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") }} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ 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.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.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.") }} {{ 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") }} {{ form.clinsig(class="selectpicker", data_style="btn-secondary") }}
{{ form.hgnc_symbols.label(class="control-label") }} {{ form.hgnc_symbols(class="form-control") }}
{{ form.size.label(class="control-label") }} {{ form.size(class="form-control", type="number") }}
{{ form.size_shorter.label(class="form-check-label") }} {{ form.size_shorter(class="form-check-input",type="checkbox") }}
{{ 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.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", data_actions_box="true") }}
{{ 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", data_actions_box="true")}}
{{ 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 cell_rank(variant, institute, case, form, manual_rank_options) %} {% if variant.category in ("sv", "cancer_sv") %} {% else %} {% endif %} {{ variant.variant_rank }}  {{ evaluations_badge(variant) }} {{ 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) %} {# Used inside filters form to introduce submit buttons for footer pagniation #} {% endmacro %} {% macro pagination_footer(more_variants, page) %} {# Used outside filters form to introduce footer pagination labels #}
{% if not more_variants %}
No more variants to display
{% endif %}
{% if page > 1 %}
{% endif %} {% if page > 2 %}
{% endif %} {% if more_variants %}
{% endif %}
{% endmacro %}