scout-browser 4.81__py3-none-any.whl → 4.82.2__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/disease_terms.py +5 -2
- scout/adapter/mongo/query.py +23 -11
- scout/build/managed_variant.py +12 -1
- scout/build/variant/genotype.py +2 -0
- scout/build/variant/variant.py +5 -0
- scout/constants/clinvar.py +1 -1
- scout/constants/query_terms.py +3 -1
- scout/models/variant/variant.py +1 -0
- scout/parse/variant/frequency.py +56 -54
- scout/parse/variant/genotype.py +89 -15
- scout/parse/variant/transcript.py +17 -9
- scout/parse/variant/variant.py +12 -0
- scout/server/app.py +6 -3
- scout/server/blueprints/alignviewers/templates/alignviewers/utils.html +1 -1
- scout/server/blueprints/cases/controllers.py +2 -57
- scout/server/blueprints/cases/templates/cases/case_bionano.html +3 -24
- scout/server/blueprints/cases/templates/cases/case_report.html +87 -69
- scout/server/blueprints/cases/templates/cases/case_sma.html +2 -13
- scout/server/blueprints/cases/templates/cases/chanjo2_form.html +47 -0
- scout/server/blueprints/cases/templates/cases/collapsible_actionbar.html +4 -4
- scout/server/blueprints/cases/templates/cases/gene_panel.html +4 -11
- scout/server/blueprints/cases/templates/cases/individuals_table.html +2 -12
- scout/server/blueprints/cases/templates/cases/utils.html +20 -1
- scout/server/blueprints/cases/views.py +0 -22
- scout/server/blueprints/clinvar/controllers.py +3 -3
- scout/server/blueprints/clinvar/templates/clinvar/clinvar_submissions.html +29 -2
- scout/server/blueprints/clinvar/templates/clinvar/multistep_add_variant.html +36 -18
- scout/server/blueprints/clinvar/views.py +13 -1
- scout/server/blueprints/diagnoses/controllers.py +2 -0
- scout/server/blueprints/institutes/controllers.py +76 -38
- scout/server/blueprints/institutes/templates/overview/cases.html +54 -42
- scout/server/blueprints/managed_variants/templates/managed_variants/managed_variants.html +1 -1
- scout/server/blueprints/managed_variants/views.py +2 -4
- scout/server/blueprints/panels/templates/panels/panel.html +8 -7
- scout/server/blueprints/panels/views.py +2 -11
- scout/server/blueprints/phenotypes/templates/phenotypes/hpo_terms.html +3 -2
- scout/server/blueprints/variant/controllers.py +3 -2
- scout/server/blueprints/variant/templates/variant/components.html +1 -1
- scout/server/blueprints/variant/templates/variant/utils.html +3 -1
- scout/server/blueprints/variant/templates/variant/variant.html +20 -15
- scout/server/blueprints/variant/templates/variant/variant_details.html +78 -26
- scout/server/blueprints/variant/utils.py +9 -13
- scout/server/blueprints/variants/controllers.py +30 -3
- scout/server/blueprints/variants/forms.py +15 -1
- scout/server/blueprints/variants/templates/variants/components.html +55 -0
- scout/server/blueprints/variants/templates/variants/fusion-variants.html +3 -50
- scout/server/blueprints/variants/templates/variants/str-variants.html +8 -5
- scout/server/blueprints/variants/templates/variants/utils.html +57 -31
- scout/server/blueprints/variants/templates/variants/variants.html +1 -1
- scout/server/blueprints/variants/utils.py +7 -10
- scout/server/extensions/clinvar_extension.py +10 -2
- {scout_browser-4.81.dist-info → scout_browser-4.82.2.dist-info}/METADATA +6 -5
- {scout_browser-4.81.dist-info → scout_browser-4.82.2.dist-info}/RECORD +58 -57
- {scout_browser-4.81.dist-info → scout_browser-4.82.2.dist-info}/LICENSE +0 -0
- {scout_browser-4.81.dist-info → scout_browser-4.82.2.dist-info}/WHEEL +0 -0
- {scout_browser-4.81.dist-info → scout_browser-4.82.2.dist-info}/entry_points.txt +0 -0
- {scout_browser-4.81.dist-info → scout_browser-4.82.2.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@ import itertools
|
|
4
4
|
import json
|
5
5
|
import logging
|
6
6
|
import os
|
7
|
-
from typing import Dict, List,
|
7
|
+
from typing import Dict, List, Set
|
8
8
|
|
9
9
|
import query_phenomizer
|
10
10
|
import requests
|
@@ -85,61 +85,6 @@ def phenomizer_diseases(hpo_ids, case_obj, p_value_treshold=1):
|
|
85
85
|
flash("Could not establish a conection to Phenomizer", "danger")
|
86
86
|
|
87
87
|
|
88
|
-
def chanjo2_coverage_report_contents(
|
89
|
-
institute_obj: dict, case_obj: dict, panel_name: str, panel_id: Optional[str], report_type: str
|
90
|
-
) -> Optional[str]:
|
91
|
-
"""Retrieve the HTML contents of the Chanjo2 coverage report/overview for a case."""
|
92
|
-
|
93
|
-
if panel_id:
|
94
|
-
hgnc_gene_ids: List[int] = store.panel_to_genes(panel_id=panel_id, gene_format="hgnc_id")
|
95
|
-
elif panel_name == "HPO Panel":
|
96
|
-
hgnc_gene_ids: List[int] = [
|
97
|
-
gene["hgnc_id"] for gene in case_obj.get("dynamic_gene_list", [])
|
98
|
-
]
|
99
|
-
else:
|
100
|
-
hgnc_gene_ids: List[int] = _get_default_panel_genes(store, case_obj)
|
101
|
-
|
102
|
-
if not hgnc_gene_ids:
|
103
|
-
flash("Case should have at least one default gene panel containing genes", "warning")
|
104
|
-
return
|
105
|
-
|
106
|
-
query_samples: List[dict] = []
|
107
|
-
analysis_types: List[str] = []
|
108
|
-
|
109
|
-
for ind in case_obj.get("individuals", []):
|
110
|
-
if not ind.get("d4_file"):
|
111
|
-
continue
|
112
|
-
query_samples.append(
|
113
|
-
{
|
114
|
-
"name": ind.get("display_name"),
|
115
|
-
"coverage_file_path": ind.get("d4_file"),
|
116
|
-
"case_name": case_obj["display_name"],
|
117
|
-
"analysis_date": case_obj["analysis_date"].isoformat(),
|
118
|
-
}
|
119
|
-
)
|
120
|
-
analysis_types.append(ind.get("analysis_type"))
|
121
|
-
|
122
|
-
interval_type = "genes"
|
123
|
-
if "wes" in analysis_types:
|
124
|
-
interval_type = "transcripts"
|
125
|
-
elif "wts" in analysis_types:
|
126
|
-
interval_type = "exons"
|
127
|
-
|
128
|
-
report_query: dict = {
|
129
|
-
"build": "GRCh38" if "38" in case_obj.get("genome_build", "37") else "GRCh37",
|
130
|
-
"default_level": institute_obj.get("coverage_cutoff"),
|
131
|
-
"interval_type": interval_type,
|
132
|
-
"panel_name": panel_name,
|
133
|
-
"case_display_name": case_obj["display_name"],
|
134
|
-
"hgnc_gene_ids": hgnc_gene_ids,
|
135
|
-
"samples": query_samples,
|
136
|
-
}
|
137
|
-
|
138
|
-
report_url: str = "/".join([current_app.config.get("CHANJO2_URL"), report_type])
|
139
|
-
response = requests.post(report_url, json=report_query)
|
140
|
-
return response.text
|
141
|
-
|
142
|
-
|
143
88
|
def coverage_report_contents(base_url, institute_obj, case_obj):
|
144
89
|
"""Capture the contents of a case coverage report (chanjo-report), to be displayed in the general case report
|
145
90
|
|
@@ -389,7 +334,7 @@ def case(store, institute_obj, case_obj):
|
|
389
334
|
clinvar_variants_not_in_suspects = [
|
390
335
|
store.variant(variant_id) or variant_id
|
391
336
|
for variant_id in case_obj["clinvar_variants"]
|
392
|
-
if variant_id not in
|
337
|
+
if variant_id not in case_obj.get("suspects", [])
|
393
338
|
]
|
394
339
|
|
395
340
|
case_obj["clinvar_variants_not_in_suspects"] = clinvar_variants_not_in_suspects
|
@@ -1,5 +1,6 @@
|
|
1
1
|
{% extends "cases/case_tabular_view.html" %}
|
2
2
|
{% from "utils.html" import comments_panel, activity_panel %}
|
3
|
+
{% from "cases/utils.html" import sex_table_cell_content %}
|
3
4
|
|
4
5
|
{% block title %}
|
5
6
|
{{ super() }}
|
@@ -96,18 +97,7 @@
|
|
96
97
|
{% if loop.index == 1 %}
|
97
98
|
<td> {{ ind.display_name }}</td>
|
98
99
|
<td style="font-weight: bold;">
|
99
|
-
|
100
|
-
{% if ind.sex_human == 'female' %}
|
101
|
-
F
|
102
|
-
{% elif ind.sex_human == 'male' %}
|
103
|
-
M
|
104
|
-
{% else %}
|
105
|
-
{{ind.sex_human}}
|
106
|
-
{% endif %}
|
107
|
-
{% endif %}
|
108
|
-
{% if ind.confirmed_sex %}
|
109
|
-
<i class="fa fa-check"></i>
|
110
|
-
{% endif %}
|
100
|
+
{{ sex_table_cell_content(ind) }}
|
111
101
|
</td>
|
112
102
|
<td>{{ ind.phenotype_human }}</td>
|
113
103
|
{% else %}
|
@@ -130,18 +120,7 @@
|
|
130
120
|
<tr class="bg-secondary text-white">
|
131
121
|
<td> {{ ind.display_name }}</td>
|
132
122
|
<td style="font-weight: bold;">
|
133
|
-
|
134
|
-
{% if ind.sex_human == 'female' %}
|
135
|
-
F
|
136
|
-
{% elif ind.sex_human == 'male' %}
|
137
|
-
M
|
138
|
-
{% else %}
|
139
|
-
{{ind.sex_human}}
|
140
|
-
{% endif %}
|
141
|
-
{% endif %}
|
142
|
-
{% if ind.confirmed_sex %}
|
143
|
-
<i class="fa fa-check"></i>
|
144
|
-
{% endif %}
|
123
|
+
{{ sex_table_cell_content(ind) }}
|
145
124
|
</td>
|
146
125
|
<td>{{ ind.phenotype_human }}</td>
|
147
126
|
<td colspan="4">N/A</td>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
{% from "cases/utils.html" import variant_transcripts %}
|
2
2
|
{% from "utils.html" import comments_table, variant_related_comments_table %}
|
3
|
+
{% from "variants/components.html" import fusion_variants_header, default_fusion_variant_cells %}
|
3
4
|
|
4
5
|
{% extends "report_base.html" %}
|
5
6
|
|
@@ -123,9 +124,11 @@
|
|
123
124
|
{% else %}
|
124
125
|
n.a.
|
125
126
|
{% endif %}
|
126
|
-
|
127
|
-
|
128
|
-
|
127
|
+
{% if ind.confirmed_sex %}
|
128
|
+
<span class="badge rounded-pill py-1 bg-secondary">V</span>
|
129
|
+
{% else %}
|
130
|
+
<span class="fa fa-exclamation-circle text-danger" data-bs-toggle='tooltip' title="Sex is not confirmed."></span>
|
131
|
+
{% endif %}
|
129
132
|
</td>
|
130
133
|
<td>
|
131
134
|
{% if ind.phenotype==2 %} <!--for later use-->
|
@@ -174,27 +177,30 @@
|
|
174
177
|
{% endif %}
|
175
178
|
</td>
|
176
179
|
<td class="ms-3 d-flex align-items-start flex-column" style="border-bottom:none;">
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
180
|
+
<strong>Associated phenotypes:</strong>
|
181
|
+
{% if case.phenotype_terms %}
|
182
|
+
<ul>
|
183
|
+
{% for pheno in case.phenotype_terms %}
|
184
|
+
<li>
|
185
|
+
{{pheno.feature}} - (<a style="text-decoration:none;" href="https://hpo.jax.org/app/browse/term/{{pheno.phenotype_id}}" target="_blank">{{pheno.phenotype_id}})</a>
|
186
|
+
{% for feature_ind in pheno.individuals %} <!-- display eventual individual-level HPO terms -->
|
187
|
+
{% for case_ind in case.individuals %}
|
188
|
+
{% if feature_ind.individual_name == case_ind.display_name %}
|
189
|
+
<span class="ms-1 {% if case_ind.phenotype == 2 %} text-danger {% endif %}">{{case_ind.display_name}}</span>
|
190
|
+
{% endif %}
|
191
|
+
{% endfor %}
|
188
192
|
{% endfor %}
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
193
|
+
</li>
|
194
|
+
{% endfor %}
|
195
|
+
</ul>
|
196
|
+
{% else %}
|
197
|
+
<ul style="list-style-type: none; padding-left:0;">
|
198
|
+
<li>
|
199
|
+
No associated HPO terms.
|
200
|
+
</li>
|
201
|
+
</ul>
|
202
|
+
{% endif %}
|
203
|
+
<strong>Associated diagnoses:</strong>
|
198
204
|
{% if case.diagnosis_phenotypes %}
|
199
205
|
<ul>
|
200
206
|
{% for dia in case.diagnosis_phenotypes %}
|
@@ -211,7 +217,11 @@
|
|
211
217
|
{% endfor %}
|
212
218
|
</ul>
|
213
219
|
{% else %}
|
214
|
-
|
220
|
+
<ul style="list-style-type: none;padding-left:0;">
|
221
|
+
<li>
|
222
|
+
No associated diagnoses.
|
223
|
+
</li>
|
224
|
+
</ul>
|
215
225
|
{% endif %}
|
216
226
|
</td>
|
217
227
|
</tr>
|
@@ -354,10 +364,10 @@
|
|
354
364
|
{% do printed_vars.append(pinned['_id']) %}
|
355
365
|
{% do pinned_not_causative_variants.append(pinned['_id']) %}
|
356
366
|
{{ variant_content(pinned, loop.index) }}
|
367
|
+
<br>
|
357
368
|
{% else %}
|
358
369
|
{% do duplicated_variants.append(pinned['_id']) %}
|
359
370
|
{% endif %}
|
360
|
-
<br>
|
361
371
|
{% endfor %}
|
362
372
|
{% else %}
|
363
373
|
No pinned variants available for this case
|
@@ -381,10 +391,10 @@
|
|
381
391
|
{% if variant['_id'] not in printed_vars %}
|
382
392
|
{% do printed_vars.append(variant['_id']) %}
|
383
393
|
{{ variant_content(variant, loop.index) }}
|
394
|
+
<br>
|
384
395
|
{% else %}
|
385
396
|
{% do duplicated_variants.append(variant['_id']) %}
|
386
397
|
{% endif %}
|
387
|
-
<br>
|
388
398
|
{% endfor %}
|
389
399
|
{% else %}
|
390
400
|
No ACMG-classified variants available for this case
|
@@ -408,10 +418,10 @@
|
|
408
418
|
{% if variant['_id'] not in printed_vars %}
|
409
419
|
{% do printed_vars.append(variant['_id']) %}
|
410
420
|
{{ variant_content(variant, loop.index) }}
|
421
|
+
<br>
|
411
422
|
{% else %}
|
412
423
|
{% do duplicated_variants.append(variant['_id']) %}
|
413
424
|
{% endif %}
|
414
|
-
<br>
|
415
425
|
{% endfor %}
|
416
426
|
{% endif %}
|
417
427
|
{% if variants.tier_detailed %}
|
@@ -419,10 +429,10 @@
|
|
419
429
|
{% if variant['_id'] not in printed_vars %}
|
420
430
|
{% do printed_vars.append(variant['_id']) %}
|
421
431
|
{{ variant_content(variant, loop.index) }}
|
432
|
+
<br>
|
422
433
|
{% else %}
|
423
434
|
{% do duplicated_variants.append(variant['_id']) %}
|
424
435
|
{% endif %}
|
425
|
-
<br>
|
426
436
|
{% endfor %}
|
427
437
|
{% endif %}
|
428
438
|
{% if not (variants.tagged_detailed or variants.tier_detailed) %}
|
@@ -435,6 +445,18 @@
|
|
435
445
|
</div>
|
436
446
|
{% endmacro %}
|
437
447
|
|
448
|
+
{% macro overlapping_panels(variant) %}
|
449
|
+
{% if variant.case_panels %}
|
450
|
+
{% if variant.case_panels|length <= 3 %}
|
451
|
+
{% for panel in variant.case_panels %}
|
452
|
+
<a style="text-decoration:none;" href="{{ url_for('panels.panel', panel_id=panel_id) }}" target="_blank" rel="noopener" class="badge bg-secondary">{{ panel.panel_name }}</a><br>
|
453
|
+
{% endfor %}
|
454
|
+
{% else %}
|
455
|
+
{{ variant.case_panels|length }} panels
|
456
|
+
{% endif %}
|
457
|
+
{% endif %}
|
458
|
+
{% endmacro %}
|
459
|
+
|
438
460
|
{% macro variant_content(variant, index) %}
|
439
461
|
{% if variant.category == 'snv' %}
|
440
462
|
{{ sn_variant_content(variant, index) }}
|
@@ -467,10 +489,10 @@
|
|
467
489
|
{% else %}
|
468
490
|
{{ sv_variant_content(variant, loop.index) }}
|
469
491
|
{% endif %}
|
492
|
+
<br>
|
470
493
|
{% else %}
|
471
494
|
{% do duplicated_variants.append(variant['_id']) %}
|
472
495
|
{% endif %}
|
473
|
-
<br>
|
474
496
|
{% endfor %}
|
475
497
|
{% else %}
|
476
498
|
No commented variants for this case
|
@@ -536,22 +558,14 @@
|
|
536
558
|
{% endif %}
|
537
559
|
</td>
|
538
560
|
<td>
|
539
|
-
{
|
540
|
-
{% if variant.panels|length <= 3 %}
|
541
|
-
{% for panel_id in variant.panels %}
|
542
|
-
<a style="text-decoration:none;" href="{{ url_for('panels.panel', panel_id=panel_id) }}" rel="noopener" target="_blank" class="badge bg-secondary">{{ panel_id }}</a><br>
|
543
|
-
{% endfor %}
|
544
|
-
{% else %}
|
545
|
-
{{ variant.panels|length }} panels
|
546
|
-
{% endif %}
|
547
|
-
{% endif %}
|
561
|
+
{{ overlapping_panels(variant) }}
|
548
562
|
</td>
|
549
563
|
</tr>
|
550
564
|
</tbody>
|
551
565
|
</table>
|
552
566
|
<table class="table table-sm">
|
553
567
|
<tr>
|
554
|
-
<td style="width
|
568
|
+
<td style="width:60%;">
|
555
569
|
{{ genotype_table(variant) }}
|
556
570
|
</td>
|
557
571
|
<td style="width:3%"></td>
|
@@ -627,8 +641,8 @@
|
|
627
641
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
628
642
|
<thead>
|
629
643
|
<tr>
|
630
|
-
<th>
|
631
|
-
<th>
|
644
|
+
<th>Rank</th>
|
645
|
+
<th>Score</th>
|
632
646
|
<th>Manual rank</th>
|
633
647
|
<th>CADD score</th>
|
634
648
|
{% if not cancer %}
|
@@ -763,8 +777,8 @@
|
|
763
777
|
</thead>
|
764
778
|
{% for variant in variants.dismissed_detailed|sort(attribute='variant_rank') %}
|
765
779
|
<tr{% if loop.index0 % 2 %} class="light-grey" {% endif %}>
|
766
|
-
<td
|
767
|
-
<td
|
780
|
+
<td style="width:5%,">#{{loop.index}}</td>
|
781
|
+
<td style="width:25%;">
|
768
782
|
{% if variant.category == 'snv' %}
|
769
783
|
<a href="{{ url_for('variant.variant', institute_id=institute._id, case_name=case.display_name, variant_id=variant._id) }}" target="_blank"><strong>{{variant.display_name[:30]}}</strong></a>
|
770
784
|
{% elif variant.category == 'cancer' %}
|
@@ -775,8 +789,8 @@
|
|
775
789
|
<a href="{{ url_for('variant.variant', institute_id=institute._id, case_name=case.display_name, variant_id=variant._id) }}" target="_blank"><strong>rep. {{variant.str_repid}}</strong></a>
|
776
790
|
{% endif %}
|
777
791
|
</td>
|
778
|
-
<td
|
779
|
-
<td
|
792
|
+
<td style="width:5%;">{{variant.category|upper}}</td>
|
793
|
+
<td style="width:15%;"
|
780
794
|
{{ dismissed_gene_list(variant) }}
|
781
795
|
</td>
|
782
796
|
|
@@ -957,15 +971,7 @@
|
|
957
971
|
<td>-</td>
|
958
972
|
{% endif %}
|
959
973
|
<td>
|
960
|
-
{
|
961
|
-
{% if variant.panels|length <= 3 %}
|
962
|
-
{% for panel_id in variant.panels %}
|
963
|
-
<a style="text-decoration:none;" href="{{ url_for('panels.panel', panel_id=panel_id) }}" rel="noopener" target="_blank" class="badge bg-secondary">{{ panel_id }}</a><br>
|
964
|
-
{% endfor %}
|
965
|
-
{% else %}
|
966
|
-
{{ variant.panels|length }} panels
|
967
|
-
{% endif %}
|
968
|
-
{% endif %}
|
974
|
+
{{ overlapping_panels(variant) }}
|
969
975
|
</td>
|
970
976
|
<td>
|
971
977
|
{% if variant.callers %}
|
@@ -981,7 +987,7 @@
|
|
981
987
|
</table>
|
982
988
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
983
989
|
<tr>
|
984
|
-
<td>
|
990
|
+
<td style="width:60%;">
|
985
991
|
{{genotype_table(variant)}}
|
986
992
|
</td>
|
987
993
|
<td style="width:3%"></td>
|
@@ -1008,11 +1014,30 @@
|
|
1008
1014
|
</td>
|
1009
1015
|
</tr>
|
1010
1016
|
</table>
|
1017
|
+
{% if variant.category == "fusion" %}
|
1018
|
+
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
1019
|
+
{{ fusion_variants_header() }}
|
1020
|
+
<tbody>
|
1021
|
+
<tr>
|
1022
|
+
<td class="text-center">{{variant.variant_rank}}</td>
|
1023
|
+
<td>
|
1024
|
+
{% if variant.cancer_tier %}
|
1025
|
+
<span class="badge rounded-pill bg-secondary" title="Tier">{{ cancer_tier_options[variant.cancer_tier]['label'] }}</span>
|
1026
|
+
{% endif %}
|
1027
|
+
{% if variant.acmg_classification %}
|
1028
|
+
<span class="badge rounded-pill bg-{{variant.acmg_classification['color'] if variant.acmg_classification['color'] else 'secondary'}}" title="{{variant.acmg_classification['code']}}">{{variant.acmg_classification['code'] }}</span>
|
1029
|
+
{% endif %}
|
1030
|
+
</td>
|
1031
|
+
{{ default_fusion_variant_cells(institute, case, variant) }}
|
1032
|
+
</tr>
|
1033
|
+
</tbody>
|
1034
|
+
</table>
|
1035
|
+
{% else %}
|
1011
1036
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
1012
1037
|
<thead>
|
1013
1038
|
<tr>
|
1014
|
-
<th>
|
1015
|
-
<th>
|
1039
|
+
<th>Rank</th>
|
1040
|
+
<th>Score</th>
|
1016
1041
|
<th>Manual rank</th>
|
1017
1042
|
{% if not cancer %}
|
1018
1043
|
<th>Inheritance models</th>
|
@@ -1058,6 +1083,7 @@
|
|
1058
1083
|
</tr>
|
1059
1084
|
</tbody>
|
1060
1085
|
</table>
|
1086
|
+
{% endif %}
|
1061
1087
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
1062
1088
|
{% if variant.genes and variant.genes|length <= 3 %}
|
1063
1089
|
<thead>
|
@@ -1145,7 +1171,7 @@
|
|
1145
1171
|
<tr class="bg-warning">
|
1146
1172
|
{% endif %}
|
1147
1173
|
<td><span class="badge bg-info">{{variant.category | upper}}</span></td>
|
1148
|
-
<td>{{ variant.
|
1174
|
+
<td>{{ variant.str_mc }}</td>
|
1149
1175
|
<td>{{ variant.str_ref }}</td>
|
1150
1176
|
<td>
|
1151
1177
|
{% if variant.chromosome == variant.end_chrom %}
|
@@ -1155,15 +1181,7 @@
|
|
1155
1181
|
{% endif %}
|
1156
1182
|
</td>
|
1157
1183
|
<td>
|
1158
|
-
{
|
1159
|
-
{% if variant.panels|length <= 3 %}
|
1160
|
-
{% for panel_id in variant.panels %}
|
1161
|
-
<a style="text-decoration:none;" href="{{ url_for('panels.panel', panel_id=panel_id) }}" target="_blank" class="badge bg-secondary">{{ panel_id }}</a><br>
|
1162
|
-
{% endfor %}
|
1163
|
-
{% else %}
|
1164
|
-
{{ variant.panels|length }} panels
|
1165
|
-
{% endif %}
|
1166
|
-
{% endif %}
|
1184
|
+
{{ overlapping_panels(variant) }}
|
1167
1185
|
</td>
|
1168
1186
|
</tr>
|
1169
1187
|
</tbody>
|
@@ -1214,8 +1232,8 @@
|
|
1214
1232
|
<table id="panel-table" class="table table-sm table-bordered" style="background-color: transparent; margin-left:-.3rem;">
|
1215
1233
|
<thead>
|
1216
1234
|
<tr class="table-secondary">
|
1217
|
-
<th>
|
1218
|
-
<th>
|
1235
|
+
<th>Rank</th>
|
1236
|
+
<th>Score</th>
|
1219
1237
|
<th>Manual rank</th>
|
1220
1238
|
</tr>
|
1221
1239
|
</thead>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{% extends "cases/case_tabular_view.html" %}
|
2
2
|
{% from "utils.html" import comments_panel, activity_panel %}
|
3
|
-
{% from "cases/utils.html" import individuals_table %}
|
3
|
+
{% from "cases/utils.html" import individuals_table, sex_table_cell_content %}
|
4
4
|
|
5
5
|
{% block title %}
|
6
6
|
{{ super() }}
|
@@ -100,18 +100,7 @@
|
|
100
100
|
{% endif %}>
|
101
101
|
<td>{{ ind.display_name }}</td>
|
102
102
|
<td style="font-weight: bold;">
|
103
|
-
{
|
104
|
-
{% if ind.sex_human == 'female' %}
|
105
|
-
F
|
106
|
-
{% elif ind.sex_human == 'male' %}
|
107
|
-
M
|
108
|
-
{% else %}
|
109
|
-
{{ind.sex_human}}
|
110
|
-
{% endif %}
|
111
|
-
{% endif %}
|
112
|
-
{% if ind.confirmed_sex %}
|
113
|
-
<i class="fa fa-check"></i>
|
114
|
-
{% endif %}
|
103
|
+
{{ sex_table_cell_content(ind) }}
|
115
104
|
</td>
|
116
105
|
<td>{{ ind.phenotype_human }}</td>
|
117
106
|
<td>{{ ind.is_sma }}</td>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
{% macro chanjo2_report_form(institute_obj, case_obj, panel_name, report_type, hgnc_ids, link_text) %}
|
2
|
+
|
3
|
+
{% set form_name = "chanjo2_"+panel_name+"_"+report_type %}
|
4
|
+
{% set form_action = config.CHANJO2_URL+"/"+report_type %}
|
5
|
+
{% set build = "GRCh38" if "38" in case_obj.get("genome_build", "37") else "GRCh37" %}
|
6
|
+
{% set default_level = institute_obj.coverage_cutoff %}
|
7
|
+
{% set interval_type = "genes" %} <!-- wgs analysis as default -->
|
8
|
+
{% set samples = [] %}
|
9
|
+
{% set analysis_types = [] %}
|
10
|
+
|
11
|
+
<!-- set sample dictionaries -->
|
12
|
+
|
13
|
+
{% for ind in case_obj.individuals %}
|
14
|
+
{% if ind.d4_file %}
|
15
|
+
{% set sample = {
|
16
|
+
"name" : ind.display_name,
|
17
|
+
"coverage_file_path" : ind.d4_file,
|
18
|
+
"case_name" : case_obj.display_name,
|
19
|
+
"analysis_date" : case_obj.analysis_date.strftime("%FT%T.%f")[:-3] ~ "Z" }
|
20
|
+
%}
|
21
|
+
{% do samples.append( sample ) %}
|
22
|
+
{% do analysis_types.append( ind.analysis_type ) %}
|
23
|
+
{% endif %}
|
24
|
+
{% endfor %}
|
25
|
+
|
26
|
+
{% if "wes" in analysis_types %}
|
27
|
+
{% set interval_type = "exons" %}
|
28
|
+
{% elif "wts" in analysis_types %}
|
29
|
+
{% set interval_type = "transcripts" %}
|
30
|
+
{% endif %}
|
31
|
+
|
32
|
+
<form name="{{form_name}}" method="post" action="{{form_action}}" target="_blank" rel="noopener">
|
33
|
+
<input type="hidden" id="build" name="build" value="{{build}}">
|
34
|
+
<input type="hidden" id="default_level" name="default_level" value="{{default_level}}">
|
35
|
+
<input type="hidden" id="interval_type" name="interval_type" value="{{interval_type}}">
|
36
|
+
<input type="hidden" id="panel_name" name="panel_name" value="{{panel_name}}">
|
37
|
+
<input type="hidden" id="case_display_name" name="case_display_name" value="{{case_obj.display_name}}">
|
38
|
+
<input type="hidden" id="hgnc_gene_ids" name="hgnc_gene_ids" value={{hgnc_ids}}>
|
39
|
+
<input type="hidden" id="samples" name="samples" value="{{samples|safe}}">
|
40
|
+
{% if panel_name == "HPO Panel" %}
|
41
|
+
<button type="submit" class="btn btn-secondary btn-sm text-white"> Coverage {{report_type}} (Chanjo2) </button>
|
42
|
+
{% else %}
|
43
|
+
<a class="link-primary" onclick="this.closest('form').submit();return false;">{{link_text}}</a>
|
44
|
+
{% endif %}
|
45
|
+
</form>
|
46
|
+
|
47
|
+
{% endmacro %}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
{% from "cases/chanjo2_form.html" import chanjo2_report_form %}
|
2
|
+
|
1
3
|
{% macro action_bar(institute, case, causatives, collaborators, current_user, report_types, has_rna_tracks) %}
|
2
4
|
<!-- Collapsible Sidebar, Based on https://www.codeply.com/go/LFd2SEMECH -->
|
3
5
|
<div id="sidebar-container" class="sidebar-expanded d-none d-md-block"><!-- d-* hiddens the Sidebar in smaller devices. Its itens can be kept on the Navbar 'Menu' -->
|
@@ -84,13 +86,11 @@
|
|
84
86
|
</div>
|
85
87
|
|
86
88
|
<!-- If connected to a chanjo or chanjo2 instance, display coverage report -->
|
87
|
-
{% if case.chanjo2_coverage %}
|
89
|
+
{% if case.chanjo2_coverage and case.default_genes %}
|
88
90
|
<div href="#" class="bg-dark list-group-item text-white">
|
89
91
|
<div class="d-flex flex-row flex-fill bd-highlight">
|
90
92
|
<span class="menu-collapsed">Coverage (chanjo2)</span>
|
91
|
-
|
92
|
-
<span class="fa fa-link"></span>
|
93
|
-
</a>
|
93
|
+
{{ chanjo2_report_form(institute, case, case.panel_names|join(', '), 'report', case.default_genes|join(','), "<span class='fa fa-link'></span>"|safe ) }} <!--chanjo2 report-->
|
94
94
|
</div>
|
95
95
|
</div>
|
96
96
|
{% endif %}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
{% from "cases/chanjo2_form.html" import chanjo2_report_form %}
|
2
|
+
|
1
3
|
{% macro genepanels_table(case, institute) %}
|
2
4
|
<div class="card panel-default">
|
3
5
|
<div class="panel-heading">Gene panels</div>
|
@@ -211,17 +213,8 @@
|
|
211
213
|
{% endif %}
|
212
214
|
|
213
215
|
{% if case.chanjo2_coverage %}
|
214
|
-
|
215
|
-
|
216
|
-
case_name=case.display_name, panel_name='HPO Panel', report_type='report') }}" target="_blank" rel="noopener">
|
217
|
-
Coverage report (Chanjo2)
|
218
|
-
</a>
|
219
|
-
|
220
|
-
<a class="btn btn-secondary btn-sm text-white"
|
221
|
-
href="{{ url_for('cases.chanjo2_coverage_report', institute_id=institute._id,
|
222
|
-
case_name=case.display_name, panel_name='HPO Panel', report_type='overview') }}" target="_blank" rel="noopener">
|
223
|
-
Coverage overview (Chanjo2)
|
224
|
-
</a>
|
216
|
+
{{ chanjo2_report_form(institute, case, "HPO Panel", 'report', case.dynamic_gene_list|map(attribute='hgnc_id')|join(',')) }} <!--chanjo2 report-->
|
217
|
+
{{ chanjo2_report_form(institute, case, "HPO Panel", 'overview', case.dynamic_gene_list|map(attribute='hgnc_id')|join(',')) }} <!--chanjo2 genes overview -->
|
225
218
|
{% endif %}
|
226
219
|
|
227
220
|
</div>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
{% from "cases/utils.html" import sex_table_cell_content %}
|
1
2
|
|
2
3
|
{% macro cancer_individuals_table(case, institute, tissues, gens_info=None) %}
|
3
4
|
<form method="POST" action="{{ url_for('cases.update_cancer_sample', institute_id=institute._id, case_name=case.display_name) }}">
|
@@ -138,18 +139,7 @@
|
|
138
139
|
<option {% if not ind.sex_human in ["female", "male"] %} selected= {% endif %} value="unknown">Unknown</option>
|
139
140
|
</select>
|
140
141
|
<div class="sex-display fw-bold">
|
141
|
-
{
|
142
|
-
{% if ind.sex_human == 'female' %}
|
143
|
-
F
|
144
|
-
{% elif ind.sex_human == 'male' %}
|
145
|
-
M
|
146
|
-
{% else %}
|
147
|
-
{{ind.sex_human}}
|
148
|
-
{% endif %}
|
149
|
-
{% endif %}
|
150
|
-
{% if ind.confirmed_sex %}
|
151
|
-
<i class="fa fa-check"></i>
|
152
|
-
{% endif %}
|
142
|
+
{{ sex_table_cell_content(ind) }}
|
153
143
|
</div>
|
154
144
|
</td>
|
155
145
|
<td><input name="age_{{ind.individual_id}}" type="number" step="0.1" min="0"
|
@@ -268,7 +268,7 @@
|
|
268
268
|
|
269
269
|
<!-- show transcript info only if it's canonical, disease-associated or primary (print max 5 primary transcripts) -->
|
270
270
|
{% if transcript.refseq_identifiers and n_primary_txs.count <= 5 or transcript.is_canonical or transcript.is_disease_associated or transcript.is_primary %}
|
271
|
-
<li>{{transcript.transcript_id}}, RefSeq:[{{ transcript.refseq_identifiers|join(", ") or "-" }}], {{ (transcript.coding_sequence_name or '')|truncate(20, True) }}, {{ (transcript.protein_sequence_name or '')|url_decode|truncate(20, True) }}
|
271
|
+
<li class="mb-1">{{transcript.transcript_id}}, RefSeq:[{{ transcript.refseq_identifiers|join(", ") or "-" }}], {{ (transcript.coding_sequence_name or '')|truncate(20, True) }}, {{ (transcript.protein_sequence_name or '')|url_decode|truncate(20, True) }}
|
272
272
|
{% if transcript.is_canonical %}
|
273
273
|
<span class="badge rounded-pill bg-info text-white" title="canonical">C</span>
|
274
274
|
{% endif %}
|
@@ -602,6 +602,8 @@
|
|
602
602
|
<form id="clinvar_submit" class="d-flex justify-content-center" action="{{ url_for('clinvar.clinvar_add_variant', institute_id=institute._id, case_name=case.display_name) }}" method="POST">
|
603
603
|
{% if case.clinvar_variants and variant._id in case.clinvar_variants.keys() %}
|
604
604
|
(included in ClinVar submission)
|
605
|
+
{% elif variant.category in ('cancer', 'cancer_sv') %}
|
606
|
+
<button data-bs-toggle='tooltip' data-bs-placement="bottom" title="Submission of somatic variants from Scout is temporarily suspended. We are working to harmonize submissions with changes introduced by ClinVar for this variant category." disabled >Add to ClinVar submission</button>
|
605
607
|
{% else %}
|
606
608
|
<button type="submit" name="var_id" value="{{variant._id}}" class="btn btn-secondary btn-sm" style="float: right;">Add to ClinVar submission</button>
|
607
609
|
{% endif %}
|
@@ -679,3 +681,20 @@
|
|
679
681
|
</div>
|
680
682
|
</form>
|
681
683
|
{% endmacro %}
|
684
|
+
|
685
|
+
{% macro sex_table_cell_content(ind) %}
|
686
|
+
{% if ind.sex_human in ['female','male'] %}
|
687
|
+
{% if ind.sex_human == 'female' %}
|
688
|
+
F
|
689
|
+
{% elif ind.sex_human == 'male' %}
|
690
|
+
M
|
691
|
+
{% else %}
|
692
|
+
{{ind.sex_human}}
|
693
|
+
{% endif %}
|
694
|
+
{% endif %}
|
695
|
+
{% if ind.confirmed_sex %}
|
696
|
+
<i class="fa fa-check"></i>
|
697
|
+
{% else %}
|
698
|
+
<span class="fa fa-exclamation-circle text-danger" data-bs-toggle='tooltip' title="Sex is not confirmed."></span>
|
699
|
+
{% endif %}
|
700
|
+
{% endmacro %}
|