Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add refseq transcript names on genes overview page #379

Merged
merged 9 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## [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

Expand Down
10 changes: 10 additions & 0 deletions src/chanjo2/meta/handle_d4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -86,6 +87,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_mrna,
}
if isinstance(interval, SQLTranscript)
else {}
),
sample_name,
round(interval_coverage_at_threshold * 100, 2),
)
Expand Down
6 changes: 5 additions & 1 deletion src/chanjo2/meta/handle_report_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ 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_MANE_PLUS_CLINICAL,
TranscriptTag.REFSEQ_MANE_SELECT,
TranscriptTag.REFSEQ_MRNA,
],
)

for sample in query.samples:
Expand Down
19 changes: 15 additions & 4 deletions src/chanjo2/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,22 @@
<td>
<a href="#" onclick="getGeneStatsPage({{row[1]}});">
{{row[0]}}
</a>
</a> <!-- link to gene -->
</td>
<td>{{ row[2] }}</td>
<td>{{ row[3] }}</td>
<td class="text-right">{{ row[4] }}</td>
<td>
{{ row[2] }} <!-- Ensembl ID -->
{% if row[3].mane_select %}
<span class="badge bg-dark float-end ">MANE Select: {{row[3].mane_select}}</span>
{% endif %}
{% if row[3].mane_plus_clinical %}
<span class="badge bg-dark float-end">MANE Plus Clinical: {{row[3].mane_plus_clinical}}</span>
{% endif %}
{% if row[3].mrna %}
<span class="badge bg-secondary float-end">{{row[3].mrna}}</span>
{% endif %}
</td>
<td>{{ row[4] }}</td> <!-- sample name -->
<td class="text-right">{{ row[5] }}</td> <!-- coverage stats -->
</tr>
{% else %}
<tr>
Expand Down
Loading