scout-browser 4.81__py3-none-any.whl → 4.82.1__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_report.html +82 -66
- 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/utils.html +3 -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 +32 -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.1.dist-info}/METADATA +6 -5
- {scout_browser-4.81.dist-info → scout_browser-4.82.1.dist-info}/RECORD +55 -54
- {scout_browser-4.81.dist-info → scout_browser-4.82.1.dist-info}/LICENSE +0 -0
- {scout_browser-4.81.dist-info → scout_browser-4.82.1.dist-info}/WHEEL +0 -0
- {scout_browser-4.81.dist-info → scout_browser-4.82.1.dist-info}/entry_points.txt +0 -0
- {scout_browser-4.81.dist-info → scout_browser-4.82.1.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
|
{% 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
|
|
@@ -174,27 +175,30 @@
|
|
174
175
|
{% endif %}
|
175
176
|
</td>
|
176
177
|
<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
|
-
|
178
|
+
<strong>Associated phenotypes:</strong>
|
179
|
+
{% if case.phenotype_terms %}
|
180
|
+
<ul>
|
181
|
+
{% for pheno in case.phenotype_terms %}
|
182
|
+
<li>
|
183
|
+
{{pheno.feature}} - (<a style="text-decoration:none;" href="https://hpo.jax.org/app/browse/term/{{pheno.phenotype_id}}" target="_blank">{{pheno.phenotype_id}})</a>
|
184
|
+
{% for feature_ind in pheno.individuals %} <!-- display eventual individual-level HPO terms -->
|
185
|
+
{% for case_ind in case.individuals %}
|
186
|
+
{% if feature_ind.individual_name == case_ind.display_name %}
|
187
|
+
<span class="ms-1 {% if case_ind.phenotype == 2 %} text-danger {% endif %}">{{case_ind.display_name}}</span>
|
188
|
+
{% endif %}
|
189
|
+
{% endfor %}
|
188
190
|
{% endfor %}
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
191
|
+
</li>
|
192
|
+
{% endfor %}
|
193
|
+
</ul>
|
194
|
+
{% else %}
|
195
|
+
<ul style="list-style-type: none; padding-left:0;">
|
196
|
+
<li>
|
197
|
+
No associated HPO terms.
|
198
|
+
</li>
|
199
|
+
</ul>
|
200
|
+
{% endif %}
|
201
|
+
<strong>Associated diagnoses:</strong>
|
198
202
|
{% if case.diagnosis_phenotypes %}
|
199
203
|
<ul>
|
200
204
|
{% for dia in case.diagnosis_phenotypes %}
|
@@ -211,7 +215,11 @@
|
|
211
215
|
{% endfor %}
|
212
216
|
</ul>
|
213
217
|
{% else %}
|
214
|
-
|
218
|
+
<ul style="list-style-type: none;padding-left:0;">
|
219
|
+
<li>
|
220
|
+
No associated diagnoses.
|
221
|
+
</li>
|
222
|
+
</ul>
|
215
223
|
{% endif %}
|
216
224
|
</td>
|
217
225
|
</tr>
|
@@ -354,10 +362,10 @@
|
|
354
362
|
{% do printed_vars.append(pinned['_id']) %}
|
355
363
|
{% do pinned_not_causative_variants.append(pinned['_id']) %}
|
356
364
|
{{ variant_content(pinned, loop.index) }}
|
365
|
+
<br>
|
357
366
|
{% else %}
|
358
367
|
{% do duplicated_variants.append(pinned['_id']) %}
|
359
368
|
{% endif %}
|
360
|
-
<br>
|
361
369
|
{% endfor %}
|
362
370
|
{% else %}
|
363
371
|
No pinned variants available for this case
|
@@ -381,10 +389,10 @@
|
|
381
389
|
{% if variant['_id'] not in printed_vars %}
|
382
390
|
{% do printed_vars.append(variant['_id']) %}
|
383
391
|
{{ variant_content(variant, loop.index) }}
|
392
|
+
<br>
|
384
393
|
{% else %}
|
385
394
|
{% do duplicated_variants.append(variant['_id']) %}
|
386
395
|
{% endif %}
|
387
|
-
<br>
|
388
396
|
{% endfor %}
|
389
397
|
{% else %}
|
390
398
|
No ACMG-classified variants available for this case
|
@@ -408,10 +416,10 @@
|
|
408
416
|
{% if variant['_id'] not in printed_vars %}
|
409
417
|
{% do printed_vars.append(variant['_id']) %}
|
410
418
|
{{ variant_content(variant, loop.index) }}
|
419
|
+
<br>
|
411
420
|
{% else %}
|
412
421
|
{% do duplicated_variants.append(variant['_id']) %}
|
413
422
|
{% endif %}
|
414
|
-
<br>
|
415
423
|
{% endfor %}
|
416
424
|
{% endif %}
|
417
425
|
{% if variants.tier_detailed %}
|
@@ -419,10 +427,10 @@
|
|
419
427
|
{% if variant['_id'] not in printed_vars %}
|
420
428
|
{% do printed_vars.append(variant['_id']) %}
|
421
429
|
{{ variant_content(variant, loop.index) }}
|
430
|
+
<br>
|
422
431
|
{% else %}
|
423
432
|
{% do duplicated_variants.append(variant['_id']) %}
|
424
433
|
{% endif %}
|
425
|
-
<br>
|
426
434
|
{% endfor %}
|
427
435
|
{% endif %}
|
428
436
|
{% if not (variants.tagged_detailed or variants.tier_detailed) %}
|
@@ -435,6 +443,18 @@
|
|
435
443
|
</div>
|
436
444
|
{% endmacro %}
|
437
445
|
|
446
|
+
{% macro overlapping_panels(variant) %}
|
447
|
+
{% if variant.case_panels %}
|
448
|
+
{% if variant.case_panels|length <= 3 %}
|
449
|
+
{% for panel in variant.case_panels %}
|
450
|
+
<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>
|
451
|
+
{% endfor %}
|
452
|
+
{% else %}
|
453
|
+
{{ variant.case_panels|length }} panels
|
454
|
+
{% endif %}
|
455
|
+
{% endif %}
|
456
|
+
{% endmacro %}
|
457
|
+
|
438
458
|
{% macro variant_content(variant, index) %}
|
439
459
|
{% if variant.category == 'snv' %}
|
440
460
|
{{ sn_variant_content(variant, index) }}
|
@@ -467,10 +487,10 @@
|
|
467
487
|
{% else %}
|
468
488
|
{{ sv_variant_content(variant, loop.index) }}
|
469
489
|
{% endif %}
|
490
|
+
<br>
|
470
491
|
{% else %}
|
471
492
|
{% do duplicated_variants.append(variant['_id']) %}
|
472
493
|
{% endif %}
|
473
|
-
<br>
|
474
494
|
{% endfor %}
|
475
495
|
{% else %}
|
476
496
|
No commented variants for this case
|
@@ -536,22 +556,14 @@
|
|
536
556
|
{% endif %}
|
537
557
|
</td>
|
538
558
|
<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 %}
|
559
|
+
{{ overlapping_panels(variant) }}
|
548
560
|
</td>
|
549
561
|
</tr>
|
550
562
|
</tbody>
|
551
563
|
</table>
|
552
564
|
<table class="table table-sm">
|
553
565
|
<tr>
|
554
|
-
<td style="width
|
566
|
+
<td style="width:60%;">
|
555
567
|
{{ genotype_table(variant) }}
|
556
568
|
</td>
|
557
569
|
<td style="width:3%"></td>
|
@@ -627,8 +639,8 @@
|
|
627
639
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
628
640
|
<thead>
|
629
641
|
<tr>
|
630
|
-
<th>
|
631
|
-
<th>
|
642
|
+
<th>Rank</th>
|
643
|
+
<th>Score</th>
|
632
644
|
<th>Manual rank</th>
|
633
645
|
<th>CADD score</th>
|
634
646
|
{% if not cancer %}
|
@@ -763,8 +775,8 @@
|
|
763
775
|
</thead>
|
764
776
|
{% for variant in variants.dismissed_detailed|sort(attribute='variant_rank') %}
|
765
777
|
<tr{% if loop.index0 % 2 %} class="light-grey" {% endif %}>
|
766
|
-
<td
|
767
|
-
<td
|
778
|
+
<td style="width:5%,">#{{loop.index}}</td>
|
779
|
+
<td style="width:25%;">
|
768
780
|
{% if variant.category == 'snv' %}
|
769
781
|
<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
782
|
{% elif variant.category == 'cancer' %}
|
@@ -775,8 +787,8 @@
|
|
775
787
|
<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
788
|
{% endif %}
|
777
789
|
</td>
|
778
|
-
<td
|
779
|
-
<td
|
790
|
+
<td style="width:5%;">{{variant.category|upper}}</td>
|
791
|
+
<td style="width:15%;"
|
780
792
|
{{ dismissed_gene_list(variant) }}
|
781
793
|
</td>
|
782
794
|
|
@@ -957,15 +969,7 @@
|
|
957
969
|
<td>-</td>
|
958
970
|
{% endif %}
|
959
971
|
<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 %}
|
972
|
+
{{ overlapping_panels(variant) }}
|
969
973
|
</td>
|
970
974
|
<td>
|
971
975
|
{% if variant.callers %}
|
@@ -981,7 +985,7 @@
|
|
981
985
|
</table>
|
982
986
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
983
987
|
<tr>
|
984
|
-
<td>
|
988
|
+
<td style="width:60%;">
|
985
989
|
{{genotype_table(variant)}}
|
986
990
|
</td>
|
987
991
|
<td style="width:3%"></td>
|
@@ -1008,11 +1012,30 @@
|
|
1008
1012
|
</td>
|
1009
1013
|
</tr>
|
1010
1014
|
</table>
|
1015
|
+
{% if variant.category == "fusion" %}
|
1016
|
+
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
1017
|
+
{{ fusion_variants_header() }}
|
1018
|
+
<tbody>
|
1019
|
+
<tr>
|
1020
|
+
<td class="text-center">{{variant.variant_rank}}</td>
|
1021
|
+
<td>
|
1022
|
+
{% if variant.cancer_tier %}
|
1023
|
+
<span class="badge rounded-pill bg-secondary" title="Tier">{{ cancer_tier_options[variant.cancer_tier]['label'] }}</span>
|
1024
|
+
{% endif %}
|
1025
|
+
{% if variant.acmg_classification %}
|
1026
|
+
<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>
|
1027
|
+
{% endif %}
|
1028
|
+
</td>
|
1029
|
+
{{ default_fusion_variant_cells(institute, case, variant) }}
|
1030
|
+
</tr>
|
1031
|
+
</tbody>
|
1032
|
+
</table>
|
1033
|
+
{% else %}
|
1011
1034
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
1012
1035
|
<thead>
|
1013
1036
|
<tr>
|
1014
|
-
<th>
|
1015
|
-
<th>
|
1037
|
+
<th>Rank</th>
|
1038
|
+
<th>Score</th>
|
1016
1039
|
<th>Manual rank</th>
|
1017
1040
|
{% if not cancer %}
|
1018
1041
|
<th>Inheritance models</th>
|
@@ -1058,6 +1081,7 @@
|
|
1058
1081
|
</tr>
|
1059
1082
|
</tbody>
|
1060
1083
|
</table>
|
1084
|
+
{% endif %}
|
1061
1085
|
<table id="panel-table" class="table table-sm" style="background-color: transparent">
|
1062
1086
|
{% if variant.genes and variant.genes|length <= 3 %}
|
1063
1087
|
<thead>
|
@@ -1145,7 +1169,7 @@
|
|
1145
1169
|
<tr class="bg-warning">
|
1146
1170
|
{% endif %}
|
1147
1171
|
<td><span class="badge bg-info">{{variant.category | upper}}</span></td>
|
1148
|
-
<td>{{ variant.
|
1172
|
+
<td>{{ variant.str_mc }}</td>
|
1149
1173
|
<td>{{ variant.str_ref }}</td>
|
1150
1174
|
<td>
|
1151
1175
|
{% if variant.chromosome == variant.end_chrom %}
|
@@ -1155,15 +1179,7 @@
|
|
1155
1179
|
{% endif %}
|
1156
1180
|
</td>
|
1157
1181
|
<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 %}
|
1182
|
+
{{ overlapping_panels(variant) }}
|
1167
1183
|
</td>
|
1168
1184
|
</tr>
|
1169
1185
|
</tbody>
|
@@ -1214,8 +1230,8 @@
|
|
1214
1230
|
<table id="panel-table" class="table table-sm table-bordered" style="background-color: transparent; margin-left:-.3rem;">
|
1215
1231
|
<thead>
|
1216
1232
|
<tr class="table-secondary">
|
1217
|
-
<th>
|
1218
|
-
<th>
|
1233
|
+
<th>Rank</th>
|
1234
|
+
<th>Score</th>
|
1219
1235
|
<th>Manual rank</th>
|
1220
1236
|
</tr>
|
1221
1237
|
</thead>
|
@@ -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>
|
@@ -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 %}
|
@@ -313,28 +313,6 @@ def pdf_case_report(institute_id, case_name):
|
|
313
313
|
)
|
314
314
|
|
315
315
|
|
316
|
-
@cases_bp.route("/<institute_id>/<case_name>/chanjo2_report/<report_type>", methods=["GET"])
|
317
|
-
def chanjo2_coverage_report(institute_id: str, case_name: str, report_type: str):
|
318
|
-
"""Return the HTML coverage report or coverage overview created by chanjo2."""
|
319
|
-
|
320
|
-
REPORT_TYPES = ["report", "overview"]
|
321
|
-
if report_type not in REPORT_TYPES:
|
322
|
-
flash(f"Wrong value for report_type parameter. Accepted values: {REPORT_TYPES}", "warning")
|
323
|
-
return redirect(request.referrer)
|
324
|
-
|
325
|
-
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
|
326
|
-
report_html_content: str = controllers.chanjo2_coverage_report_contents(
|
327
|
-
institute_obj=institute_obj,
|
328
|
-
case_obj=case_obj,
|
329
|
-
panel_name=request.args.get("panel_name"),
|
330
|
-
panel_id=request.args.get("panel_id"),
|
331
|
-
report_type=report_type,
|
332
|
-
)
|
333
|
-
if report_html_content is None:
|
334
|
-
return redirect(request.referrer)
|
335
|
-
return report_html_content
|
336
|
-
|
337
|
-
|
338
316
|
@cases_bp.route("/<institute_id>/<case_name>/mt_report", methods=["GET"])
|
339
317
|
def mt_report(institute_id, case_name):
|
340
318
|
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
|
@@ -107,7 +107,7 @@ def _get_snv_var_form(variant_obj, case_obj):
|
|
107
107
|
var_form.variations_ids.data = var_ids.split(";")[0]
|
108
108
|
var_form.chromosome.data = variant_obj.get("chromosome")
|
109
109
|
var_form.start.data = variant_obj.get("position")
|
110
|
-
var_form.stop.data = variant_obj.get("
|
110
|
+
var_form.stop.data = variant_obj.get("end")
|
111
111
|
return var_form
|
112
112
|
|
113
113
|
|
@@ -276,7 +276,7 @@ def parse_variant_form_fields(form):
|
|
276
276
|
clinvar_var["variations_ids"] = form["dbsnp_id"]
|
277
277
|
|
278
278
|
if clinvar_var.get("ref_seq") and clinvar_var.get("hgvs"):
|
279
|
-
# Variant is described by RefSeq and HGVS already, remove
|
279
|
+
# Variant is described by RefSeq and HGVS already, remove redundant fields from submission
|
280
280
|
for item in ["chromosome", "start", "stop", "ref", "alt"]:
|
281
281
|
clinvar_var.pop(item)
|
282
282
|
|
@@ -437,7 +437,7 @@ def send_api_submission(institute_id, submission_id, key):
|
|
437
437
|
|
438
438
|
clinvar_id = store.get_clinvar_id(
|
439
439
|
submission_id
|
440
|
-
) # This is the official ID associated with this submission in Clinvar (
|
440
|
+
) # This is the official ID associated with this submission in Clinvar (ex: SUB999999)
|
441
441
|
|
442
442
|
if clinvar_id: # Check if submission object has already an associated ClinVar ID
|
443
443
|
conversion_res["submissionName"] = clinvar_id
|
@@ -95,10 +95,16 @@
|
|
95
95
|
</form>
|
96
96
|
{% if subm_obj.status == 'open' and show_submit %}
|
97
97
|
<form id="useApi_{{subm_obj._id}}" action="{{ url_for('clinvar.clinvar_update_submission', institute_id=institute._id, submission=subm_obj._id) }}" method="POST">
|
98
|
-
{{ submit_modal(
|
98
|
+
{{ submit_modal() }}
|
99
99
|
<td style="width: 20%"><button type="button" class="btn btn-sm btn-success form-control" name="update_submission" value="api_submit" data-bs-toggle="modal" data-bs-target="#submitModal">Submit to ClinVar</button></td>
|
100
100
|
</form>
|
101
101
|
{% endif %}
|
102
|
+
{% if subm_obj.status == 'submitted' %} <!--Submission status query -->
|
103
|
+
<form id="statusApi_{{subm_obj._id}}" action="{{ url_for('clinvar.clinvar_submission_status', submission_id=subm_obj.clinvar_subm_id) }}" method="POST">
|
104
|
+
{{ status_modal() }}
|
105
|
+
<td style="width: 20%"><button type="button" class="btn btn-sm btn-secondary form-control" name="status_enquiry" value="api_status" data-bs-toggle="modal" data-bs-target="#statusModal">Submission status enquiry</button></td>
|
106
|
+
</form>
|
107
|
+
{% endif %}
|
102
108
|
</tr>
|
103
109
|
</table>
|
104
110
|
</div>
|
@@ -240,7 +246,28 @@
|
|
240
246
|
</div>
|
241
247
|
{% endmacro %}
|
242
248
|
|
243
|
-
{% macro
|
249
|
+
{% macro status_modal() %}
|
250
|
+
<div class="modal fade" id="statusModal" tabindex="-1">
|
251
|
+
<div class="modal-dialog">
|
252
|
+
<div class="modal-content">
|
253
|
+
<div class="modal-header">
|
254
|
+
<h5 class="modal-title">Submission status</h5>
|
255
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
256
|
+
</div>
|
257
|
+
<div class="modal-body">
|
258
|
+
<label for="apiKey">Submitter's <a href="https://www.ncbi.nlm.nih.gov/clinvar/docs/api_http/" target="_blank" rel="noopener">API key</a></label>
|
259
|
+
<input type="password" class="form-control" name="apiKey" id="apiKey" placeholder="64 alphanumeric characters" value="{{institute.clinvar_key or ''}}" required>
|
260
|
+
</div>
|
261
|
+
<div class="modal-footer">
|
262
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
263
|
+
<button type="submit" name="show_status" value="status" class="btn btn-primary">Submission status enquiry</button>
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
{% endmacro %}
|
269
|
+
|
270
|
+
{% macro submit_modal() %}
|
244
271
|
<div class="modal fade" id="submitModal" tabindex="-1">
|
245
272
|
<div class="modal-dialog">
|
246
273
|
<div class="modal-content">
|