Skip to content

Commit

Permalink
Merge branch 'main' into version_4.89
Browse files Browse the repository at this point in the history
  • Loading branch information
dnil committed Sep 25, 2024
2 parents d4abfff + 69b622d commit 37e880d
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- Subject id search from caseS page (supporting multiple sample types e.g.) - adding indexes to speed up caseS queries
- Advanced cases search to narrow down results using more than one search parameter
- Coverage report available for any case with samples containing d4 files, even if case has no associated gene panels
- RNA delivery reports
### Changed
- Documentation for OMICS variants and updating a case
- Include both creation and deletion dates in gene panels pages
Expand Down
1 change: 1 addition & 0 deletions docs/admin-guide/load-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Below are available configuration parameters for a Scout case. Names marked with
- **RNAfusion_report** _String_ Path to HTML [nf-core/rnafusion report][rnafusion-report] containing only clinical fusions (a subset of all detected fusions).
- **RNAfusion_report_research** _String_ Path to HTML [nf-core/rnafusion report][rnafusion-report] containing all detected fusions.
- **rna_human_genome_build** _String_ Version of reference genome used for RNA components of build. "37" or "38", default "38".
- **rna_delivery_report** _String_: Path to HTML RNA delivery report.
- **samples** _List_ List of samples included in the case:
- **alignment_path** _String_ Path to BAM/CRAM file to view alignments.
- **analysis_type** _String_ Specifies the analysis type for the sample. Options: {wgs, wes, panel, unknown, external}.
Expand Down
3 changes: 3 additions & 0 deletions scout/adapter/mongo/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@ def update_case(self, case_obj, keep_date=False):
- RNAfusion_inspector_research: path to the research RNA fusion inspector report
- RNAfusion_report: path to the RNA fusion report
- RNAfusion_report_research: path to the research RNA fusion report
- rna_delivery_report: path to the RNA delivery report
- smn_tsv: path to static SMN TSV file
- status: case status
- sv_rank_model_version: If there is a new sv rank model
Expand Down Expand Up @@ -1155,6 +1156,7 @@ def update_case(self, case_obj, keep_date=False):
"RNAfusion_inspector_research": case_obj.get("RNAfusion_inspector_research"),
"RNAfusion_report": case_obj.get("RNAfusion_report"),
"RNAfusion_report_research": case_obj.get("RNAfusion_report_research"),
"rna_delivery_report": case_obj.get("rna_delivery_report"),
"smn_tsv": case_obj.get("smn_tsv"),
"status": case_obj.get("status"),
"sv_rank_model_version": case_obj.get("sv_rank_model_version"),
Expand Down Expand Up @@ -1203,6 +1205,7 @@ def update_case(self, case_obj, keep_date=False):
"RNAfusion_inspector_research",
"RNAfusion_report",
"RNAfusion_report_research",
"rna_delivery_report",
"smn_tsv",
"sv_rank_model_version",
]:
Expand Down
1 change: 1 addition & 0 deletions scout/build/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def build_case(case_data, adapter):
case_obj["vcf_files"] = case_data.get("vcf_files", {})
case_obj["omics_files"] = case_data.get("omics_files", {})
case_obj["delivery_report"] = case_data.get("delivery_report")
case_obj["rna_delivery_report"] = case_data.get("rna_delivery_report")

_populate_pipeline_info(case_obj, case_data)

Expand Down
5 changes: 5 additions & 0 deletions scout/constants/case_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# keys are used in the load report cli, while key_name is saved in case database documents
CUSTOM_CASE_REPORTS = {
"delivery": {"key_name": "delivery_report", "format": "HTML", "pdf_export": True},
"rna_delivery_report": {
"key_name": "rna_delivery_report",
"format": "HTML",
"pdf_export": True,
},
"cnv": {"key_name": "cnv_report", "format": "PDF", "pdf_export": False},
"cov_qc": {"key_name": "coverage_qc_report", "format": "HTML", "pdf_export": True},
"exe_ver": {"key_name": "pipeline_version", "format": "YAML", "pdf_export": True},
Expand Down
1 change: 1 addition & 0 deletions scout/demo/643594.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ peddy_sex: scout/demo/643594.sex_check.csv

delivery_report: scout/demo/delivery_report.html
gene_fusion_report: scout/demo/draw-fusions-example.pdf
rna_delivery_report: scout/demo/delivery_report.html
exe_ver: scout/demo/exe_ver.yaml
reference_info: scout/demo/reference_info.yaml

Expand Down
2 changes: 2 additions & 0 deletions scout/models/case/case_loading_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"RNAfusion_inspector_research",
"RNAfusion_report",
"RNAfusion_report_research",
"rna_delivery_report",
]

VCF_FILE_PATH_CHECKS = FILE_TYPE_MAP.keys()
Expand Down Expand Up @@ -431,6 +432,7 @@ class CaseLoader(BaseModel):
RNAfusion_inspector_research: Optional[str] = None
RNAfusion_report: Optional[str] = None
RNAfusion_report_research: Optional[str] = None
rna_delivery_report: Optional[str] = None
smn_tsv: Optional[str] = None
sv_rank_model_version: Optional[str] = None
synopsis: Optional[Union[List[str], str]] = None
Expand Down
9 changes: 9 additions & 0 deletions scout/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import os
import re
from datetime import timedelta
from typing import Dict, Union
from urllib.parse import parse_qsl, unquote, urlsplit
Expand Down Expand Up @@ -253,6 +254,14 @@ def cosmic_prefix(cosmicId):
return "COSM" + str(cosmicId)
return cosmicId

@app.template_filter()
def upper_na(string):
"""
Uppercase ocurences of "dna" and "rna" for nice display.
"""

return re.sub(r"[Dd][Nn][Aa]", r"DNA", re.sub(r"[Rr][Nn][Aa]", r"RNA", string))

@app.template_filter()
def count_cursor(pymongo_cursor):
"""Count number of returned documents (deprecated pymongo.cursor.count())"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@
</div>
{% endif %}

<!-- Custom case reports as in constants.CUSTOM_CASE_REPORTS -->
{% for _, report_data in report_types.items() %}
{{ custom_case_report(institute, case, report_data) }}
{% endfor %}

<!-- Delivery reports for old analyses -->
{% if case.analyses %}
{% for analysis in case.analyses %}
Expand All @@ -134,6 +129,11 @@
{% endif %}
{% endfor %}
{% endif %}

<!-- Custom case reports as in constants.CUSTOM_CASE_REPORTS -->
{% for _, report_data in report_types.items() %}
{{ custom_case_report(institute, case, report_data) }}
{% endfor %}
</div>
<!-- end reports macro -->
{% endmacro %}
Expand All @@ -144,7 +144,7 @@
<div href="#" class="bg-dark list-group-item text-white">
<div class="d-flex flex-row bd-highlight mt-1">
<div>
<span class="menu-collapsed">{{report_key|replace("_"," ")|title}}</span>
<span class="menu-collapsed">{{report_key|replace("_"," ")|title|upper_na}}</span>
</div>
{% if case.get(report_key) is existing %}
<div>
Expand Down

0 comments on commit 37e880d

Please sign in to comment.