scout-browser 4.85__py3-none-any.whl → 4.86__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. scout/__version__.py +1 -1
  2. scout/adapter/mongo/base.py +17 -14
  3. scout/adapter/mongo/case.py +20 -1
  4. scout/adapter/mongo/filter.py +36 -1
  5. scout/adapter/mongo/omics_variant.py +145 -0
  6. scout/adapter/mongo/query.py +13 -3
  7. scout/adapter/mongo/variant.py +10 -4
  8. scout/build/case.py +5 -0
  9. scout/build/variant/variant.py +1 -0
  10. scout/constants/__init__.py +3 -1
  11. scout/constants/case_tags.py +1 -0
  12. scout/constants/clinvar.py +1 -1
  13. scout/constants/file_types.py +31 -0
  14. scout/constants/filters.py +4 -0
  15. scout/constants/indexes.py +30 -13
  16. scout/constants/variant_tags.py +3 -0
  17. scout/demo/643594.clinical.mei.vcf.gz +0 -0
  18. scout/demo/643594.clinical.mei.vcf.gz.tbi +0 -0
  19. scout/demo/643594.config.yaml +4 -0
  20. scout/demo/drop/fraser_top_hits_clinical.tsv +5 -0
  21. scout/demo/drop/outrider_top_hits_clinical.tsv +10 -0
  22. scout/load/setup.py +4 -4
  23. scout/models/case/case_loading_models.py +25 -2
  24. scout/models/omics_variant.py +227 -0
  25. scout/parse/omics_variant/__init__.py +11 -0
  26. scout/parse/omics_variant/drop.py +19 -0
  27. scout/parse/variant/callers.py +6 -3
  28. scout/parse/variant/frequency.py +10 -2
  29. scout/server/app.py +4 -1
  30. scout/server/blueprints/alignviewers/controllers.py +35 -24
  31. scout/server/blueprints/alignviewers/templates/alignviewers/igv_sashimi_viewer.html +19 -15
  32. scout/server/blueprints/alignviewers/templates/alignviewers/igv_viewer.html +45 -5
  33. scout/server/blueprints/alignviewers/templates/alignviewers/utils.html +1 -1
  34. scout/server/blueprints/alignviewers/views.py +10 -2
  35. scout/server/blueprints/cases/controllers.py +3 -0
  36. scout/server/blueprints/cases/templates/cases/case.html +27 -9
  37. scout/server/blueprints/cases/templates/cases/case_report.html +2 -17
  38. scout/server/blueprints/cases/templates/cases/phenotype.html +8 -5
  39. scout/server/blueprints/cases/templates/cases/utils.html +26 -3
  40. scout/server/blueprints/clinvar/controllers.py +9 -3
  41. scout/server/blueprints/dashboard/controllers.py +44 -13
  42. scout/server/blueprints/dashboard/static/charts.js +46 -36
  43. scout/server/blueprints/dashboard/templates/dashboard/dashboard_general.html +2 -2
  44. scout/server/blueprints/institutes/forms.py +2 -0
  45. scout/server/blueprints/institutes/templates/overview/cases.html +6 -4
  46. scout/server/blueprints/institutes/templates/overview/gene_variants.html +40 -27
  47. scout/server/blueprints/institutes/templates/overview/institute_sidebar.html +1 -1
  48. scout/server/blueprints/institutes/views.py +5 -12
  49. scout/server/blueprints/omics_variants/__init__.py +1 -0
  50. scout/server/blueprints/omics_variants/controllers.py +122 -0
  51. scout/server/blueprints/omics_variants/templates/omics_variants/outliers.html +262 -0
  52. scout/server/blueprints/omics_variants/views.py +106 -0
  53. scout/server/blueprints/panels/controllers.py +1 -7
  54. scout/server/blueprints/panels/templates/panels/panels.html +12 -4
  55. scout/server/blueprints/panels/views.py +9 -11
  56. scout/server/blueprints/variant/templates/variant/buttons.html +7 -2
  57. scout/server/blueprints/variant/templates/variant/str-variant-reviewer.html +1 -1
  58. scout/server/blueprints/variant/templates/variant/utils.html +1 -1
  59. scout/server/blueprints/variant/utils.py +54 -103
  60. scout/server/blueprints/variant/views.py +1 -0
  61. scout/server/blueprints/variants/controllers.py +1 -4
  62. scout/server/blueprints/variants/forms.py +42 -0
  63. scout/server/blueprints/variants/templates/variants/utils.html +8 -4
  64. scout/server/blueprints/variants/views.py +28 -7
  65. scout/server/config.py +4 -0
  66. scout/server/extensions/clinvar_extension.py +7 -7
  67. scout/server/links.py +2 -2
  68. scout/server/templates/bootstrap_global.html +1 -4
  69. scout/server/templates/utils.html +3 -3
  70. scout/server/utils.py +4 -1
  71. {scout_browser-4.85.dist-info → scout_browser-4.86.dist-info}/METADATA +10 -10
  72. {scout_browser-4.85.dist-info → scout_browser-4.86.dist-info}/RECORD +76 -66
  73. {scout_browser-4.85.dist-info → scout_browser-4.86.dist-info}/WHEEL +1 -1
  74. {scout_browser-4.85.dist-info → scout_browser-4.86.dist-info}/LICENSE +0 -0
  75. {scout_browser-4.85.dist-info → scout_browser-4.86.dist-info}/entry_points.txt +0 -0
  76. {scout_browser-4.85.dist-info → scout_browser-4.86.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  {% extends "layout.html" %}
2
- {% from "variants/components.html" import gene_cell, frequency_cell_general %}
2
+ {% from "variants/components.html" import frequency_cell_general, variant_funct_anno_cell, variant_gene_symbols_cell, variant_region_anno_cell %}
3
3
  {% from "utils.html" import comments_table %}
4
4
  {% from "overview/institute_sidebar.html" import institute_actionbar %}
5
5
  {% from "variants/utils.html" import pagination_footer, pagination_hidden_div %}
@@ -39,12 +39,12 @@
39
39
  <thead>
40
40
  <tr>
41
41
  <th scope="col">Case : Score</th>
42
+ <th scope="col">Var</th>
42
43
  <th scope="col">Gene</th>
43
44
  <th scope="col">Pop Freq</th>
44
45
  <th scope="col">CADD</th>
45
46
  <th scope="col">Region</th>
46
47
  <th scope="col">Function</th>
47
- <th scope="col">HGVS</th>
48
48
  </tr>
49
49
  </thead>
50
50
  <tbody>
@@ -55,20 +55,12 @@
55
55
  <tr>
56
56
  {% endif %}
57
57
  <td class="align-middle">{{ cell_rank(variant) }}</td>
58
- <td class="align-middle">{{ gene_cell(variant) }}</td>
58
+ <td class="align-middle">{{ pretty_link_no_gene(variant) }} </td>
59
+ <td class="align-middle">{{ variant_gene_symbols_cell(variant) }}</td>
59
60
  <td class="align-middle">{{ frequency_cell_general(variant) }}</td>
60
61
  <td class="align-middle">{{ cell_cadd(variant) }}</td>
61
- <td class="align-middle">
62
- {% for annotation in variant.region_annotations %}
63
- <div>{{ annotation }}</div>
64
- {% endfor %}
65
- </td>
66
- <td class="align-middle">
67
- {% for annotation in variant.functional_annotations %}
68
- <div>{{ annotation }}</div>
69
- {% endfor %}
70
- </td>
71
- <td class="align-middle"> {{ (variant.hgvs or '')|url_decode }}</td>
62
+ <td class="align-middle">{{ variant_region_anno_cell(variant) }}</td>
63
+ <td class="align-middle">{{ variant_funct_anno_cell(variant) }}</td>
72
64
  </tr>
73
65
  {% endfor %}
74
66
  {% if form.hgnc_symbols.data == [] %}
@@ -80,7 +72,10 @@
80
72
  {% elif variants == [] %}
81
73
  <tr>
82
74
  <td colspan=7>
83
- No variants matching your query in genes: {{form.hgnc_symbols.data|join(", ")}}
75
+ No variants matching your query in genes: {{form.hgnc_symbols.data|join(", ")}}.
76
+ {% if "research" not in form.variant_type.data %}
77
+ Consider a lower rank score threshold or including research variants.
78
+ {% endif %}
84
79
  </td>
85
80
  </tr>
86
81
  {% endif %}
@@ -92,12 +87,26 @@
92
87
  </form>
93
88
  {% endmacro %}
94
89
 
95
- {% macro cell_rank(variant) %}
96
- <a
97
- href="{{ url_for('variant.variant', institute_id=variant.institute,
90
+
91
+ {% macro pretty_link_no_gene(variant) %}
92
+ {% if variant.category == "sv" %}
93
+ <a href="{{ url_for('variant.sv_variant', institute_id=variant.institute,
98
94
  case_name=variant.case_display_name, variant_id=variant._id) }}" target="_blank">
99
- {{ variant.case_display_name}}
100
- </a>
95
+ {% if hgvs in variant %}
96
+ {{ variant.hgvs }}
97
+ {% else %}
98
+ {{ variant.sub_category|upper }}({{ variant.chromosome }}{{ variant.cytoband_start }}-{{ variant.end_chrom }}{{ variant.cytoband_end }})
99
+ {% endif %}
100
+ {% else %}
101
+ <a href="{{ url_for('variant.variant', institute_id=variant.institute,
102
+ case_name=variant.case_display_name, variant_id=variant._id) }}" target="_blank">
103
+ {{ (variant.hgvs or '')|url_decode }}
104
+ {% endif %}
105
+ </a>
106
+ {% endmacro %}
107
+
108
+ {% macro cell_rank(variant) %}
109
+ {{ variant.case_display_name }}
101
110
  :
102
111
  <span class="badge bg-info">{{ variant.rank_score|int }}</span>
103
112
  {% endmacro %}
@@ -123,29 +132,33 @@
123
132
  {{ form.hgnc_symbols.label(class="control-label") }}
124
133
  {{ form.hgnc_symbols(class="form-control") }}
125
134
  </div>
126
- <div class="col col-md-3">
127
- <label class="control-label">Rank Score ></label>
135
+ <div class="col col-md-1">
136
+ <label class="control-label" for="rank_score">Rank Score</label>
128
137
  <input type="number" class="form-control" id="rank_score" name="rank_score" min="5" value={{form.rank_score.data}}>
129
138
  </div>
130
- <div class="col col-md-3">
139
+ <div class="col col-md-2">
131
140
  {{ form.variant_type.label(class="control-label") }}
132
141
  {{ form.variant_type(class="form-control", class="selectpicker", data_style="btn-secondary") }}
133
142
  </div>
143
+ <div class="col col-md-2">
144
+ {{ form.category.label(class="control-label") }}
145
+ {{ form.category(class="form-control", class="selectpicker", data_style="btn-secondary") }}
146
+ </div>
134
147
  </div>
135
148
  <div class="row">
136
- <div class="col-md-3">
149
+ <div class="col-md-6">
137
150
  {{ form.phenotype_terms.label(class="control-label") }}
138
151
  {{ form.phenotype_terms(class="form-control") }}
139
152
  </div>
140
- <div class="col-md-3">
153
+ <div class="col-md-2">
141
154
  {{ form.phenotype_groups.label(class="control-label") }}
142
155
  {{ form.phenotype_groups(class="form-control") }}
143
156
  </div>
144
- <div class="col-md-3">
157
+ <div class="col-md-2">
145
158
  {{ form.cohorts.label(class="control-label") }}
146
159
  {{ form.cohorts(class="form-control") }}
147
160
  </div>
148
- <div class="col-md-3">
161
+ <div class="col-md-2">
149
162
  {{ form.similar_case.label(class="control-label") }}
150
163
  {{ form.similar_case(class="form-control") }}
151
164
  </div>
@@ -31,7 +31,7 @@
31
31
  <a href="{{ url_for('overview.gene_variants', institute_id=institute._id) }}" class="bg-dark list-group-item list-group-item-action flex-column align-items-start h-100">
32
32
  <div class="d-flex w-100 justify-content-start align-items-center">
33
33
  <span class="fa fa-search me-3"></span>
34
- <span class="menu-collapsed">Search SNVs and INDELs</span>
34
+ <span class="menu-collapsed">Search SNVs & SVs</span>
35
35
  </div>
36
36
  </a>
37
37
 
@@ -2,16 +2,7 @@
2
2
  import json
3
3
  import logging
4
4
 
5
- from flask import (
6
- Blueprint,
7
- current_app,
8
- flash,
9
- jsonify,
10
- redirect,
11
- render_template,
12
- request,
13
- url_for,
14
- )
5
+ from flask import Blueprint, flash, jsonify, redirect, render_template, request
15
6
  from flask_login import current_user
16
7
  from pymongo import DESCENDING
17
8
 
@@ -138,11 +129,13 @@ def gene_variants(institute_id):
138
129
  form = GeneVariantFiltersForm(request.args)
139
130
  else: # POST
140
131
  form = GeneVariantFiltersForm(request.form)
132
+
141
133
  if form.variant_type.data == []:
142
134
  form.variant_type.data = ["clinical"]
143
-
144
135
  variant_type = form.data.get("variant_type")
145
136
 
137
+ category = form.data.get("category") or ["snv", "sv"]
138
+
146
139
  update_form_hgnc_symbols(store=store, case_obj=None, form=form)
147
140
 
148
141
  # If no valid gene is provided, redirect to form
@@ -153,7 +146,7 @@ def gene_variants(institute_id):
153
146
  variants_query = store.build_variant_query(
154
147
  query=form.data,
155
148
  institute_ids=[inst["_id"] for inst in user_institutes(store, current_user)],
156
- category="snv",
149
+ category=category,
157
150
  variant_type=variant_type,
158
151
  ) # This is the actual query dictionary, not the cursor with results
159
152
 
@@ -0,0 +1 @@
1
+ from .views import omics_variants_bp
@@ -0,0 +1,122 @@
1
+ from flask import Response
2
+ from pymongo.cursor import CursorType
3
+ from werkzeug.datastructures import Headers
4
+
5
+ from scout.adapter import MongoAdapter
6
+ from scout.constants import EXPORTED_VARIANTS_LIMIT
7
+ from scout.server.blueprints.variant.utils import update_variant_case_panels
8
+ from scout.server.blueprints.variants.utils import update_case_panels
9
+ from scout.server.utils import case_has_alignments, case_has_mt_alignments, case_has_rna_tracks
10
+
11
+
12
+ def outliers(
13
+ store: MongoAdapter,
14
+ institute_obj: dict,
15
+ case_obj: dict,
16
+ omics_variants_query: CursorType,
17
+ variant_count: int,
18
+ page: int = 1,
19
+ per_page: int = 50,
20
+ ):
21
+ """Pre-process list of outlier omics variants."""
22
+ skip_count = per_page * max(page - 1, 0)
23
+
24
+ more_variants = variant_count > (skip_count + per_page)
25
+ variants = []
26
+
27
+ update_case_panels(store, case_obj)
28
+
29
+ case_has_alignments(case_obj)
30
+ case_has_mt_alignments(case_obj)
31
+ case_has_rna_tracks(case_obj)
32
+
33
+ for variant_obj in omics_variants_query.skip(skip_count).limit(per_page):
34
+ parsed_variant = decorate_omics_variant(
35
+ store,
36
+ institute_obj,
37
+ case_obj,
38
+ variant_obj,
39
+ )
40
+
41
+ variants.append(parsed_variant)
42
+
43
+ return {"variants": variants, "more_variants": more_variants}
44
+
45
+
46
+ def decorate_omics_variant(
47
+ store: MongoAdapter, institute_obj: dict, case_obj: dict, omics_variant_obj: dict
48
+ ):
49
+ """Decorate each variant with a limited selection of variant obj level information for display on variantS page."""
50
+
51
+ omics_variant_obj["comments"] = store.events(
52
+ institute_obj,
53
+ case=case_obj,
54
+ variant_id=omics_variant_obj["omics_variant_id"],
55
+ comments=True,
56
+ )
57
+
58
+ update_variant_case_panels(case_obj, omics_variant_obj)
59
+
60
+ return omics_variant_obj
61
+
62
+
63
+ def download_omics_variants(case_obj: dict, variant_objs: CursorType):
64
+ """Download omics variants in a csv file."""
65
+
66
+ def generate(header, lines):
67
+ yield header + "\n"
68
+ for line in lines:
69
+ yield line + "\n"
70
+
71
+ DOCUMENT_HEADER = [
72
+ "Gene",
73
+ "Gene annotation",
74
+ "Category",
75
+ "Sub-category",
76
+ "Potential impact",
77
+ "Delta PSI",
78
+ "L2FC",
79
+ "P-value",
80
+ "Fold-change",
81
+ "Samples/Individuals",
82
+ "Position",
83
+ ]
84
+
85
+ export_lines = []
86
+ for variant in variant_objs.limit(EXPORTED_VARIANTS_LIMIT):
87
+ variant_genes: str = (
88
+ f'"{", ".join(variant.get("hgnc_symbols", variant.get("hgnc_ids", variant.get("gene_name_orig"))))}"'
89
+ )
90
+ gene_anno = variant["gene_type"]
91
+ category = variant["category"]
92
+ sub_category = variant["sub_category"]
93
+
94
+ if sub_category == "splicing":
95
+ delta_psi = variant["delta_psi"]
96
+ l2fc = "N/A"
97
+ potential_impact = f"{variant['potential_impact']} - fs {variant['causes_frameshift']}"
98
+ fold_change = "N/A"
99
+ else:
100
+ delta_psi = "N/A"
101
+ l2fc = variant["l2fc"]
102
+ potential_impact = "N/A"
103
+ fold_change = variant["fold_change"]
104
+ p_value = "%.3e" % variant["p_value"]
105
+ samples = f'"{", ".join([sample["display_name"] for sample in variant.get("samples")])}"'
106
+ position = f"{variant['chromosome']}:{variant['position']}-{variant['end']}"
107
+
108
+ variant_line = f"{variant_genes},{gene_anno},{category},{sub_category},{potential_impact},{delta_psi},{l2fc},{p_value},{fold_change},{samples},{position}"
109
+ export_lines.append(variant_line)
110
+
111
+ headers = Headers()
112
+ headers.add(
113
+ "Content-Disposition",
114
+ "attachment",
115
+ filename=str(case_obj["display_name"]) + "-filtered-omics_variants.csv",
116
+ )
117
+ # return a csv with the exported variants
118
+ return Response(
119
+ generate(",".join(DOCUMENT_HEADER), export_lines),
120
+ mimetype="text/csv",
121
+ headers=headers,
122
+ )
@@ -0,0 +1,262 @@
1
+ {% extends "layout.html" %}
2
+
3
+ {% import "bootstrap/wtf.html" as wtf %}
4
+
5
+ {% from "variants/components.html" import external_scripts, external_stylesheets, gene_cell %}
6
+ {% from "variant/buttons.html" import splice_junctions_button %}
7
+ {% from "variants/utils.html" import filter_script_main, pagination_footer, pagination_hidden_div, stash_filter_buttons, update_stash_filter_button_status%}
8
+
9
+ {% block title %}
10
+ {{ super() }} - {{ institute.display_name }} - {{ case.display_name }} - {{ form.variant_type.data|capitalize }} omics outlier variants
11
+ {% endblock %}
12
+
13
+ {% block css %}
14
+ {{ super() }}
15
+ {{ external_stylesheets() }}
16
+ {% endblock %}
17
+
18
+ {% block top_nav %}
19
+ {{ super() }}
20
+ <li class="nav-item">
21
+ <a class="nav-link text-nowrap" href="{{ url_for('cases.index') }}">Institutes</a>
22
+ </li>
23
+ <li class="nav-item">
24
+ <a class="nav-link text-nowrap" href="{{ url_for('overview.cases', institute_id=institute._id) }}">
25
+ {{ institute.display_name }}
26
+ </a>
27
+ </li>
28
+ <li class="nav-item">
29
+ <a class="nav-link text-nowrap" href="{{ url_for('cases.case', institute_id=institute._id, case_name=case.display_name) }}">
30
+ {{ case.display_name }}
31
+ </a>
32
+ </li>
33
+ <li class="nav-item active d-flex align-items-center">
34
+ <span class="navbar-text">{{ form.variant_type.data|capitalize }} WTS outliers</span>
35
+ </li>
36
+ {% endblock %}
37
+
38
+ {% block content_main %}
39
+ <div class="container-float">
40
+ <form method="POST" id="filters_form" action="{{url_for('omics_variants.outliers', institute_id=institute._id, case_name=case.display_name)}}"
41
+ enctype="multipart/form-data" onsubmit="return validateForm()">
42
+
43
+ {{ pagination_hidden_div(page) }}
44
+ <div class="card panel-default" id="accordion">
45
+ <div class="card-header">
46
+ <strong><a data-bs-toggle="collapse" data-parent="#accordion" href="#collapseFilters">Filters</a></strong>
47
+ </div>
48
+ <!--Expand filters form if filters were used in a previous POST request-->
49
+ <div class="card-body panel-collapse collapse {{ 'show' if expand_search is sameas true }}" id="collapseFilters">
50
+ {{ outlier_filters(form, institute, case) }}
51
+ </div>
52
+ {{ omics_filter_form_footer(form, result_size, total_variants, more_variants, page, variants|length, institute) }}
53
+ </div>
54
+ </form>
55
+ <div class="card mt-3">
56
+ <table class="table table-hover table-bordered" style="table-layout: fixed">
57
+ <thead class="thead table-light">
58
+ <tr>
59
+ <th style="width:14%" title="HGNC symbols">Gene</th>
60
+ <th style="width:7%" title="Sub-category">Type</th>
61
+ <th style="width:7%" title="Value - delta Psi or l2fc ">Value</th>
62
+ <th title="Functional annotation">Func. annotation</th>
63
+ <th style="width:7%" title="P-value">P-value</th>
64
+ <th style="width:10%" title="Individual">Ind</th>
65
+ <th style="width:3%" title="Chromosome">Chr</th>
66
+ <th title="Position">Pos</th>
67
+ </tr>
68
+ </thead>
69
+ <tbody>
70
+ {% for variant in variants %}
71
+ <tr>
72
+ <td class="text-end">
73
+ <div class="d-flex flex-row justify-content-between align-items-baseline">
74
+ {% if variant.genes %}
75
+ {{ gene_cell(variant) }}
76
+ {% else %}
77
+ {{ variant.gene_name_orig }}
78
+ {% endif %}
79
+ {% if case.vcf_files.vcf_snv %}
80
+ <form action="{{url_for('variants.variants', institute_id=institute._id, case_name=case.display_name) }}">
81
+ <input type="hidden" id="hgnc_symbols" name="hgnc_symbols" value="{% for gene in variant.genes %}{{gene.hgnc_symbol}}{{ ", " if not loop.last else "" }}{% endfor %}"></input>
82
+ <input type="hidden" id="gene_panels" name="gene_panels" value="['']"></input>
83
+ <button type="submit" class="btn btn-secondary btn-sm" target="_blank" rel="noopener" data-bs-toggle="tooltip" title="SNV and INDEL variants view filtered for the gene(s) {% for gene in variant.genes %}{{gene.hgnc_symbol}}{{ ", " if not loop.last else "" }}{% endfor %} ">SNVs</button>
84
+ </form>
85
+ {% endif %}
86
+ {% if case.vcf_files.vcf_sv %}
87
+ <form action="{{url_for('variants.sv_variants', institute_id=institute._id, case_name=case.display_name) }}">
88
+ <input type="hidden" id="hgnc_symbols" name="hgnc_symbols" value="{% for gene in variant.genes %}{{gene.hgnc_symbol}}{{ ", " if not loop.last else "" }}{% endfor %}"></input>
89
+ <input type="hidden" id="gene_panels" name="gene_panels" value="['']"></input>
90
+ <button type="submit" class="btn btn-secondary btn-sm" target="_blank" rel="noopener" data-bs-toggle="tooltip" title="SV variants view filtered for the gene(s) {% for gene in variant.genes %}{{gene.hgnc_symbol}}{{ ", " if not loop.last else "" }}{% endfor %} ">SVs</button>
91
+ </form>
92
+ {% endif %}
93
+ </div>
94
+ </td>
95
+ <td>{{ variant.sub_category }}</td>
96
+ <td class="text-end"> {% if variant.sub_category == "splicing" %}
97
+ <span data-bs-toggle="tooltip" data-bs-html="true" title='The ∆ψ-value, which is the difference between the actual observed ψ (intron Jaccard Index splice metric) and the expected ψ - see FRASER vignette for details.'>
98
+ {{ variant.delta_psi }}&nbsp;<a target="_blank" href="https://www.bioconductor.org/packages/devel/bioc/vignettes/FRASER/inst/doc/FRASER.pdf" rel="noopener noreferrer">&Delta;&psi;</a></span>
99
+ {% else %}
100
+ <span data-bs-toggle="tooltip" data-bs-html="true" title='The log2 fold change - click to see OUTRIDER vignette for details.'>
101
+ {{ variant.l2fc }}&nbsp;&nbsp;<a target="_blank" href="https://www.bioconductor.org/packages/devel/bioc/vignettes/OUTRIDER/inst/doc/OUTRIDER.pdf" rel="noopener noreferrer">{% if variant.l2fc > 0 %}&uarr;{% elif variant.l2fc < 0 %}&darr;{% endif %}</a></span>
102
+ {% endif %}
103
+ </td>
104
+ <td>
105
+ {% if variant.sub_category == "splicing" %}
106
+ {{ variant.potential_impact }} - fs {{ variant.causes_frameshift }}
107
+ {% endif %}
108
+ </td>
109
+ <td class="text-end">{{ '%.3e' % variant.p_value }}</td>
110
+ <td>{{ case.individuals.0.display_name }}</td>
111
+ <td class="text-end">{{ variant.chromosome }}</td>
112
+ <td class="text-end"><span style="white-space: nowrap;">{{ variant.position|human_longint|safe }}</span>-<span style="white-space: nowrap;">{{ variant.end|human_longint|safe }}</span>
113
+ {% if case.has_rna_tracks %}
114
+ {{ splice_junctions_button(institute._id, case.display_name, None, variant.omics_variant_id) }}
115
+ {% endif %}
116
+ </tr>
117
+ {% else %}
118
+ <tr>
119
+ <td colspan="9">
120
+ No matching variants
121
+ </td>
122
+ </tr>
123
+ {% endfor %}
124
+ </tbody>
125
+ </table>
126
+ </div><!-- end of card -->
127
+ </div> <!-- end of container-float -->
128
+ </form> <!--end of form containing filters and variants' table elements -->
129
+ <div class="container-fluid" style="padding-bottom: 100px">
130
+ {{ pagination_footer(more_variants, page) }}
131
+ </div>
132
+
133
+ {% endblock %}
134
+
135
+ {% block scripts %}
136
+ {{ super() }}
137
+ {{ external_scripts() }}
138
+ <script src="{{ url_for('variants.static', filename='form_scripts.js') }}"></script>
139
+ {{ filter_script_main(cytobands) }}
140
+ <script type="text/javascript">
141
+ window.onload=function() {
142
+ populateCytobands({{cytobands|safe}});
143
+ {{ update_stash_filter_button_status(current_user, filters) }}
144
+ }
145
+
146
+ $("#filters").change(function () {
147
+ {{ update_stash_filter_button_status(current_user, filters) }}
148
+ });
149
+
150
+ $('select[multiple]').selectpicker({
151
+ width: '100%'
152
+ });
153
+
154
+ var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
155
+ var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
156
+ return new bootstrap.Tooltip(tooltipTriggerEl)
157
+ })
158
+
159
+ var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
160
+ var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
161
+ return new bootstrap.Popover(popoverTriggerEl, {
162
+ sanitizeFn: function (content) {
163
+ return DOMPurify.sanitize(content)
164
+ },
165
+ container: 'body',
166
+ })
167
+ })
168
+
169
+ </script>
170
+
171
+ {% endblock %}
172
+
173
+ {% macro outlier_filters(form, institute, case, filters) %}
174
+ <input type="hidden" name="variant_type" value="{{ form.variant_type.data }}">
175
+ <div class="row">
176
+ <div class="col-2">
177
+ <span>{{ 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.") }}</span>
178
+ <span style="float:right;">{{ 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}}</span>
179
+ {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
180
+ </div>
181
+ <div class="col-3">
182
+ {{ form.hgnc_symbols.label(class="control-label") }}
183
+ {{ form.hgnc_symbols(class="form-control") }}
184
+ </div>
185
+ <div class="col-1 align-self-end">
186
+ <div class="btn-group d-flex">
187
+ <a class="btn btn-secondary text-white" href="{{ url_for('omics_variants.outliers', institute_id=institute._id,
188
+ case_name=case.display_name, variant_type=form.variant_type.data,
189
+ gene_panels=['hpo']) }}">HPO gene list</a>
190
+ </div>
191
+ </div>
192
+ <div class="col-2">
193
+ {{ form.svtype.label(class="control-label") }}
194
+ {{ form.svtype(class="form-control selectpicker", data_style="btn-secondary") }}
195
+ </div>
196
+ </div>
197
+ <div class="row">
198
+ <div class="col-2">
199
+ {{ form.chrom.label(class="control-label") }}
200
+ {{ form.chrom(class="selectpicker", data_style="btn-secondary", data_actions_box="true") }}
201
+ </div>
202
+ <div class="col-2">
203
+ {{ wtf.form_field(form.start) }}
204
+ </div>
205
+ <div class="col-2">
206
+ {{ wtf.form_field(form.end) }}
207
+ </div>
208
+ <div class="col-2">
209
+ {{ wtf.form_field(form.cytoband_start) }}
210
+ </div>
211
+ <div class="col-2">
212
+ {{ wtf.form_field(form.cytoband_end) }}
213
+ </div>
214
+ </div>
215
+ <div class="row" style="margin-top:20px;">
216
+ <div class="col-4">
217
+ {{ form.filter_variants(class="btn btn-primary form-control", onclick="resetPage()") }}
218
+ </div>
219
+ <div class="col-4">
220
+ {{ form.clinical_filter(class="btn btn-secondary form-control", onclick="resetPage()") }}
221
+ </div>
222
+ <div class="col-4">
223
+ {{ form.export(class="btn btn-warning form-control") }}
224
+ </div>
225
+ </div>
226
+ <div class="row" style="margin-top:20px;">
227
+ <div class="col-2 text-start">
228
+ <a href="{{ url_for('omics_variants.outliers', institute_id=institute._id, case_name=case.display_name,
229
+ variant_type=form.variant_type.data) }}"
230
+ class="btn btn-secondary" style="color: #ffffff !important;">
231
+ Reset&nbsp;filters
232
+ </a>
233
+ </div>
234
+ <div class="col-6">
235
+ {{ stash_filter_buttons(form, institute, case) }}
236
+ </div>
237
+ </div>
238
+ {% endmacro %}
239
+
240
+ {% macro omics_filter_form_footer(form, result_size, total_variants, more_variants, page, nvars, institute) %}
241
+ <div class="card-footer text-center">
242
+ <div class="row">
243
+ <div class="col-4">
244
+ <div class="form-check d-flex justify-content-start">
245
+ {% if institute.check_show_all_vars %}
246
+ <input type="checkbox" class="form-check-input" name="show_unaffected" id="show_unaffected" checked disabled>
247
+ {{ form.show_unaffected.label(class="form-check-label ms-2", **{'data-bs-toggle': 'tooltip', 'title':'Modify general institute settings to be able to edit this checkbox'}) }}
248
+ {% else %}
249
+ {{ form.show_unaffected(class="form-check-input") }}
250
+ {{ form.show_unaffected.label(class="form-check-label ms-2", **{'data-bs-toggle': 'tooltip', 'title':'This filter applies only to cases with more than one sample. When this is unchecked, only variants that are predicted by callers to be present in an affected individual genotype are shown.'}) }}
251
+ {% endif %}
252
+ </div>
253
+ </div>
254
+ <div class="col-4 d-flex justify-content-center">
255
+ Filter returns {{result_size}} / {{ total_variants }} variants.
256
+ </div>
257
+ <div class="col-4 d-flex flex-column justify-content-end">
258
+ <div class="d-flex justify-content-end">Showing {%if more_variants %}page {{page}}{%else%}last page{% endif %} with {{nvars}} variants.</div>
259
+ </div>
260
+ </div>
261
+ </div>
262
+ {% endmacro %}