Skip to content

Commit

Permalink
AG-1221 modify SRM label on popup
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed Jan 24, 2024
1 parent 765a705 commit a2cbf68
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;

Expand Down Expand Up @@ -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);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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 + ')';
Expand Down
86 changes: 86 additions & 0 deletions src/app/testing/gene-comparison-tool-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a2cbf68

Please sign in to comment.