From b935bebd7f09e5c221f1f10343df069585129cb9 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Fri, 18 Oct 2024 14:14:43 +0200 Subject: [PATCH 1/9] Almost works --- CHANGELOG.md | 4 ++++ src/chanjo2/meta/handle_d4.py | 5 +++++ src/chanjo2/meta/handle_report_contents.py | 7 ++++++- src/chanjo2/templates/overview.html | 4 +++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19347392..9c62e4e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Fixed - Addressed the `Starlette Denial of service (DoS) via multipart/form-data` by updating starlette library. among others +## [unreleased] +### Added +- Refseq transcripts names on coverage overview page + ## [2.0] ### Added - Improve report explanation to better interpret average coverage and coverage completeness stats shown on the coverage report diff --git a/src/chanjo2/meta/handle_d4.py b/src/chanjo2/meta/handle_d4.py index 37065307..ed2de311 100644 --- a/src/chanjo2/meta/handle_d4.py +++ b/src/chanjo2/meta/handle_d4.py @@ -86,6 +86,11 @@ def get_report_sample_interval_coverage( interval_hgnc_symbol, interval_hgnc_id, interval.ensembl_id, + { + "mane_select": interval.refseq_mane_select, + "mane_plus_clinical": interval.refseq_mane_plus_clinical, + "mrna": interval.refseq_mane_select, + }, sample_name, round(interval_coverage_at_threshold * 100, 2), ) diff --git a/src/chanjo2/meta/handle_report_contents.py b/src/chanjo2/meta/handle_report_contents.py index f7cd8127..9653a592 100644 --- a/src/chanjo2/meta/handle_report_contents.py +++ b/src/chanjo2/meta/handle_report_contents.py @@ -133,7 +133,12 @@ def get_report_data( db=session, interval_type=INTERVAL_TYPE_SQL_TYPE[query.interval_type], genes=genes, - transcript_tags=[TranscriptTag.REFSEQ_MRNA], + transcript_tags=[ + TranscriptTag.REFSEQ_MRNA, + TranscriptTag.REFSEQ_MANE_PLUS_CLINICAL, + TranscriptTag.REFSEQ_MANE_SELECT, + TranscriptTag.REFSEQ_MRNA, + ], ) for sample in query.samples: diff --git a/src/chanjo2/templates/overview.html b/src/chanjo2/templates/overview.html index d9298013..80aca55c 100644 --- a/src/chanjo2/templates/overview.html +++ b/src/chanjo2/templates/overview.html @@ -39,6 +39,7 @@ Gene {{ extras.interval_type }} + Sample Completeness {{ extras.default_level }}x [%] @@ -52,7 +53,8 @@ {{ row[2] }} - {{ row[3] }} + {{ row }} + {{ row[4] }} {{ row[4] }} {% else %} From 3720cc8ca9dde496bdb4cdefef15a18ca91bff95 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 11:55:16 +0100 Subject: [PATCH 2/9] Add badges --- src/chanjo2/templates/overview.html | 37 +++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/chanjo2/templates/overview.html b/src/chanjo2/templates/overview.html index 80aca55c..2734f797 100644 --- a/src/chanjo2/templates/overview.html +++ b/src/chanjo2/templates/overview.html @@ -2,6 +2,24 @@ {% block css %} {{ super() }} + {% endblock %} {% macro completeness_cutoffs() %} @@ -39,7 +57,6 @@ Gene {{ extras.interval_type }} - Sample Completeness {{ extras.default_level }}x [%] @@ -50,12 +67,22 @@ {{row[0]}} - + + + + {{ row[2] }} + {% if row[3].mane_select %} + MANE Select: {{row[3].mane_select}} + {% endif %} + {% if row[3].mane_plus_clinical %} + MANE Plus Clinical: {{row[3].mane_plus_clinical}} + {% endif %} + {% if row[3].mrna %} + MANE Plus Clinical: {{row[3].mrna}} + {% endif %} - {{ row[2] }} - {{ row }} {{ row[4] }} - {{ row[4] }} + {{ row[5] }} {% else %} From 3418dc609faeaa404822b6bbba112db078695df5 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 12:01:50 +0100 Subject: [PATCH 3/9] Small fixes --- src/chanjo2/meta/handle_report_contents.py | 1 - src/chanjo2/templates/overview.html | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chanjo2/meta/handle_report_contents.py b/src/chanjo2/meta/handle_report_contents.py index 9653a592..c709dfa1 100644 --- a/src/chanjo2/meta/handle_report_contents.py +++ b/src/chanjo2/meta/handle_report_contents.py @@ -134,7 +134,6 @@ def get_report_data( interval_type=INTERVAL_TYPE_SQL_TYPE[query.interval_type], genes=genes, transcript_tags=[ - TranscriptTag.REFSEQ_MRNA, TranscriptTag.REFSEQ_MANE_PLUS_CLINICAL, TranscriptTag.REFSEQ_MANE_SELECT, TranscriptTag.REFSEQ_MRNA, diff --git a/src/chanjo2/templates/overview.html b/src/chanjo2/templates/overview.html index 2734f797..d15ba3c1 100644 --- a/src/chanjo2/templates/overview.html +++ b/src/chanjo2/templates/overview.html @@ -81,8 +81,8 @@ MANE Plus Clinical: {{row[3].mrna}} {% endif %} - {{ row[4] }} - {{ row[5] }} + {{ row[4] }} + {{ row[5] }} {% else %} From 7d7ab730e36681514e7462ac00d420166051ec47 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 12:02:45 +0100 Subject: [PATCH 4/9] Fix changelog structure --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c62e4e8..bab85298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,8 @@ -## [unreleased] -### Fixed -- Addressed the `Starlette Denial of service (DoS) via multipart/form-data` by updating starlette library. among others - ## [unreleased] ### Added - Refseq transcripts names on coverage overview page +### Fixed +- Addressed the `Starlette Denial of service (DoS) via multipart/form-data` by updating starlette library. among others ## [2.0] ### Added From 5a2f2d9fa5756f0b9f6c356c79986d040a0432ac Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 12:34:11 +0100 Subject: [PATCH 5/9] Aplly only to transcripts --- src/chanjo2/meta/handle_d4.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/chanjo2/meta/handle_d4.py b/src/chanjo2/meta/handle_d4.py index ed2de311..c86835f3 100644 --- a/src/chanjo2/meta/handle_d4.py +++ b/src/chanjo2/meta/handle_d4.py @@ -86,11 +86,15 @@ def get_report_sample_interval_coverage( interval_hgnc_symbol, interval_hgnc_id, interval.ensembl_id, - { - "mane_select": interval.refseq_mane_select, - "mane_plus_clinical": interval.refseq_mane_plus_clinical, - "mrna": interval.refseq_mane_select, - }, + ( + { + "mane_select": interval.refseq_mane_select, + "mane_plus_clinical": interval.refseq_mane_plus_clinical, + "mrna": interval.refseq_mane_select, + } + if isinstance(interval, SQLTranscript) + else {} + ), sample_name, round(interval_coverage_at_threshold * 100, 2), ) From adeda8e4c6f60199da03c948d96c8c2b96dd48f0 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 12:41:22 +0100 Subject: [PATCH 6/9] Switch to Bootstrap 5 badges --- src/chanjo2/templates/overview.html | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/chanjo2/templates/overview.html b/src/chanjo2/templates/overview.html index d15ba3c1..f67a86cb 100644 --- a/src/chanjo2/templates/overview.html +++ b/src/chanjo2/templates/overview.html @@ -2,24 +2,6 @@ {% block css %} {{ super() }} - {% endblock %} {% macro completeness_cutoffs() %} @@ -72,13 +54,13 @@ {{ row[2] }} {% if row[3].mane_select %} - MANE Select: {{row[3].mane_select}} + MANE Select: {{row[3].mane_select}} {% endif %} {% if row[3].mane_plus_clinical %} - MANE Plus Clinical: {{row[3].mane_plus_clinical}} + MANE Plus Clinical: {{row[3].mane_plus_clinical}} {% endif %} {% if row[3].mrna %} - MANE Plus Clinical: {{row[3].mrna}} + {{row[3].mrna}} {% endif %} {{ row[4] }} From a2e275f57e9d284946e9732071e47e2d3713fe33 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 12:49:26 +0100 Subject: [PATCH 7/9] Collect right tx name --- src/chanjo2/meta/handle_d4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chanjo2/meta/handle_d4.py b/src/chanjo2/meta/handle_d4.py index c86835f3..4a052f9b 100644 --- a/src/chanjo2/meta/handle_d4.py +++ b/src/chanjo2/meta/handle_d4.py @@ -58,6 +58,7 @@ def get_report_sample_interval_coverage( genes_covered_under_custom_threshold = set() for interval_nr, interval in enumerate(sql_intervals): + if interval.ensembl_id in interval_ids: continue for threshold in completeness_thresholds: @@ -90,7 +91,7 @@ def get_report_sample_interval_coverage( { "mane_select": interval.refseq_mane_select, "mane_plus_clinical": interval.refseq_mane_plus_clinical, - "mrna": interval.refseq_mane_select, + "mrna": interval.refseq_mrna, } if isinstance(interval, SQLTranscript) else {} From 8449c8860b5c708c1f445b9918b18b1f70a14e53 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 12:52:19 +0100 Subject: [PATCH 8/9] Float end style --- src/chanjo2/templates/overview.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chanjo2/templates/overview.html b/src/chanjo2/templates/overview.html index f67a86cb..af5ae5cd 100644 --- a/src/chanjo2/templates/overview.html +++ b/src/chanjo2/templates/overview.html @@ -54,13 +54,13 @@ {{ row[2] }} {% if row[3].mane_select %} - MANE Select: {{row[3].mane_select}} + MANE Select: {{row[3].mane_select}} {% endif %} {% if row[3].mane_plus_clinical %} - MANE Plus Clinical: {{row[3].mane_plus_clinical}} + MANE Plus Clinical: {{row[3].mane_plus_clinical}} {% endif %} {% if row[3].mrna %} - {{row[3].mrna}} + {{row[3].mrna}} {% endif %} {{ row[4] }} From c81e28d595d2dbda6ed5dbf75789333a39a83c7c Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Mon, 28 Oct 2024 12:59:04 +0100 Subject: [PATCH 9/9] Final touch --- src/chanjo2/templates/overview.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chanjo2/templates/overview.html b/src/chanjo2/templates/overview.html index af5ae5cd..b6fbb62c 100644 --- a/src/chanjo2/templates/overview.html +++ b/src/chanjo2/templates/overview.html @@ -52,7 +52,7 @@ - {{ row[2] }} + {{ row[2] }} {% if row[3].mane_select %} MANE Select: {{row[3].mane_select}} {% endif %}