scout-browser 4.80__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.
Files changed (62) hide show
  1. scout/__version__.py +1 -1
  2. scout/adapter/mongo/disease_terms.py +5 -2
  3. scout/adapter/mongo/query.py +23 -11
  4. scout/adapter/mongo/variant.py +2 -2
  5. scout/build/managed_variant.py +12 -1
  6. scout/build/variant/genotype.py +2 -0
  7. scout/build/variant/variant.py +5 -0
  8. scout/constants/__init__.py +1 -0
  9. scout/constants/clinvar.py +1 -1
  10. scout/constants/indexes.py +10 -0
  11. scout/constants/query_terms.py +3 -1
  12. scout/models/variant/variant.py +1 -0
  13. scout/parse/variant/frequency.py +56 -54
  14. scout/parse/variant/genotype.py +89 -15
  15. scout/parse/variant/transcript.py +17 -9
  16. scout/parse/variant/variant.py +12 -0
  17. scout/server/app.py +6 -3
  18. scout/server/blueprints/alignviewers/templates/alignviewers/utils.html +1 -1
  19. scout/server/blueprints/cases/controllers.py +2 -57
  20. scout/server/blueprints/cases/templates/cases/case_report.html +212 -190
  21. scout/server/blueprints/cases/templates/cases/chanjo2_form.html +47 -0
  22. scout/server/blueprints/cases/templates/cases/collapsible_actionbar.html +4 -4
  23. scout/server/blueprints/cases/templates/cases/gene_panel.html +17 -23
  24. scout/server/blueprints/cases/templates/cases/utils.html +3 -1
  25. scout/server/blueprints/cases/views.py +0 -22
  26. scout/server/blueprints/clinvar/controllers.py +3 -3
  27. scout/server/blueprints/clinvar/templates/clinvar/clinvar_submissions.html +29 -2
  28. scout/server/blueprints/clinvar/templates/clinvar/multistep_add_variant.html +36 -18
  29. scout/server/blueprints/clinvar/views.py +13 -1
  30. scout/server/blueprints/diagnoses/controllers.py +2 -0
  31. scout/server/blueprints/institutes/controllers.py +76 -38
  32. scout/server/blueprints/institutes/templates/overview/cases.html +54 -42
  33. scout/server/blueprints/managed_variants/templates/managed_variants/managed_variants.html +1 -1
  34. scout/server/blueprints/managed_variants/views.py +2 -4
  35. scout/server/blueprints/panels/templates/panels/panel.html +8 -7
  36. scout/server/blueprints/panels/templates/panels/panel_pdf_case_hits.html +2 -2
  37. scout/server/blueprints/panels/templates/panels/panel_pdf_simple.html +3 -3
  38. scout/server/blueprints/panels/views.py +2 -11
  39. scout/server/blueprints/phenotypes/templates/phenotypes/hpo_terms.html +3 -2
  40. scout/server/blueprints/variant/controllers.py +3 -2
  41. scout/server/blueprints/variant/templates/variant/components.html +1 -1
  42. scout/server/blueprints/variant/templates/variant/utils.html +3 -1
  43. scout/server/blueprints/variant/templates/variant/variant.html +20 -15
  44. scout/server/blueprints/variant/templates/variant/variant_details.html +78 -26
  45. scout/server/blueprints/variant/utils.py +9 -13
  46. scout/server/blueprints/variants/controllers.py +32 -3
  47. scout/server/blueprints/variants/forms.py +15 -1
  48. scout/server/blueprints/variants/templates/variants/components.html +55 -0
  49. scout/server/blueprints/variants/templates/variants/fusion-variants.html +3 -50
  50. scout/server/blueprints/variants/templates/variants/str-variants.html +8 -5
  51. scout/server/blueprints/variants/templates/variants/utils.html +57 -31
  52. scout/server/blueprints/variants/templates/variants/variants.html +1 -1
  53. scout/server/blueprints/variants/utils.py +7 -10
  54. scout/server/extensions/clinvar_extension.py +10 -2
  55. scout/server/templates/report_base.html +3 -3
  56. scout/server/templates/utils.html +2 -2
  57. {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/METADATA +6 -5
  58. {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/RECORD +62 -61
  59. {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/LICENSE +0 -0
  60. {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/WHEEL +0 -0
  61. {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/entry_points.txt +0 -0
  62. {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/top_level.txt +0 -0
@@ -95,6 +95,7 @@ class VariantFiltersForm(FlaskForm):
95
95
  variant_type = HiddenField(default="clinical")
96
96
 
97
97
  gene_panels = NonValidatingSelectMultipleField(choices=[])
98
+ gene_panels_exclude = BooleanField("Exclude genes")
98
99
  hgnc_symbols = TagListField("HGNC Symbols/Ids (case sensitive)")
99
100
 
100
101
  region_annotations = SelectMultipleField(choices=REGION_ANNOTATIONS)
@@ -111,7 +112,7 @@ class VariantFiltersForm(FlaskForm):
111
112
  clinsig = NonValidatingSelectMultipleField("ClinVar CLINSIG", choices=CLINSIG_OPTIONS)
112
113
 
113
114
  gnomad_frequency = BetterDecimalField("gnomadAF", validators=[validators.Optional()])
114
- local_obs = IntegerField("Local obs. (archive)", validators=[validators.Optional()])
115
+ local_obs_old = IntegerField("Local obs. (archive)", validators=[validators.Optional()])
115
116
 
116
117
  filters = NonValidatingSelectField(choices=[], validators=[validators.Optional()])
117
118
  filter_display_name = StringField(default="")
@@ -165,6 +166,12 @@ class CancerFiltersForm(VariantFiltersForm):
165
166
  clinvar_tag = BooleanField("ClinVar hits")
166
167
  cosmic_tag = BooleanField("Cosmic hits")
167
168
  mvl_tag = BooleanField("Managed Variants hits")
169
+ local_obs_cancer_somatic_old = IntegerField(
170
+ "Local somatic obs. (archive)", validators=[validators.Optional()]
171
+ )
172
+ local_obs_cancer_germline_old = IntegerField(
173
+ "Local germline obs. (archive)", validators=[validators.Optional()]
174
+ )
168
175
 
169
176
  # polymorphic constant base for clinical filter
170
177
  clinical_filter_base = CLINICAL_FILTER_BASE_CANCER
@@ -196,6 +203,13 @@ class SvFiltersForm(VariantFiltersForm):
196
203
  swegen = IntegerField("SweGen obs")
197
204
  clinical_filter = SubmitField(label="Clinical filter")
198
205
 
206
+ local_obs_cancer_somatic_old = IntegerField(
207
+ "Local somatic obs. (archive)", validators=[validators.Optional()]
208
+ )
209
+ local_obs_cancer_germline_old = IntegerField(
210
+ "Local germline obs. (archive)", validators=[validators.Optional()]
211
+ )
212
+
199
213
  # polymorphic constant base for clinical filter
200
214
  clinical_filter_base = CLINICAL_FILTER_BASE_SV
201
215
 
@@ -23,6 +23,61 @@
23
23
  </div>
24
24
  {% endmacro %}
25
25
 
26
+ {% macro fusion_variants_header() %}
27
+ <thead class="table-light">
28
+ <tr>
29
+ <th id="checkbox" style="width:1%"></th>
30
+ <th id="rank" style="width:3%;" title="Beta version. Currently testing" class="text-left">Rank (beta)</th>
31
+ <th id="genes" style="width:6%" title="Genes">Fusion Genes</th>
32
+ <th id="callers" style="width:4%" title="Number of callers detecting a given event">Callers</th>
33
+ <th id="observed" style="width:4%" title="Observed database matches">Observed</th>
34
+ <th id="score" style="width:4%" title="Beta version. Currently testing">Score (beta)</th>
35
+ <th id="junction_reads" style="width:6%" title="Number of paired-ends that support the event">Junction Reads</th>
36
+ <th id="split_reads" style="width:6%" title="Number of split reads that support the event">Split Reads</th>
37
+ <th id="ffpm" style="width:6%" title="Fusion fragments per million total RNA-seq fragments">FFPM</th>
38
+ <th id="frame_status" style="width:8%" title="Frame status of the fusion">Frame Status</th>
39
+ <th id="transcripts" style="width:8%" title="Transcript ID">Transcript ID</th>
40
+ <th id="exons" style="width:4%" title="Exon Number">Exon Number</th>
41
+ <th id="brealpoints" style="width:4%" title="Breakpoints">Breakpoints</th>
42
+ <th id="oriantation" style="width:4%" title="Orientation">Orientation</th>
43
+ </tr>
44
+ </thead>
45
+ {% endmacro %}
46
+
47
+ {% macro default_fusion_variant_cells(institute, case, variant) %}
48
+ <td>
49
+ {{ fusion_variant_gene_symbols_cell(variant) }}
50
+ </td>
51
+ <td class="text-center"><span data-bs-toggle="tooltip" data-bs-html="true" title="{% for name, caller in variant.callers %}{{ name }}: {{ caller }}<br>{% endfor %}">
52
+ {{ variant.tool_hits|int }}</span></td>
53
+ <td>{{variant.found_db|join(", ") if variant.found_db else "-"}}</td>
54
+ <td class="text-center">{{ variant.fusion_score|float|round(3) }}</td>
55
+ <td class="text-center">{{ variant.samples[0].read_depth }}</td>
56
+ <td class="text-center">{{ variant.samples[0].split_read }}</td>
57
+ <td class="text-center">{{ variant.samples[0].ffpm }}</td>
58
+ <td>{{ variant.frame_status }}</td>
59
+ <td>
60
+ {% if variant.genes %}
61
+ {% for gene in variant.genes %}
62
+ {% for transcript in gene.transcripts %}
63
+ <div>{{ transcript.transcript_id }} </div>
64
+ {% endfor %}
65
+ {% endfor %}
66
+ {% endif %}
67
+ </td>
68
+ <td>
69
+ {% if variant.genes %}
70
+ {% for gene in variant.genes %}
71
+ {% for transcript in gene.transcripts %}
72
+ <div>{% if "exon" in transcript %}{{ transcript.exon|int }}{% endif %} </div>
73
+ {% endfor %}
74
+ {% endfor %}
75
+ {% endif %}
76
+ </td>
77
+ <td> {{ variant.chromosome }}:{{ variant.position }} <br> {{ variant.end_chrom }}:{{ variant.end }} </td>
78
+ <td class="text-center">{{ variant.orientation }}</td>
79
+ {% endmacro %}
80
+
26
81
  {% macro fusion_variant_gene_symbols_cell(variant) %}
27
82
  <div class="align-items-center">
28
83
  {% if variant.genes %}
@@ -1,6 +1,6 @@
1
1
  {% extends "layout.html" %}
2
2
  {% from "variants/utils.html" import fusion_filters, cell_rank, pagination_footer, pagination_hidden_div, dismiss_variants_block, filter_form_footer, filter_script_main, update_stash_filter_button_status %}
3
- {% from "variants/components.html" import external_scripts, external_stylesheets, fusion_variant_gene_symbols_cell %}
3
+ {% from "variants/components.html" import external_scripts, external_stylesheets, fusion_variant_gene_symbols_cell, fusion_variants_header, default_fusion_variant_cells %}
4
4
 
5
5
  {% block title %}
6
6
  {{ super() }} - {{ institute.display_name }} - {{ case.display_name }} - Fusion variants
@@ -54,24 +54,7 @@ onsubmit="return validateForm()">
54
54
 
55
55
  <div class="card mt-3">
56
56
  <table id="variantsTable" class="table table-hover table-bordered" aria-label="Fusion variants table">
57
- <thead class="table-light thead">
58
- <tr>
59
- <th style="width:3%"></th>
60
- <th style="width:4%" title="Beta version. Currently testing">Rank (beta)</th>
61
- <th style="width:6%" title="Genes">Fusion Genes</th>
62
- <th style="width:4%" title="Number of callers detecting a given event">Callers</th>
63
- <th style="width:4%" title="Observed database matches">Observed</th>
64
- <th style="width:4%" title="Beta version. Currently testing">Score (beta)</th>
65
- <th style="width:6%" title="Number of paired-ends that support the event">Junction Reads</th>
66
- <th style="width:6%" title="Number of split reads that support the event">Split Reads</th>
67
- <th style="width:6%" title="Fusion fragments per million total RNA-seq fragments">FFPM</th>
68
- <th style="width:8%" title="Frame status of the fusion">Frame Status</th>
69
- <th style="width:8%" title="Transcript ID">Transcript ID</th>
70
- <th style="width:4%" title="Exon Number">Exon Number</th>
71
- <th style="width:4%" title="Breakpoints">Breakpoints</th>
72
- <th style="width:4%" title="Orientation">Orientation</th>
73
- </tr>
74
- </thead>
57
+ {{ fusion_variants_header() }}
75
58
  <tbody>
76
59
  {% for variant in variants %}
77
60
  {{ variant_row(variant) }}
@@ -103,37 +86,7 @@ onsubmit="return validateForm()">
103
86
  <td class="text-start">
104
87
  {{ cell_rank(variant, institute, case, form, manual_rank_options) }}
105
88
  </td>
106
- <td>
107
- {{ fusion_variant_gene_symbols_cell(variant) }}
108
- </td>
109
- <td><span data-bs-toggle="tooltip" data-bs-html="true" title="{% for name, caller in variant.callers %}{{ name }}: {{ caller }}<br>{% endfor %}">
110
- {{ variant.tool_hits|int }}</span></td>
111
- <td>{{variant.found_db|join(", ") if variant.found_db else "-"}}</td>
112
- <td class="text-end">{{ variant.fusion_score|float|round(3) }}</td>
113
- <td>{{ variant.samples[0].read_depth }}</td>
114
- <td>{{ variant.samples[0].split_read }}</td>
115
- <td>{{ variant.samples[0].ffpm }}</td>
116
- <td>{{ variant.frame_status }}</td>
117
- <td>
118
- {% if variant.genes %}
119
- {% for gene in variant.genes %}
120
- {% for transcript in gene.transcripts %}
121
- <div>{{ transcript.transcript_id }} </div>
122
- {% endfor %}
123
- {% endfor %}
124
- {% endif %}
125
- </td>
126
- <td>
127
- {% if variant.genes %}
128
- {% for gene in variant.genes %}
129
- {% for transcript in gene.transcripts %}
130
- <div>{% if "exon" in transcript %}{{ transcript.exon|int }}{% endif %} </div>
131
- {% endfor %}
132
- {% endfor %}
133
- {% endif %}
134
- </td>
135
- <td> {{ variant.chromosome }}:{{ variant.position }} <br> {{ variant.end_chrom }}:{{ variant.end }} </td>
136
- <td>{{ variant.orientation }}</td>
89
+ {{ default_fusion_variant_cells(institute, case, variant) }}
137
90
  </tr>
138
91
  {% endmacro %}
139
92
 
@@ -91,9 +91,9 @@
91
91
  {% endif %}
92
92
  <td class="str-link">{{ cell_rank(variant, institute, case, form, manual_rank_options) }}</td>
93
93
  <td class="str-link">{{ str_locus_info(variant) }}</td>
94
- <td class="text-end">{{ variant.str_display_ru or variant.str_ru }}</td>
95
- <td class="text-end"><b>{{ variant.alternative|replace("STR", "")|replace("<", "")|replace(">", "") }}</b></td>
96
- <td class="text-end">{{ variant.str_ref }}</td>
94
+ <td class="text-end">{{ variant.str_display_ru or variant.str_ru or variant.reference }}</td>
95
+ <td class="text-end"><b><span data-bs-toggle="tooltip" title="{{ variant.alternative }}">{{ variant.str_mc }}</span></b></td>
96
+ <td class="text-end"><span data-bs-toggle="tooltip" title="{{ variant.reference }}">{{ variant.str_ref or "." }}</span></td>
97
97
  <td>{{ str_status(variant) }}</td>
98
98
  <td>{% for sample in variant.samples %}
99
99
  {% if sample.genotype_call != "./." %}
@@ -187,7 +187,9 @@
187
187
  <tr><td colspan=2>&nbsp;</td></tr>
188
188
  {% if variant.str_swegen_mean %}
189
189
  <tr><td>SweGen Z-score</td><td>
190
- {{ ((variant.alternative|replace("STR", "")|replace("<", "")|replace(">", "")|int - variant.str_swegen_mean ) / variant.str_swegen_std) | round(2) }}
190
+ {% if variant.str_mc %}
191
+ {{ ((variant.str_mc - variant.str_swegen_mean ) / variant.str_swegen_std) | round(2) }}
192
+ {% endif %}
191
193
  </td></tr>
192
194
  <tr><td>SweGen mean</td><td>{{variant.str_swegen_mean|round(2)}}</td></tr>
193
195
  <tr><td>SweGen std</td><td>{{variant.str_swegen_std|round(2)}}</td></tr>
@@ -233,7 +235,8 @@
233
235
  {% endfor %}
234
236
  {%endif%}
235
237
  </div>"
236
- title="">{{ variant.str_repid }}
238
+ title="">{% if variant.str_repid %} {{ variant.str_repid }} {% elif variant.str_trid %} {{ variant.str_trid }} {% else %}
239
+ {% for gene in variant.genes %} {{ gene.symbol }} {% endfor %} {% endif %}
237
240
  </a>
238
241
  {% for gene in variant.genes %}
239
242
  <span class="badge bg-secondary"><a href="{{ gene.stripy_link }}" class="text-white" referrerpolicy="no-referrer" rel="noopener" target="_blank">S</a></span>
@@ -55,6 +55,27 @@
55
55
  {% endfor %}
56
56
  {% endmacro %}
57
57
 
58
+ {% macro archived_observations_filter(form) %}
59
+ {% if config.SHOW_OBSERVED_VARIANT_ARCHIVE and config.SHOW_OBSERVED_VARIANT_ARCHIVE is true %}
60
+ {{ form.local_obs_old.label(class="control-label") }}
61
+ {{ form.local_obs_old(class="form-control") }}
62
+ {% endif %}
63
+ {% endmacro %}
64
+
65
+ {% macro archived_observations_cancer_filters(form) %}
66
+ {% if config.SHOW_OBSERVED_VARIANT_ARCHIVE and config.SHOW_OBSERVED_VARIANT_ARCHIVE is true %}
67
+ <div class="col">
68
+ {{ wtf.form_field(form.local_obs_old) }}
69
+ </div>
70
+ <div class="col">
71
+ {{ wtf.form_field(form.local_obs_cancer_somatic_old) }}
72
+ </div>
73
+ <div class="col">
74
+ {{ wtf.form_field(form.local_obs_cancer_germline_old) }}
75
+ </div>
76
+ {% endif %}
77
+ {% endmacro %}
78
+
58
79
  {% macro filter_form_footer(form, result_size, total_variants, more_variants, page, nvars, institute) %}
59
80
  <div class="card-footer text-center">
60
81
  <div class="row">
@@ -110,12 +131,17 @@
110
131
  {% endmacro %}
111
132
 
112
133
 
113
- {% macro compounds_table(institute, case, compounds) %}
134
+ {% macro compounds_table(institute, case, compounds, is_popover) %}
135
+ {% set is_popover = is_popover|default(false) %}
114
136
  <table class='table table-condensed table-bordered table-sm'>
115
137
  <thead class='thead table-light'>
116
138
  <tr>
117
139
  <th>Variant</th>
118
- <th>Combined score</th>
140
+ <th>Combined score
141
+ {% if not is_popover %}
142
+ <span data-bs-toggle='tooltip' data-bs-title='Combined score is the sum of variants´s score and compound variant´s score'>?</span>
143
+ </th>
144
+ {% endif %}
119
145
  <th>Rank score</th>
120
146
  <th>Gene annotation</th>
121
147
  <th>Func. annotation</th>
@@ -131,6 +157,8 @@
131
157
  <td>
132
158
  {% if compound.not_loaded %}
133
159
  {{ compound.display_name }} <small>(not loaded)</small>
160
+ {% elif is_popover %}
161
+ {{ compound.display_name }}
134
162
  {% else %}
135
163
  <a href='{{ url_for("variant.variant",
136
164
  institute_id=institute._id,
@@ -194,7 +222,8 @@
194
222
  {% macro variants_common_filters(form, type) %}
195
223
  <div class="row mb-2">
196
224
  <div class="col-2">
197
- {{ 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.") }}
225
+ <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>
226
+ <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>
198
227
  {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
199
228
  </div>
200
229
  <div class="col-2">
@@ -281,8 +310,7 @@
281
310
  {{ form.gnomad_frequency(class="form-control") }}
282
311
  </div>
283
312
  <div class="col-4">
284
- {{ form.local_obs.label(class="control-label") }}
285
- {{ form.local_obs(class="form-control") }}
313
+ {{ archived_observations_filter(form) }}
286
314
  </div>
287
315
  <div class="col-4">
288
316
  {{ form.chrom.label(class="control-label") }}
@@ -382,8 +410,7 @@
382
410
  {{ form.swegen_freq(class="form-control") }}
383
411
  </div>
384
412
  <div class="col-4">
385
- {{ form.local_obs.label(class="control-label") }}
386
- {{ form.local_obs(class="form-control") }}
413
+ {{ archived_observations_filter(form) }}
387
414
  </div>
388
415
  <div class="col-4">
389
416
  {{ form.chrom.label(class="control-label") }}
@@ -459,7 +486,8 @@
459
486
  <input type="hidden" name="variant_type" value="{{ form.variant_type.data }}">
460
487
  <div class="row">
461
488
  <div class="col-2">
462
- {{ form.gene_panels.label(class="control-label", data_toggle="tooltip", data_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering.") }}
489
+ <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>
490
+ <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>
463
491
  {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
464
492
  </div>
465
493
  <div class="col-3">
@@ -560,8 +588,7 @@
560
588
  <div class="col-6">
561
589
  <div class="row">
562
590
  <div class="col-3">
563
- {{ form.local_obs.label(class="control-label") }}
564
- {{ form.local_obs(class="form-control") }}
591
+ {{ archived_observations_filter(form) }}
565
592
  </div>
566
593
  <div class="col-3">
567
594
  {{ form.clingen_ngi.label(class="control-label") }}
@@ -632,7 +659,8 @@
632
659
  {{ form.variant_type() }}
633
660
  <div class="row">
634
661
  <div class="col-2">
635
- {{ form.gene_panels.label(data_toggle="tooltip", data_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering.") }}
662
+ <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>
663
+ <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>
636
664
  {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
637
665
  </div>
638
666
  <div class="col-2">
@@ -698,27 +726,25 @@
698
726
  </div>
699
727
  <div class="form" id="chromosome_search">
700
728
  <div class="row" style="margin-top:20px;">
701
- <div class="col-1">
729
+ <div class="col">
702
730
  {{ form.gnomad_frequency.label(class="control-label") }}
703
731
  {{ form.gnomad_frequency(class="form-control") }}
704
732
  </div>
705
- <div class="col-1">
706
- {{ wtf.form_field(form.local_obs) }}
707
- </div>
708
- <div class="col-2">
733
+ {{ archived_observations_cancer_filters(form) }}
734
+ <div class="col">
709
735
  {{ form.chrom.label(class="control-label") }}
710
736
  {{ form.chrom(class="selectpicker", data_actions_box="true", data_style="btn-secondary") }}
711
737
  </div>
712
- <div class="col-2">
738
+ <div class="col">
713
739
  {{ wtf.form_field(form.start) }}
714
740
  </div>
715
- <div class="col-2">
741
+ <div class="col">
716
742
  {{ wtf.form_field(form.end) }}
717
743
  </div>
718
- <div class="col-2">
744
+ <div class="col">
719
745
  {{ wtf.form_field(form.cytoband_start) }}
720
746
  </div>
721
- <div class="col-2">
747
+ <div class="col">
722
748
  {{ wtf.form_field(form.cytoband_end) }}
723
749
  </div>
724
750
  </div>
@@ -767,7 +793,8 @@
767
793
  {{ form.variant_type() }}
768
794
  <div class="row mb-3">
769
795
  <div class="col-2">
770
- {{ form.gene_panels.label(class="control-label", data_toggle="tooltip", data_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering.") }}
796
+ <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>
797
+ <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>
771
798
  {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
772
799
  </div>
773
800
  <div class="col-2">
@@ -823,27 +850,25 @@
823
850
  </div>
824
851
  <div id="chromosome_search">
825
852
  <div class="row" style="margin-top:20px;">
826
- <div class="col-1">
853
+ <div class="col">
827
854
  {{ form.gnomad_frequency.label(class="control-label") }}
828
855
  {{ form.gnomad_frequency(class="form-control") }}
829
856
  </div>
830
- <div class="col-1">
831
- {{ wtf.form_field(form.local_obs) }}
832
- </div>
833
- <div class="col-2">
857
+ {{ archived_observations_cancer_filters(form) }}
858
+ <div class="col">
834
859
  {{ form.chrom.label(class="control-label") }}
835
860
  {{ form.chrom(class="selectpicker", data_actions_box="true", data_style="btn-secondary") }}
836
861
  </div>
837
- <div class="col-2">
862
+ <div class="col">
838
863
  {{ wtf.form_field(form.start) }}
839
864
  </div>
840
- <div class="col-2">
865
+ <div class="col">
841
866
  {{ wtf.form_field(form.end) }}
842
867
  </div>
843
- <div class="col-2">
868
+ <div class="col">
844
869
  {{ wtf.form_field(form.cytoband_start) }}
845
870
  </div>
846
- <div class="col-2">
871
+ <div class="col">
847
872
  {{ wtf.form_field(form.cytoband_end) }}
848
873
  </div>
849
874
  </div>
@@ -892,7 +917,8 @@
892
917
  <input type="hidden" name="variant_type" value="{{ form.variant_type.data }}">
893
918
  <div class="row">
894
919
  <div class="col-2">
895
- {{ form.gene_panels.label(class="control-label", data_toggle="tooltip", data_placement="left", title="This list can be modified from the institute settings page. Latest panel version is used in variants filtering.") }}
920
+ <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>
921
+ <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>
896
922
  {{ form.gene_panels(class="selectpicker", data_style="btn-secondary") }}
897
923
  </div>
898
924
  <div class="col-3">
@@ -164,7 +164,7 @@
164
164
  {% if ns.show_compounds %}
165
165
  <a href="#" class="badge bg-primary text-white" data-bs-toggle="popover" data-bs-placement="left"
166
166
  data-bs-html="true" data-bs-trigger="hover click"
167
- data-bs-content="{{ compounds_table(institute, case, variant.compounds[:20]) }}">Compounds</a>
167
+ data-bs-content="{{ compounds_table(institute, case, variant.compounds[:20], is_popover=true) }}">Compounds</a>
168
168
  {% endif %}
169
169
  {% endif %}
170
170
 
@@ -1,23 +1,20 @@
1
1
  # -*- coding: utf-8 -*-
2
+ from scout.adapter import MongoAdapter
2
3
 
3
4
 
4
- def update_case_panels(store, case_obj):
5
+ def update_case_panels(store: MongoAdapter, case_obj: dict):
5
6
  """Refresh case gene panels with info on if a panel was removed.
7
+ Also sets the key "latest_panels" for a case where the value is the latest version of the case panels
6
8
 
7
- Also return these more populated panels for optional storage on the variant_obj.
8
9
  If you do not use the returned variants, but rely on the update, please remember
9
10
  to call this function before updating the variants.
10
-
11
- store(adapter.MongoAdapter)
12
- case_obj(dict)
13
-
14
- Returns:
15
- list(panel_info)
16
11
  """
12
+ case_obj["latest_panels"] = []
17
13
 
18
14
  for panel_info in case_obj.get("panels", []):
19
15
  panel_name = panel_info["panel_name"]
20
16
  latest_panel = store.gene_panel(panel_name)
21
17
  panel_info["removed"] = False if latest_panel is None else latest_panel.get("hidden", False)
22
-
23
- return case_obj.get("panels", [])
18
+ if latest_panel:
19
+ latest_panel["hgnc_ids"] = [gene["hgnc_id"] for gene in latest_panel.get("genes", [])]
20
+ case_obj["latest_panels"].append(latest_panel)
@@ -1,8 +1,8 @@
1
1
  import json
2
2
  import logging
3
- from tempfile import NamedTemporaryFile
4
3
 
5
4
  import requests
5
+ from flask import flash
6
6
 
7
7
  from scout.constants.clinvar import CLINVAR_API_URL, PRECLINVAR_URL
8
8
 
@@ -19,7 +19,7 @@ class ClinVarApi:
19
19
  self.convert_service = "/".join([PRECLINVAR_URL, "csv_2_json"])
20
20
  self.submit_service = CLINVAR_API_URL
21
21
 
22
- def set_header(self, api_key):
22
+ def set_header(self, api_key) -> dict:
23
23
  """Creates a header to be submitted a in a POST rquest to the CLinVar API
24
24
  Args:
25
25
  api_key(str): API key to be used to submit to ClinVar (64 alphanumeric characters)
@@ -76,3 +76,11 @@ class ClinVarApi:
76
76
 
77
77
  except Exception as ex:
78
78
  return None, ex
79
+
80
+ def show_submission_status(self, submission_id: str, api_key=None):
81
+ """Retrieve the status of a ClinVar submission using the https://submit.ncbi.nlm.nih.gov/api/v1/submissions/SUBnnnnnn/actions/ endpoint."""
82
+
83
+ header: dict = self.set_header(api_key)
84
+ actions_url = f"{CLINVAR_API_URL}{submission_id}/actions/"
85
+ actions_resp: requests.models.Response = requests.get(actions_url, headers=header)
86
+ flash(f"Response from ClinVar: {actions_resp.json()}", "primary")
@@ -4,7 +4,7 @@
4
4
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
5
5
 
6
6
  {% block css %}
7
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
8
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
9
9
  <style>
10
10
  tr.light-grey td{
@@ -22,8 +22,8 @@
22
22
  {% endblock %}
23
23
 
24
24
  {% block scripts %}
25
- <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
26
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
25
+ <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
26
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
27
27
  {% endblock %}
28
28
  </body>
29
29
  </html>
@@ -78,7 +78,7 @@
78
78
  {{ single_comment(institute, case, current_user, comment, item_index) }}
79
79
  {% endfor %}
80
80
  {% if expandable_comments|length >0 %}
81
- <div class="accordion-item">
81
+ <div class="accordion-item border-0">
82
82
  <div id="expandable-comments-content" class="accordion-collapse collapse" aria-labelledby="expandable-comments-heading">
83
83
  <div class="" >
84
84
  {% for comment in expandable_comments %}
@@ -87,7 +87,7 @@
87
87
  {% endfor %}
88
88
  </div>
89
89
  </div>
90
- <button id="expandable-comments-control" class="accordion-button collapsed" style="color:#0c63e4; background-color:#e7f1ff;" type="button" data-bs-toggle="collapse" data-bs-target="#expandable-comments-content" aria-expanded="false" aria-controls="expandable-comments-content"
90
+ <button id="expandable-comments-control" class="accordion-button collapsed" style="background-color:var(--bs-body-bg);color:var(--bs-body-color)" type="button" data-bs-toggle="collapse" data-bs-target="#expandable-comments-content" aria-expanded="false" aria-controls="expandable-comments-content"
91
91
  onclick="{let thisElement=event.currentTarget; let children= thisElement.querySelectorAll('span'); Array.from(children).forEach(child=> child.classList.toggle('d-none'));}">
92
92
  <span>See more comments...</span>
93
93
  <span class="d-none">Minimise comments</span>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scout-browser
3
- Version: 4.80
3
+ Version: 4.82.1
4
4
  Summary: Clinical DNA variant visualizer and browser.
5
5
  Home-page: https://github.com/Clinical-Genomics/scout
6
6
  Author: Måns Magnusson
@@ -16,12 +16,12 @@ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
16
16
  Classifier: Topic :: Software Development :: Libraries
17
17
  Classifier: Programming Language :: Python :: 3.6
18
18
  Description-Content-Type: text/markdown
19
- Requires-Dist: werkzeug <2.3
19
+ Requires-Dist: werkzeug <3
20
20
  Requires-Dist: Flask >=2.0
21
21
  Requires-Dist: Flask-Bootstrap
22
22
  Requires-Dist: Flask-CORS
23
23
  Requires-Dist: path.py
24
- Requires-Dist: Flask-Markdown
24
+ Requires-Dist: markdown
25
25
  Requires-Dist: WTForms
26
26
  Requires-Dist: Flask-WTF
27
27
  Requires-Dist: Flask-Mail
@@ -171,9 +171,9 @@ scout load panel scout/demo/panel_1.txt
171
171
  scout load case scout/demo/643594.config.yaml
172
172
  ```
173
173
 
174
- ## Integration with chanjo for coverage report visualization
174
+ ## Integration with chanjo and chanjo2 for coverage report visualization
175
175
 
176
- Scout may be configured to visualize coverage reports produced by [Chanjo][chanjo]. Instructions on
176
+ Scout may be configured to visualize coverage reports produced by [Chanjo][chanjo] or [chanjo2][chanjo2]. Instructions on
177
177
  how to enable this feature can be found in the document [chanjo_coverage_integration][chanjo-scout].
178
178
 
179
179
  ## Integration with loqusdb for integrating local variant frequencies
@@ -311,6 +311,7 @@ be found in [CONTRIBUTING](CONTRIBUTING.md).
311
311
 
312
312
 
313
313
  [chanjo]: https://github.com/Clinical-Genomics/chanjo
314
+ [chanjo2]: https://github.com/Clinical-Genomics/chanjo2
314
315
  [chanjo-scout]: docs/admin-guide/chanjo_coverage_integration.md
315
316
  [loqusdb]: https://github.com/moonso/loqusdb
316
317
  [loqusdb-scout]: docs/admin-guide/loqusdb_integration.md