From a2cbf6855e9f42ab047c421a6f72b66e6afb2309 Mon Sep 17 00:00:00 2001 From: sagely1 <114952739+sagely1@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:59:29 -0800 Subject: [PATCH] AG-1221 modify SRM label on popup --- .../gene-comparison-tool.component.spec.ts | 14 ++- .../gene-comparison-tool.helpers.ts | 20 +++-- src/app/testing/gene-comparison-tool-mocks.ts | 86 +++++++++++++++++++ 3 files changed, 110 insertions(+), 10 deletions(-) diff --git a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts index faba1600..ace93c52 100644 --- a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts +++ b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts @@ -14,6 +14,8 @@ import { MessageService, SortEvent } from 'primeng/api'; import { Table } from 'primeng/table'; import { Checkbox } from 'primeng/checkbox'; +import * as helpers from './gene-comparison-tool.helpers'; + import { GeneComparisonToolComponent, GeneComparisonToolDetailsPanelComponent, @@ -24,7 +26,7 @@ import { import { ApiService, HelperService } from '../../../../core/services'; import { GeneService } from '../../../../features/genes/services'; import { routes } from '../../../../app.routing'; -import { comparisonGeneMock1, comparisonGeneMock2 } from '../../../../testing'; +import { comparisonGeneEmptyHGNCMock, comparisonGeneMock1, comparisonGeneMock2 } from '../../../../testing'; const DEFAULT_SIGNIFICANCE_THRESHOLD = 0.05; @@ -506,5 +508,15 @@ describe('Component: GeneComparisonToolComponent', () => { expectSignificanceThresholdIsApplied(newValue); })); + + it('should have a label for SRM popup', () => { + const label = helpers.getGeneLabelForSRM(comparisonGeneMock1); + const expected = 'MSN - ENSG00000147065'; + expect(label).toBe(expected); + + const label2 = helpers.getGeneLabelForSRM(comparisonGeneEmptyHGNCMock); + const expected2 = 'ENSG00000147065'; + expect(label2).toBe(expected2); + }); }); }); diff --git a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.helpers.ts b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.helpers.ts index 2f3b544f..467c07a3 100644 --- a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.helpers.ts +++ b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.helpers.ts @@ -68,6 +68,12 @@ export function getGeneLabelForProteinDifferentialExpression(gene: GCTGene) { gene.ensembl_gene_id; } +export function getGeneLabelForSRM(gene: GCTGene) { + let label = gene.hgnc_symbol ? `${ gene.hgnc_symbol } - ` : ''; + label += gene.ensembl_gene_id; + return label; +} + export function getScore(columnName: string, gene: GCTGene) { columnName = columnName.toUpperCase(); if (columnName === 'RISK SCORE') @@ -140,17 +146,13 @@ export const getDetailsPanelData = function ( }; if (category === 'Protein - Differential Expression') { - data.label = getGeneLabelForProteinDifferentialExpression(gene); + if (subCategory === 'SRM') { + data.label = getGeneLabelForSRM(gene); + } else { + data.label = getGeneLabelForProteinDifferentialExpression(gene); + } data.heading = 'Differential Protein Expression (' + tissue.name + ')'; data.allTissueLink = false; - - // if ('TMT' === subCategory) { - // data.min = -35; - // data.max = 35; - // } else { - // data.min = -4; - // data.max = 4; - // } } else { data.label = getGeneLabel(gene); data.heading = 'Differential RNA Expression (' + tissue.name + ')'; diff --git a/src/app/testing/gene-comparison-tool-mocks.ts b/src/app/testing/gene-comparison-tool-mocks.ts index 4266f4b5..a3b6de95 100644 --- a/src/app/testing/gene-comparison-tool-mocks.ts +++ b/src/app/testing/gene-comparison-tool-mocks.ts @@ -173,6 +173,92 @@ export const comparisonGeneMock2: GCTGene = { multi_omics_score: 1.3 }; +export const comparisonGeneEmptyHGNCMock: GCTGene = { + ensembl_gene_id: 'ENSG00000147065', + hgnc_symbol: '', + tissues: [ + { + name: 'ACC', + logfc: -0.0144678061734664, + adj_p_val: 0.893263674388766, + ci_l: -0.133332670728704, + ci_r: 0.104397058381771, + }, + { + name: 'CBE', + logfc: -0.0751554371582435, + adj_p_val: 0.530889774959758, + ci_l: -0.247449816301241, + ci_r: 0.0971389419847545, + }, + { + name: 'DLPFC', + logfc: 0.0349940606540153, + adj_p_val: 0.604655110745068, + ci_l: -0.0564780903179806, + ci_r: 0.126466211626011, + }, + { + name: 'FP', + logfc: 0.235992067764791, + adj_p_val: 0.0293685880983672, + ci_l: 0.0813918568317721, + ci_r: 0.390592278697809, + }, + { + name: 'IFG', + logfc: 0.393613393602616, + adj_p_val: 0.0000468370819411619, + ci_l: 0.236604395922642, + ci_r: 0.550622391282589, + }, + { + name: 'PCC', + logfc: 0.0870992749746771, + adj_p_val: 0.275931011190809, + ci_l: -0.0292845799777793, + ci_r: 0.203483129927133, + }, + { + name: 'PHG', + logfc: 0.6626818751507, + adj_p_val: 9.688467425132421e-14, + ci_l: 0.506746460875332, + ci_r: 0.818617289426068, + }, + { + name: 'STG', + logfc: 0.421363564302165, + adj_p_val: 0.0000165742209158385, + ci_l: 0.26315969917125, + ci_r: 0.57956742943308, + }, + { + name: 'TCX', + logfc: 0.450452869099202, + adj_p_val: 0.00000476005829762979, + ci_l: 0.275315930793305, + ci_r: 0.625589807405099, + }, + ], + nominations: { + count: 4, + year: 2018, + teams: ['Chang Lab', 'Emory', 'MSSM', 'MSSM'], + studies: ['ROSMAP', 'Kronos', 'MSBB', 'ACT', 'BLSA', 'Banner'], + inputs: ['Genetics', 'RNA', 'Protein'], + programs: ['Community Contributed', 'AMP-AD'], + validations: [ + 'validation studies ongoing', + 'not prioritized for experimental validation', + ], + }, + associations: [3, 4], + target_risk_score: 3.1, + genetics_score: 2.2, + multi_omics_score: 3.3 +}; + export const gctDetailsPanelDataMock: GCTDetailsPanelData = { label: 'label', heading: 'heading',