From 6139a8d236113dfb7177cecd2cfa1ccbf05caf5b Mon Sep 17 00:00:00 2001 From: sagely1 <114952739+sagely1@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:40:53 -0800 Subject: [PATCH] AG-959 Surface Ensembl release version --- .../gene-hero/gene-hero.component.html | 20 +++++++-- .../gene-hero/gene-hero.component.scss | 4 ++ .../gene-hero/gene-hero.component.spec.ts | 10 +++++ .../gene-hero/gene-hero.component.ts | 11 +++++ src/app/models/EnsemblInfo.ts | 5 +++ src/app/models/genes.ts | 3 ++ src/app/testing/gene-mocks.ts | 45 ++++++++++++++++--- src/server/models/genes.ts | 8 ++++ 8 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 src/app/models/EnsemblInfo.ts diff --git a/src/app/features/genes/components/gene-hero/gene-hero.component.html b/src/app/features/genes/components/gene-hero/gene-hero.component.html index aa2e8959..226f0d80 100644 --- a/src/app/features/genes/components/gene-hero/gene-hero.component.html +++ b/src/app/features/genes/components/gene-hero/gene-hero.component.html @@ -14,7 +14,7 @@
{{ getSummary() }}
-{{ gene.ensembl_gene_id }}
++ {{ gene.ensembl_gene_id }} + + (Ensembl Release {{ gene.ensembl_info[0].ensembl_release }}) + +
+0"> + Possible replacement value 1">s: + {{ gene.ensembl_info[0].ensembl_possible_replacements.join(', ')}} +
{{ getAlias() }}
diff --git a/src/app/features/genes/components/gene-hero/gene-hero.component.scss b/src/app/features/genes/components/gene-hero/gene-hero.component.scss index 57f98b79..f2c8c354 100644 --- a/src/app/features/genes/components/gene-hero/gene-hero.component.scss +++ b/src/app/features/genes/components/gene-hero/gene-hero.component.scss @@ -53,3 +53,7 @@ hr { text-transform: uppercase; margin-bottom: 15px; } + +.possible-replacements { + margin-bottom: 15px; +} \ No newline at end of file diff --git a/src/app/features/genes/components/gene-hero/gene-hero.component.spec.ts b/src/app/features/genes/components/gene-hero/gene-hero.component.spec.ts index d732b85f..7a7c7c51 100644 --- a/src/app/features/genes/components/gene-hero/gene-hero.component.spec.ts +++ b/src/app/features/genes/components/gene-hero/gene-hero.component.spec.ts @@ -110,4 +110,14 @@ describe('Component: Gene Hero', () => { const expected = 'Immune Response, Lipid Metabolism, Structural Stabilization, Synapse, Vasculature'; expect(component.getBiodomains()).toBe(expected); }); + + it('should return the ensembl permalink', () => { + component.gene = geneMock1; + expect(component.getEnsemblUrl()).toBe('https://may2015.archive.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000264794'); + }); + + it('should return a url with ensembl id', () => { + component.gene = geneMock1; + expect(component.getPossibleReplacementsURL()).toBe('https://useast.ensembl.org/Homo_sapiens/Gene/Idhistory?g=ENSG00000147065'); + }); }); diff --git a/src/app/features/genes/components/gene-hero/gene-hero.component.ts b/src/app/features/genes/components/gene-hero/gene-hero.component.ts index 07a7d389..ad877750 100644 --- a/src/app/features/genes/components/gene-hero/gene-hero.component.ts +++ b/src/app/features/genes/components/gene-hero/gene-hero.component.ts @@ -101,4 +101,15 @@ export class GeneHeroComponent { .sort(ascending); return biodomains.join(', '); } + + getEnsemblUrl() { + if (!this.gene?.ensembl_info) + return ''; + return this.gene?.ensembl_info[0].ensembl_permalink; + } + + getPossibleReplacementsURL() { + let url = 'https://useast.ensembl.org/Homo_sapiens/Gene/Idhistory?g='; + return url += this.gene?.ensembl_gene_id; + } } diff --git a/src/app/models/EnsemblInfo.ts b/src/app/models/EnsemblInfo.ts new file mode 100644 index 00000000..a1b08a2e --- /dev/null +++ b/src/app/models/EnsemblInfo.ts @@ -0,0 +1,5 @@ +export interface EnsemblInfo { + ensembl_release: number; + ensembl_possible_replacements: string[]; + ensembl_permalink: string; +} \ No newline at end of file diff --git a/src/app/models/genes.ts b/src/app/models/genes.ts index f979fc0d..fb965769 100644 --- a/src/app/models/genes.ts +++ b/src/app/models/genes.ts @@ -8,6 +8,7 @@ import { SimilarGenesNetwork, BioDomains } from './'; +import { EnsemblInfo } from './EnsemblInfo'; export interface TargetNomination { source: string; @@ -98,6 +99,8 @@ export interface Gene { input_data_display_value?: string; bio_domains?: BioDomains; + + ensembl_info: EnsemblInfo[]; } export interface GenesResponse { diff --git a/src/app/testing/gene-mocks.ts b/src/app/testing/gene-mocks.ts index f744697e..ffc938df 100644 --- a/src/app/testing/gene-mocks.ts +++ b/src/app/testing/gene-mocks.ts @@ -2934,7 +2934,14 @@ export const geneMock1: Gene = { }, is_adi: false, is_tep: true, - resource_url: 'https://adknowledgeportal.synapse.org/Explore/Target%20Enabling%20Resources?QueryWrapper0=%7B%22sql%22%3A%22select%20*%20from%20syn26146692%20WHERE%20%60isPublic%60%20%3D%20true%22%2C%22limit%22%3A25%2C%22offset%22%3A0%2C%22selectedFacets%22%3A%5B%7B%22concreteType%22%3A%22org.sagebionetworks.repo.model.table.FacetColumnValuesRequest%22%2C%22columnName%22%3A%22target%22%2C%22facetValues%22%3A%5B%22MSN%22%5D%7D%5D%7D' + resource_url: 'https://adknowledgeportal.synapse.org/Explore/Target%20Enabling%20Resources?QueryWrapper0=%7B%22sql%22%3A%22select%20*%20from%20syn26146692%20WHERE%20%60isPublic%60%20%3D%20true%22%2C%22limit%22%3A25%2C%22offset%22%3A0%2C%22selectedFacets%22%3A%5B%7B%22concreteType%22%3A%22org.sagebionetworks.repo.model.table.FacetColumnValuesRequest%22%2C%22columnName%22%3A%22target%22%2C%22facetValues%22%3A%5B%22MSN%22%5D%7D%5D%7D', + ensembl_info: [ + { + ensembl_release: 84, + ensembl_possible_replacements: ['ENSG00000283172'], + ensembl_permalink: 'https://may2015.archive.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000264794' + } + ] }; export const geneMock2: Gene = { @@ -3121,7 +3128,14 @@ export const geneMock2: Gene = { total_nominations: 3, is_adi: false, is_tep: true, - resource_url: 'https://adknowledgeportal.synapse.org/Explore/Target%20Enabling%20Resources?QueryWrapper0=%7B%22sql%22%3A%22select%20*%20from%20syn26146692%20WHERE%20%60isPublic%60%20%3D%20true%22%2C%22limit%22%3A25%2C%22offset%22%3A0%2C%22selectedFacets%22%3A%5B%7B%22concreteType%22%3A%22org.sagebionetworks.repo.model.table.FacetColumnValuesRequest%22%2C%22columnName%22%3A%22target%22%2C%22facetValues%22%3A%5B%22PLEC%22%5D%7D%5D%7D' + resource_url: 'https://adknowledgeportal.synapse.org/Explore/Target%20Enabling%20Resources?QueryWrapper0=%7B%22sql%22%3A%22select%20*%20from%20syn26146692%20WHERE%20%60isPublic%60%20%3D%20true%22%2C%22limit%22%3A25%2C%22offset%22%3A0%2C%22selectedFacets%22%3A%5B%7B%22concreteType%22%3A%22org.sagebionetworks.repo.model.table.FacetColumnValuesRequest%22%2C%22columnName%22%3A%22target%22%2C%22facetValues%22%3A%5B%22PLEC%22%5D%7D%5D%7D', + ensembl_info: [ + { + ensembl_release: 84, + ensembl_possible_replacements: ['ENSG00000283172, ENSG00000283172'], + ensembl_permalink: 'https://may2015.archive.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000264794' + } + ] }; export const geneMock3: Gene = { @@ -3243,7 +3257,14 @@ export const geneMock3: Gene = { total_nominations: null, is_adi: false, is_tep: true, - resource_url: null + resource_url: null, + ensembl_info: [ + { + ensembl_release: 84, + ensembl_possible_replacements: ['ENSG00000283172, ENSG00000283172'], + ensembl_permalink: 'https://may2015.archive.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000264794' + } + ] }; export const gctGeneMock1: GCTGene = { @@ -3421,7 +3442,14 @@ export const nominatedGeneMock1: Gene = { total_nominations: 4, is_adi: false, is_tep: false, - resource_url: null + resource_url: null, + ensembl_info: [ + { + ensembl_release: 84, + ensembl_possible_replacements: ['ENSG00000283172, ENSG00000283172'], + ensembl_permalink: 'https://may2015.archive.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000264794' + } + ] } as Gene; export const noHGNCgeneMock: Gene = { @@ -3518,5 +3546,12 @@ export const noHGNCgeneMock: Gene = { total_nominations: 4, is_adi: false, is_tep: false, - resource_url: null + resource_url: null, + ensembl_info: [ + { + ensembl_release: 84, + ensembl_possible_replacements: ['ENSG00000283172, ENSG00000283172'], + ensembl_permalink: 'https://may2015.archive.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000264794' + } + ] } as Gene; diff --git a/src/server/models/genes.ts b/src/server/models/genes.ts index 94465fca..ac077977 100644 --- a/src/server/models/genes.ts +++ b/src/server/models/genes.ts @@ -12,6 +12,7 @@ import { TargetNomination, Druggability, } from '../../app/models'; +import { EnsemblInfo } from '../../app/models/EnsemblInfo'; export { Gene } from '../../app/models'; // -------------------------------------------------------------------------- // @@ -42,6 +43,12 @@ const MedianExpressionSchema = new Schema