Skip to content

Commit a293a11

Browse files
committed
Fix transcript description mismatch.
1 parent 29ef814 commit a293a11

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

rnacentral/portal/static/js/components/gene-detail/gene-detail.component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ var geneDetail = {
8181
return {
8282
id: item.id,
8383
urs: item.urs,
84-
summary: $sce.trustAsHtml(item.summary)
84+
summary: $sce.trustAsHtml(item.summary),
85+
description: item.description || ""
8586
};
8687
});
8788

rnacentral/portal/static/js/components/gene-detail/gene-detail.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h2 class="gene__widget-title">Gene Summary</h2>
5757
<div class="panel panel-default gene__litsumm-panel"
5858
ng-repeat="item in vm.litsummSummaries">
5959
<div class="gene__litsumm-subtitle">
60-
<span ng-bind-html="item.urs"></span> - <span>{{vm.geneData.summary}}</span>
60+
<span ng-bind-html="item.urs"></span> - <span ng-bind-html="item.description"></span>
6161
</div>
6262

6363
<p class="gene__litsumm-summary" ng-bind-html="item.summary"></p>

rnacentral/portal/views.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,22 +593,23 @@ def gene_detail(request, name):
593593
# Fetch litsumm summaries for all transcripts of this gene
594594
litsumm_summaries_data = []
595595

596-
# Get all litsumm summaries for transcripts of this gene
596+
# Get all litsumm summaries for transcripts of this gene with their descriptions
597597
with connection.cursor() as cursor:
598598
cursor.execute("""
599-
SELECT ls.primary_id, ls.display_id, ls.summary
599+
SELECT ls.primary_id, ls.display_id, ls.summary, pre.description
600600
FROM rnc_gene_members gm
601601
JOIN rnc_genes g ON gm.rnc_gene_id = g.id
602602
JOIN rnc_sequence_regions locus ON locus.id = gm.locus_id
603603
JOIN litsumm_summaries ls ON ls.primary_id = locus.urs_taxid
604+
JOIN rnc_rna_precomputed pre ON pre.id = locus.urs_taxid
604605
WHERE g.public_name = %s
605606
""", [gene.name])
606607
rows = cursor.fetchall()
607608

608609
pmc_regex = re.compile(r"PMC[0-9]+")
609610
seen_ids = set()
610611
for row in rows:
611-
primary_id, display_id, summary = row
612+
primary_id, display_id, summary, description = row
612613
# Skip duplicates
613614
if primary_id in seen_ids:
614615
continue
@@ -622,6 +623,7 @@ def gene_detail(request, name):
622623
"id": display_id,
623624
"urs": primary_id,
624625
"summary": summary_with_links,
626+
"description": description or "",
625627
})
626628

627629
return render(request, "portal/gene_detail.html", {

0 commit comments

Comments
 (0)