scout-browser 4.84__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.
- scout/__version__.py +1 -1
- scout/adapter/mongo/base.py +17 -14
- scout/adapter/mongo/case.py +20 -1
- scout/adapter/mongo/cytoband.py +13 -0
- scout/adapter/mongo/filter.py +36 -1
- scout/adapter/mongo/hgnc.py +1 -1
- scout/adapter/mongo/omics_variant.py +145 -0
- scout/adapter/mongo/query.py +13 -3
- scout/adapter/mongo/variant.py +10 -4
- scout/build/case.py +5 -0
- scout/build/variant/variant.py +1 -0
- scout/commands/update/genes.py +9 -13
- scout/constants/__init__.py +3 -1
- scout/constants/case_tags.py +1 -0
- scout/constants/clinvar.py +1 -1
- scout/constants/file_types.py +31 -0
- scout/constants/filters.py +4 -0
- scout/constants/indexes.py +30 -13
- scout/constants/variant_tags.py +3 -0
- scout/demo/643594.clinical.mei.vcf.gz +0 -0
- scout/demo/643594.clinical.mei.vcf.gz.tbi +0 -0
- scout/demo/643594.config.yaml +4 -0
- scout/demo/drop/fraser_top_hits_clinical.tsv +5 -0
- scout/demo/drop/outrider_top_hits_clinical.tsv +10 -0
- scout/load/hgnc_gene.py +39 -6
- scout/load/setup.py +4 -4
- scout/models/case/case_loading_models.py +25 -2
- scout/models/omics_variant.py +227 -0
- scout/parse/hgnc.py +1 -0
- scout/parse/omics_variant/__init__.py +11 -0
- scout/parse/omics_variant/drop.py +19 -0
- scout/parse/variant/callers.py +6 -3
- scout/parse/variant/frequency.py +10 -2
- scout/parse/variant/transcript.py +1 -1
- scout/parse/variant/variant.py +10 -4
- scout/server/app.py +4 -1
- scout/server/blueprints/alignviewers/controllers.py +35 -24
- scout/server/blueprints/alignviewers/templates/alignviewers/igv_sashimi_viewer.html +19 -15
- scout/server/blueprints/alignviewers/templates/alignviewers/igv_viewer.html +45 -5
- scout/server/blueprints/alignviewers/templates/alignviewers/utils.html +1 -1
- scout/server/blueprints/alignviewers/views.py +10 -2
- scout/server/blueprints/cases/controllers.py +18 -1
- scout/server/blueprints/cases/templates/cases/case.html +28 -10
- scout/server/blueprints/cases/templates/cases/case_report.html +2 -17
- scout/server/blueprints/cases/templates/cases/collapsible_actionbar.html +1 -1
- scout/server/blueprints/cases/templates/cases/gene_panel.html +27 -41
- scout/server/blueprints/cases/templates/cases/phenotype.html +8 -5
- scout/server/blueprints/cases/templates/cases/utils.html +27 -4
- scout/server/blueprints/clinvar/controllers.py +9 -3
- scout/server/blueprints/dashboard/controllers.py +44 -13
- scout/server/blueprints/dashboard/static/charts.js +46 -36
- scout/server/blueprints/dashboard/templates/dashboard/dashboard_general.html +2 -2
- scout/server/blueprints/institutes/forms.py +2 -0
- scout/server/blueprints/institutes/templates/overview/cases.html +6 -4
- scout/server/blueprints/institutes/templates/overview/gene_variants.html +40 -27
- scout/server/blueprints/institutes/templates/overview/institute_sidebar.html +1 -1
- scout/server/blueprints/institutes/views.py +5 -12
- scout/server/blueprints/omics_variants/__init__.py +1 -0
- scout/server/blueprints/omics_variants/controllers.py +122 -0
- scout/server/blueprints/omics_variants/templates/omics_variants/outliers.html +262 -0
- scout/server/blueprints/omics_variants/views.py +106 -0
- scout/server/blueprints/panels/controllers.py +1 -7
- scout/server/blueprints/panels/templates/panels/panels.html +12 -4
- scout/server/blueprints/panels/views.py +9 -11
- scout/server/blueprints/variant/templates/variant/buttons.html +7 -2
- scout/server/blueprints/variant/templates/variant/str-variant-reviewer.html +1 -1
- scout/server/blueprints/variant/templates/variant/utils.html +1 -1
- scout/server/blueprints/variant/utils.py +54 -103
- scout/server/blueprints/variant/views.py +1 -0
- scout/server/blueprints/variants/controllers.py +1 -4
- scout/server/blueprints/variants/forms.py +42 -0
- scout/server/blueprints/variants/templates/variants/utils.html +8 -4
- scout/server/blueprints/variants/views.py +28 -7
- scout/server/config.py +4 -0
- scout/server/extensions/clinvar_extension.py +7 -7
- scout/server/links.py +2 -2
- scout/server/templates/bootstrap_global.html +1 -4
- scout/server/templates/utils.html +4 -4
- scout/server/utils.py +4 -1
- {scout_browser-4.84.dist-info → scout_browser-4.86.dist-info}/METADATA +11 -11
- {scout_browser-4.84.dist-info → scout_browser-4.86.dist-info}/RECORD +85 -75
- {scout_browser-4.84.dist-info → scout_browser-4.86.dist-info}/WHEEL +1 -1
- {scout_browser-4.84.dist-info → scout_browser-4.86.dist-info}/LICENSE +0 -0
- {scout_browser-4.84.dist-info → scout_browser-4.86.dist-info}/entry_points.txt +0 -0
- {scout_browser-4.84.dist-info → scout_browser-4.86.dist-info}/top_level.txt +0 -0
@@ -9,7 +9,7 @@
|
|
9
9
|
<thead class="table-light thead">
|
10
10
|
<tr style="cursor: pointer; white-space: nowrap">
|
11
11
|
<th>Panel <i class="fas fa-sort" data-bs-toggle="tooltip" title="Sort by gene panel name"></i></th>
|
12
|
-
<th
|
12
|
+
<th>Default <i class="fas fa-sort" data-bs-toggle="tooltip" title="Sort by if panel is default"></i></th>
|
13
13
|
<th>Version <i class="fas fa-sort" data-bs-toggle="tooltip" title="Sort by panel version"></i></th>
|
14
14
|
<th>Genes <i class="fas fa-sort" data-bs-toggle="tooltip" title="Sort by number of genes"></i></th>
|
15
15
|
</tr>
|
@@ -20,10 +20,10 @@
|
|
20
20
|
<td>
|
21
21
|
<a {% if panel.is_default %} class="text-white" {% endif %} href="{{ url_for('panels.panel', panel_id=panel.panel_id, case_id=case._id, institute_id=institute._id) }}">
|
22
22
|
{{ panel.display_name|truncate(30, True) }}
|
23
|
-
{% if panel.removed %}
|
24
|
-
<span class="badge bg-danger">Removed</span>
|
25
|
-
{% endif %}
|
26
23
|
</a>
|
24
|
+
{% if panel.removed %}
|
25
|
+
<span class="badge bg-danger">Removed</span>
|
26
|
+
{% endif %}
|
27
27
|
</td>
|
28
28
|
<td >
|
29
29
|
{% if panel.is_default %}
|
@@ -35,53 +35,39 @@
|
|
35
35
|
</tr>
|
36
36
|
{% else %}
|
37
37
|
<tr>
|
38
|
-
<td colspan="
|
38
|
+
<td colspan="4">No panels linked to case</td>
|
39
39
|
</tr>
|
40
40
|
{% endfor %}
|
41
41
|
</tbody>
|
42
42
|
</table>
|
43
43
|
</div>
|
44
|
-
|
45
|
-
|
46
|
-
<div class="row">
|
47
|
-
<label>Change default gene panels</label>
|
48
|
-
</div>
|
49
|
-
<div class="row">
|
50
|
-
<div class="col-8">
|
51
|
-
<select name="panel_ids" class="selectpicker" multiple="multiple" data-style="btn-secondary">
|
52
|
-
{% for panel in case.panels %}
|
53
|
-
<option value="{{ panel.panel_id }}" {% if panel.is_default %} selected {% endif %}>{{ panel.display_name }}</option>
|
54
|
-
{% endfor %}
|
55
|
-
</select>
|
56
|
-
</div>
|
57
|
-
<div class="col-4">
|
58
|
-
<button class="btn btn-secondary form-control">Save</button>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</form>
|
62
|
-
</div>
|
44
|
+
{{ change_default_panels(case, institute) }}
|
45
|
+
|
63
46
|
</div>
|
64
47
|
{% endmacro %}
|
65
48
|
|
66
49
|
{% macro change_default_panels(case, institute) %}
|
67
|
-
<div class="card
|
68
|
-
<
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
</
|
50
|
+
<div class="card-body">
|
51
|
+
<form action="{{ url_for('cases.default_panels', institute_id=institute._id, case_name=case.display_name) }}" method="POST">
|
52
|
+
<div class="row">
|
53
|
+
<label>Change default gene panels</label>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<div class="row">
|
57
|
+
<div class="col-8">
|
58
|
+
<select name="panel_ids" class="selectpicker" multiple="multiple" data-style="btn-secondary">
|
59
|
+
{% for panel in case.panels|sort(attribute='display_name') %}
|
60
|
+
<option value="{{ panel.panel_id }}" {% if panel.is_default %} selected {% endif %}>
|
61
|
+
{{ panel.display_name }} {% if panel.removed %} (Removed) {% endif %}
|
62
|
+
</option>
|
63
|
+
{% endfor %}
|
64
|
+
</select>
|
82
65
|
</div>
|
83
|
-
|
84
|
-
|
66
|
+
<div class="col-4">
|
67
|
+
<button class="btn btn-secondary form-control">Save</button>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</form>
|
85
71
|
</div>
|
86
72
|
{% endmacro %}
|
87
73
|
|
@@ -234,16 +234,19 @@
|
|
234
234
|
<form action="{{ url_for('cases.phenotypes_actions', institute_id=institute._id, case_name=case.display_name)+'#phenotypes_panel' }}" method="POST">
|
235
235
|
|
236
236
|
<!-- Display and remove added HPO terms -->
|
237
|
-
<div class="
|
238
|
-
<div class="col-12 ms-3">
|
237
|
+
<div class="mt-3">
|
239
238
|
{% if "phenotype_terms" in case and case.phenotype_terms|length > 0 %}
|
240
239
|
{% for hpo_term in case.phenotype_terms %}
|
241
|
-
{{ hpo_item(hpo_term, case) }}
|
240
|
+
<div class="col-12"> {{ hpo_item(hpo_term, case) }} </div>
|
242
241
|
{% endfor %}
|
242
|
+
|
243
|
+
<div class="col-12 mt-3 form-check form-switch">
|
244
|
+
<input type="checkbox" class="form-check-input" id="checkAllPhenotypes" onChange="dynamicPhenotypeCheck(this)" name="checkAllPhenotypes">
|
245
|
+
<label for="checkAllPhenotypes" class="form-check-label">Select all phenotypes</label>
|
246
|
+
</div>
|
243
247
|
{% else %}
|
244
248
|
<span class="text-mute">No phenotypes added yet</span>
|
245
249
|
{% endif %}
|
246
|
-
</div>
|
247
250
|
</div>
|
248
251
|
|
249
252
|
<div id="phenotypes_panel" class="mt-3">
|
@@ -284,7 +287,7 @@
|
|
284
287
|
|
285
288
|
{% macro hpo_item(hpo_term, case) %}
|
286
289
|
{% if hpo_term %}
|
287
|
-
|
290
|
+
<input type="checkbox" name="hpo_id" value="{{ hpo_term.phenotype_id }}"
|
288
291
|
{% if case.dynamic_panel_phenotypes and hpo_term.phenotype_id in case.dynamic_panel_phenotypes %} checked {% endif %}>
|
289
292
|
{{ hpo_term.feature }}
|
290
293
|
<span class="badge bg-info">
|
@@ -324,18 +324,18 @@
|
|
324
324
|
<a href="{{ url_for('variant.cancer_variant',
|
325
325
|
institute_id=variant.institute,
|
326
326
|
case_name=case.display_name,
|
327
|
-
variant_id=variant._id) }}">
|
327
|
+
variant_id=variant._id) }}" target="_blank">
|
328
328
|
{% else %}
|
329
329
|
<a href="{{ url_for('variant.variant',
|
330
330
|
institute_id=variant.institute,
|
331
331
|
case_name=case.display_name,
|
332
|
-
variant_id=variant._id) }}">
|
332
|
+
variant_id=variant._id) }}" target="_blank">
|
333
333
|
{% endif %}
|
334
334
|
{% else %} <!-- structural variants -->
|
335
335
|
<a href="{{ url_for('variant.sv_variant',
|
336
336
|
institute_id=variant.institute,
|
337
337
|
case_name=case.display_name,
|
338
|
-
variant_id=variant._id) }}">
|
338
|
+
variant_id=variant._id) }}" target="_blank">
|
339
339
|
{% endif %}
|
340
340
|
{{ pretty_variant(variant) }}
|
341
341
|
</a>
|
@@ -676,7 +676,7 @@
|
|
676
676
|
name="{{ button_name if button_name }}"
|
677
677
|
value="{{ button_value if button_value }}"
|
678
678
|
type="submit">
|
679
|
-
<i class="fa fa-
|
679
|
+
<i class="fa fa-times text-danger"></i>
|
680
680
|
</button>
|
681
681
|
</div>
|
682
682
|
</form>
|
@@ -698,3 +698,26 @@
|
|
698
698
|
<span class="fa fa-exclamation-circle text-danger" data-bs-toggle='tooltip' title="Sex is not confirmed."></span>
|
699
699
|
{% endif %}
|
700
700
|
{% endmacro %}
|
701
|
+
|
702
|
+
{% macro filter_audits(audits, edit=none) %}
|
703
|
+
<table id="audit-table" class="table table-sm" style="background-color: transparent">
|
704
|
+
<thead>
|
705
|
+
<tr>
|
706
|
+
<th>Filters marked audited for case</th>
|
707
|
+
</tr>
|
708
|
+
</thead>
|
709
|
+
<tbody>
|
710
|
+
{% set audit_query = namespace() %}
|
711
|
+
{% for audit in audits %}
|
712
|
+
{% set audit_query = audit.link|url_args %}
|
713
|
+
<tr>
|
714
|
+
<td class="d-flex align-items-center"><strong>{{ audit.subject }} ({{audit_query.variant_type if audit_query.variant_type else "type unavailable -"}} {{ audit_query.category if audit_query.category else "category unavailable"}})</strong> was marked checked by {{ audit.user_name }} on {{audit.created_at.strftime('%Y-%m-%d')}}.
|
715
|
+
{% if edit is true %}
|
716
|
+
<a href="{{ url_for('variants.unaudit_filter', audit_id=audit._id) }}" class="btn btn-link btn-sm" type="submit" data-bs-toggle='tooltip' title="Un-audit filter"><i class="fa fa-times text-danger"></i></a>
|
717
|
+
{% endif %}
|
718
|
+
</td>
|
719
|
+
</tr>
|
720
|
+
{% endfor %}
|
721
|
+
</tbody>
|
722
|
+
</table>
|
723
|
+
{% endmacro %}
|
@@ -442,11 +442,14 @@ def send_api_submission(institute_id, submission_id, key):
|
|
442
442
|
if clinvar_id: # Check if submission object has already an associated ClinVar ID
|
443
443
|
conversion_res["submissionName"] = clinvar_id
|
444
444
|
|
445
|
-
code, submit_res = clinvar_api.submit_json(conversion_res, key)
|
445
|
+
service_url, code, submit_res = clinvar_api.submit_json(conversion_res, key)
|
446
446
|
|
447
447
|
if code in [200, 201]:
|
448
448
|
clinvar_id = submit_res.json().get("id")
|
449
|
-
flash(
|
449
|
+
flash(
|
450
|
+
f"Submission sent to API URL '{service_url}'. Saved successfully with ID: {clinvar_id}",
|
451
|
+
"success",
|
452
|
+
)
|
450
453
|
|
451
454
|
# Update ClinVar submission ID with the ID returned from ClinVar
|
452
455
|
store.update_clinvar_id(
|
@@ -459,7 +462,10 @@ def send_api_submission(institute_id, submission_id, key):
|
|
459
462
|
)
|
460
463
|
|
461
464
|
else:
|
462
|
-
flash(
|
465
|
+
flash(
|
466
|
+
f"Submission sent to API URL '{service_url}'. Returned the following error: {str(submit_res.json())}",
|
467
|
+
"warning",
|
468
|
+
)
|
463
469
|
|
464
470
|
|
465
471
|
def clinvar_submission_file(submission_id, csv_type, clinvar_subm_id):
|
@@ -3,7 +3,7 @@ import logging
|
|
3
3
|
from flask import flash, redirect, request, url_for
|
4
4
|
from flask_login import current_user
|
5
5
|
|
6
|
-
from scout.constants import CASE_SEARCH_TERMS
|
6
|
+
from scout.constants import CASE_SEARCH_TERMS, CASE_TAGS
|
7
7
|
from scout.server.extensions import store
|
8
8
|
from scout.server.utils import user_institutes
|
9
9
|
|
@@ -139,8 +139,22 @@ def get_dashboard_info(adapter, data={}, institute_id=None, slice_query=None):
|
|
139
139
|
"count": general_sliced_info["cohort_cases"],
|
140
140
|
"percent": general_sliced_info["cohort_cases"] / total_sliced_cases,
|
141
141
|
},
|
142
|
+
{
|
143
|
+
"title": "Case status tag",
|
144
|
+
"count": general_sliced_info["tagged_cases"],
|
145
|
+
"percent": general_sliced_info["tagged_cases"] / total_sliced_cases,
|
146
|
+
},
|
142
147
|
]
|
143
148
|
|
149
|
+
for stats_tag in CASE_TAGS.keys():
|
150
|
+
overview.append(
|
151
|
+
{
|
152
|
+
"title": CASE_TAGS[stats_tag]["label"] + " status tag",
|
153
|
+
"count": general_sliced_info[stats_tag + "_cases"],
|
154
|
+
"percent": general_sliced_info[stats_tag + "_cases"] / total_sliced_cases,
|
155
|
+
}
|
156
|
+
)
|
157
|
+
|
144
158
|
data["overview"] = overview
|
145
159
|
|
146
160
|
return data
|
@@ -149,6 +163,11 @@ def get_dashboard_info(adapter, data={}, institute_id=None, slice_query=None):
|
|
149
163
|
def get_general_case_info(adapter, institute_id=None, slice_query=None):
|
150
164
|
"""Return general information about cases
|
151
165
|
|
166
|
+
Count e.g. cases with each kind of case tag, as well as cases that have phenotype, causatives or pinned variants
|
167
|
+
marked or are part of cohorts.
|
168
|
+
|
169
|
+
Gather pedigree information - single, duo, trio or many individuals in case.
|
170
|
+
|
152
171
|
Args:
|
153
172
|
adapter(adapter.MongoAdapter)
|
154
173
|
institute_id(str)
|
@@ -168,15 +187,24 @@ def get_general_case_info(adapter, institute_id=None, slice_query=None):
|
|
168
187
|
"suspects": 1,
|
169
188
|
"cohorts": 1,
|
170
189
|
"individuals": 1,
|
190
|
+
"tags": 1,
|
171
191
|
}
|
172
192
|
cases = adapter.cases(
|
173
193
|
owner=institute_id, name_query=name_query, projection=CASE_GENERAL_INFO_PROJECTION
|
174
194
|
)
|
175
195
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
196
|
+
case_counter_keys = [
|
197
|
+
"phenotype",
|
198
|
+
"causative",
|
199
|
+
"pinned",
|
200
|
+
"cohort",
|
201
|
+
"tagged",
|
202
|
+
]
|
203
|
+
case_counter_keys.extend(CASE_TAGS.keys())
|
204
|
+
|
205
|
+
case_counter = {}
|
206
|
+
for counter in case_counter_keys:
|
207
|
+
case_counter[counter] = 0
|
180
208
|
|
181
209
|
pedigree = {
|
182
210
|
1: {"title": "Single", "count": 0},
|
@@ -191,13 +219,18 @@ def get_general_case_info(adapter, institute_id=None, slice_query=None):
|
|
191
219
|
for total_cases, case in enumerate(cases, 1):
|
192
220
|
case_ids.add(case["_id"])
|
193
221
|
if case.get("phenotype_terms"):
|
194
|
-
|
222
|
+
case_counter["phenotype"] += 1
|
195
223
|
if case.get("causatives"):
|
196
|
-
|
224
|
+
case_counter["causative"] += 1
|
197
225
|
if case.get("suspects"):
|
198
|
-
|
226
|
+
case_counter["pinned"] += 1
|
199
227
|
if case.get("cohorts"):
|
200
|
-
|
228
|
+
case_counter["cohort"] += 1
|
229
|
+
if case.get("tags"):
|
230
|
+
case_counter["tagged"] += 1
|
231
|
+
case_tags = case.get("tags")
|
232
|
+
for tag in case_tags:
|
233
|
+
case_counter[tag] += 1
|
201
234
|
|
202
235
|
nr_individuals = len(case.get("individuals", []))
|
203
236
|
if nr_individuals == 0:
|
@@ -208,12 +241,10 @@ def get_general_case_info(adapter, institute_id=None, slice_query=None):
|
|
208
241
|
pedigree[nr_individuals]["count"] += 1
|
209
242
|
|
210
243
|
general["total_cases"] = total_cases
|
211
|
-
general["phenotype_cases"] = phenotype_cases
|
212
|
-
general["causative_cases"] = causative_cases
|
213
|
-
general["pinned_cases"] = pinned_cases
|
214
|
-
general["cohort_cases"] = cohort_cases
|
215
244
|
general["pedigree"] = pedigree
|
216
245
|
general["case_ids"] = case_ids
|
246
|
+
for counter in case_counter_keys:
|
247
|
+
general[counter + "_cases"] = case_counter[counter]
|
217
248
|
|
218
249
|
return general
|
219
250
|
|
@@ -15,12 +15,16 @@ function analysisTypeData(analysis_types) {
|
|
15
15
|
"bkgColors": {
|
16
16
|
"WES": "#46bfbd",
|
17
17
|
"WGS": "#fdb45c",
|
18
|
-
"PANEL": "#44449B"
|
18
|
+
"PANEL": "#44449B",
|
19
|
+
"PANEL-UMI": "#949fb1",
|
20
|
+
"WTS": "#f7464A"
|
19
21
|
},
|
20
22
|
"hoverColors": {
|
21
23
|
"WES": "#5ad3d1",
|
22
24
|
"WGS": "#ffc870",
|
23
|
-
"PANEL": "#353578"
|
25
|
+
"PANEL": "#353578",
|
26
|
+
"PANEL-UMI": "#a8b3c5",
|
27
|
+
"WTS": "#ff5a5e"
|
24
28
|
}
|
25
29
|
};
|
26
30
|
var bkg = [];
|
@@ -77,7 +81,7 @@ function casesType(cases) {
|
|
77
81
|
var bkg = [];
|
78
82
|
var hover = [];
|
79
83
|
labels.forEach(function (item, index) {
|
80
|
-
|
84
|
+
bkg.push(bkgColors[index]);
|
81
85
|
hover.push(hoverColors[index]);
|
82
86
|
});
|
83
87
|
var chart_data = {
|
@@ -129,52 +133,58 @@ function casesDetailed(overview, all_cases) {
|
|
129
133
|
var bkg = [];
|
130
134
|
var hover = [];
|
131
135
|
labels.forEach(function (item, index) {
|
132
|
-
|
136
|
+
ncol = bkgColors.length;
|
137
|
+
bkg.push(bkgColors[index % ncol]);
|
133
138
|
});
|
134
139
|
var chart_data = {
|
135
|
-
type: "
|
140
|
+
type: "bar",
|
136
141
|
data: {
|
137
142
|
labels: labels,
|
138
143
|
datasets: [{
|
139
144
|
data: overview.map(function (overview) {
|
140
145
|
return overview.count * 100 / all_cases;
|
141
146
|
}),
|
147
|
+
label: "Case percentage",
|
142
148
|
backgroundColor: bkg,
|
143
149
|
hoverBackgroundColor: hover
|
144
150
|
}]
|
145
151
|
},
|
146
152
|
options: {
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
153
|
+
indexAxis: 'y',
|
154
|
+
tooltips: {
|
155
|
+
callbacks: {
|
156
|
+
label: function label(tooltipItems) {
|
157
|
+
return Math.round(Number(tooltipItems.value) * all_cases / 100);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
},
|
161
|
+
scales: {
|
162
|
+
x: {
|
163
|
+
ticks: {
|
164
|
+
min: 0,
|
165
|
+
max: 100,
|
166
|
+
callback: function callback(value) {
|
167
|
+
return value + "%";
|
168
|
+
}
|
169
|
+
},
|
170
|
+
title: {
|
171
|
+
display: true,
|
172
|
+
text: "Case percentage",
|
173
|
+
font: 20
|
174
|
+
}
|
175
|
+
},
|
176
|
+
y: {
|
177
|
+
ticks: {
|
178
|
+
fontSize: 20
|
179
|
+
}
|
180
|
+
}
|
181
|
+
},
|
182
|
+
plugins:
|
183
|
+
{
|
184
|
+
legend: {
|
185
|
+
display: false
|
186
|
+
}
|
187
|
+
}
|
178
188
|
}
|
179
189
|
};
|
180
190
|
return chart_data;
|
@@ -108,7 +108,7 @@
|
|
108
108
|
{% endmacro %}
|
109
109
|
|
110
110
|
{% macro cases_stats_panels() %}
|
111
|
-
<div class="mt-3" id="cases">
|
111
|
+
<div class="mt-3 mb-1" id="cases">
|
112
112
|
<div class="row">
|
113
113
|
<div class="col-md-8">
|
114
114
|
<canvas id="cases-bar-horiz" height="80"></canvas>
|
@@ -129,7 +129,7 @@
|
|
129
129
|
|
130
130
|
{% block scripts %}
|
131
131
|
{{ super() }}
|
132
|
-
<script src="https://
|
132
|
+
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.3/dist/chart.umd.min.js" integrity="sha512-NqRhTU0DQNHNUO0pTx6zPLJ11YhOqj4MRcvv0+amxJk+re07ykGhFuhMmrQpfTRAUx8nQ4EcMuX/m8cz2K8vIQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
133
133
|
<script src="{{ url_for('dashboard.static', filename='charts.js') }}"></script>
|
134
134
|
<script type="text/javascript">
|
135
135
|
|
@@ -17,6 +17,7 @@ from scout.constants import CASE_SEARCH_TERMS, PHENOTYPE_GROUPS
|
|
17
17
|
from scout.models.case import STATUS
|
18
18
|
|
19
19
|
CASE_SEARCH_KEY = [(value["prefix"], value["label"]) for key, value in CASE_SEARCH_TERMS.items()]
|
20
|
+
CATEGORY_CHOICES = [("snv", "SNV"), ("sv", "SV")]
|
20
21
|
|
21
22
|
|
22
23
|
class NonValidatingSelectField(SelectField):
|
@@ -142,6 +143,7 @@ class GeneVariantFiltersForm(FlaskForm):
|
|
142
143
|
"""Base FiltersForm for SNVs"""
|
143
144
|
|
144
145
|
variant_type = SelectMultipleField(choices=[("clinical", "clinical"), ("research", "research")])
|
146
|
+
category = SelectMultipleField(choices=CATEGORY_CHOICES)
|
145
147
|
hgnc_symbols = TagListField(
|
146
148
|
"HGNC Symbols (comma-separated, case sensitive)", validators=[validators.InputRequired()]
|
147
149
|
)
|
@@ -113,19 +113,21 @@
|
|
113
113
|
{% macro case_row(case) %}
|
114
114
|
<tr class="{% if case.status == 'solved' %}causative{% endif %}">
|
115
115
|
<td>
|
116
|
-
<a
|
116
|
+
<a class="me-2"
|
117
|
+
{% if case.individuals|length == 1 %} data-bs-toggle="tooltip" title="{{case.individuals[0].display_name}}" {% endif %}
|
118
|
+
href="{{ url_for('cases.case', institute_id=case.owner, case_name=case.display_name) }}">
|
117
119
|
{{ case.display_name }}
|
118
120
|
</a>
|
119
121
|
{% if case.individuals|length > 1 %}
|
120
|
-
|
121
|
-
|
122
|
+
{% for sample in case.individuals %}
|
123
|
+
<span class="badge {{'bg-danger' if sample.phenotype == 2 else 'bg-primary'}}" style="margin:-3px !important;" data-bs-toggle="tooltip" title="{{sample.display_name}}">
|
122
124
|
{% if case.track == "cancer" %}
|
123
125
|
<span class="fa fa-vial"></span>
|
124
126
|
{% else %} <!-- rare disease case -->
|
125
127
|
<span class="fa fa-user"></span>
|
126
128
|
{% endif %}
|
129
|
+
</span>
|
127
130
|
{% endfor %}
|
128
|
-
</span>
|
129
131
|
{% endif %}
|
130
132
|
{% for user in case.assignees %}
|
131
133
|
<span class="badge bg-secondary">{{ user.name }}</span>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{% extends "layout.html" %}
|
2
|
-
{% from "variants/components.html" import
|
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">{{
|
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
|
-
|
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
|
-
|
96
|
-
|
97
|
-
|
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
|
-
|
100
|
-
|
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-
|
127
|
-
<label class="control-label">Rank Score
|
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-
|
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-
|
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-
|
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-
|
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-
|
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
|
34
|
+
<span class="menu-collapsed">Search SNVs & SVs</span>
|
35
35
|
</div>
|
36
36
|
</a>
|
37
37
|
|