From 4d93ca868f1348408f4f809accb286b133c4d847 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Tue, 26 Mar 2024 09:04:48 +0100 Subject: [PATCH 1/4] Coverage overview over a gene should return transcript statistics if D4 file contains WGS data --- CHANGELOG.md | 1 + src/chanjo2/models/pydantic_models.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 538956a9..4cdb5223 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Fixed - Avoid MySQLdb.OperationalError `Server has gone away` by modifying by setting `pool_pre_ping=True` when creating the engine - Coverage report screenshot displayed on README page and on the documenattion to reflect true statistics from the demo samples +- Coverage overview over a gene should return transcript statistics if D4 file contains WGS data ## [1.5] ### Added diff --git a/src/chanjo2/models/pydantic_models.py b/src/chanjo2/models/pydantic_models.py index d3192864..ae308513 100644 --- a/src/chanjo2/models/pydantic_models.py +++ b/src/chanjo2/models/pydantic_models.py @@ -272,6 +272,13 @@ def coverage_thresholds_validator(cls, completeness_thresholds: str): thresholds: List[str] = completeness_thresholds.split(",") return [int(threshold.strip()) for threshold in thresholds] + @field_validator("interval_type", mode="before") + def interval_type_validator(cls, interval_type: IntervalType): + """Make sure that Gene stats are including transcript data even if""" + if interval_type == IntervalType.GENES: + return IntervalType.TRANSCRIPTS + return interval_type + class SampleSexRow(BaseModel): sample: str From e895049c8a30227ebd9c1299ddd4c032e6e6daed Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Tue, 26 Mar 2024 10:44:04 +0100 Subject: [PATCH 2/4] Fix docstring --- src/chanjo2/models/pydantic_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chanjo2/models/pydantic_models.py b/src/chanjo2/models/pydantic_models.py index ae308513..5bc96010 100644 --- a/src/chanjo2/models/pydantic_models.py +++ b/src/chanjo2/models/pydantic_models.py @@ -274,7 +274,7 @@ def coverage_thresholds_validator(cls, completeness_thresholds: str): @field_validator("interval_type", mode="before") def interval_type_validator(cls, interval_type: IntervalType): - """Make sure that Gene stats are including transcript data even if""" + """Make sure that Gene stats are including transcript data even if it's a WGS analysis.""" if interval_type == IntervalType.GENES: return IntervalType.TRANSCRIPTS return interval_type From ddc31990664a9e7dce4092202a6fba32012d2e84 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Tue, 26 Mar 2024 13:48:27 +0100 Subject: [PATCH 3/4] Update src/chanjo2/models/pydantic_models.py Co-authored-by: Henrik Stranneheim --- src/chanjo2/models/pydantic_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chanjo2/models/pydantic_models.py b/src/chanjo2/models/pydantic_models.py index 5bc96010..21d54db9 100644 --- a/src/chanjo2/models/pydantic_models.py +++ b/src/chanjo2/models/pydantic_models.py @@ -273,7 +273,7 @@ def coverage_thresholds_validator(cls, completeness_thresholds: str): return [int(threshold.strip()) for threshold in thresholds] @field_validator("interval_type", mode="before") - def interval_type_validator(cls, interval_type: IntervalType): + def interval_type_validator(cls, interval_type: IntervalType) -> IntervalType: """Make sure that Gene stats are including transcript data even if it's a WGS analysis.""" if interval_type == IntervalType.GENES: return IntervalType.TRANSCRIPTS From 2cc3fa43a1f06959d0533700600ae26299ac1fbf Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Tue, 26 Mar 2024 13:48:34 +0100 Subject: [PATCH 4/4] Update src/chanjo2/models/pydantic_models.py Co-authored-by: Henrik Stranneheim --- src/chanjo2/models/pydantic_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chanjo2/models/pydantic_models.py b/src/chanjo2/models/pydantic_models.py index 21d54db9..76a41da2 100644 --- a/src/chanjo2/models/pydantic_models.py +++ b/src/chanjo2/models/pydantic_models.py @@ -274,7 +274,7 @@ def coverage_thresholds_validator(cls, completeness_thresholds: str): @field_validator("interval_type", mode="before") def interval_type_validator(cls, interval_type: IntervalType) -> IntervalType: - """Make sure that Gene stats are including transcript data even if it's a WGS analysis.""" + """Make sure that gene stats include transcript data even if it's a WGS analysis.""" if interval_type == IntervalType.GENES: return IntervalType.TRANSCRIPTS return interval_type