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.
- scout/__version__.py +1 -1
- scout/adapter/mongo/disease_terms.py +5 -2
- scout/adapter/mongo/query.py +23 -11
- scout/adapter/mongo/variant.py +2 -2
- scout/build/managed_variant.py +12 -1
- scout/build/variant/genotype.py +2 -0
- scout/build/variant/variant.py +5 -0
- scout/constants/__init__.py +1 -0
- scout/constants/clinvar.py +1 -1
- scout/constants/indexes.py +10 -0
- 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 +212 -190
- 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 +17 -23
- 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/templates/panels/panel_pdf_case_hits.html +2 -2
- scout/server/blueprints/panels/templates/panels/panel_pdf_simple.html +3 -3
- 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/server/templates/report_base.html +3 -3
- scout/server/templates/utils.html +2 -2
- {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/METADATA +6 -5
- {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/RECORD +62 -61
- {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/LICENSE +0 -0
- {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/WHEEL +0 -0
- {scout_browser-4.80.dist-info → scout_browser-4.82.1.dist-info}/entry_points.txt +0 -0
- {scout_browser-4.80.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
|