Skip to content

Commit

Permalink
Merge pull request #1278 from sagely1/AG-1221-add-srm-evidence-to-gct…
Browse files Browse the repository at this point in the history
…-proteomics

AG-1221 add SRM option to GCT subcategory dropdown options
  • Loading branch information
sagely1 authored Jan 24, 2024
2 parents d1ea464 + 6179e88 commit d85512d
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ <h1 class="gct-heading h2">Gene Comparison Tool</h1>
<div class="gct-filter-label">{{ subCategoryLabel }}</div>
<div class="gct-sub-category-selector">
<p-dropdown
id="subCategory"
[options]="subCategories"
[(ngModel)]="subCategory"
(onChange)="onSubCategoryChange()"
Expand Down Expand Up @@ -312,7 +313,7 @@ <h1 class="gct-heading h2">Gene Comparison Tool</h1>
<div class="gene-controls">
<div>
{{ gene.hgnc_symbol || gene.ensembl_gene_id }}
<ng-container *ngIf="gene.uniprotid">
<ng-container *ngIf="gene.uniprotid && this.subCategory !== 'SRM'">
({{ gene.uniprotid }})
</ng-container>
</div>
Expand Down Expand Up @@ -441,7 +442,7 @@ <h1 class="gct-heading h2">Gene Comparison Tool</h1>
<div class="gene-controls">
<div>
{{ gene.hgnc_symbol || gene.ensembl_gene_id }}
<ng-container *ngIf="gene.uniprotid">
<ng-container *ngIf="gene.uniprotid && this.subCategory !== 'SRM'">
({{ gene.uniprotid }})
</ng-container>
</div>
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ export const subCategories: { [key: string]: GCTSelectOption[] } = {
],
'Protein - Differential Expression': [
{
label: 'Label-free Quantification (LFQ)',
value: 'LFQ',
label: 'Targeted Selected Reaction Monitoring (SRM)',
value: 'SRM',
},
{
label: 'Tandem Mass Tag (TMT)',
label: 'Genome-wide Tandem Mass Tag (TMT)',
value: 'TMT',
},
{
label: 'Genome-wide Label-free Quantification (LFQ)',
value: 'LFQ',
},
],
};

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
14 changes: 0 additions & 14 deletions src/server/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,9 @@ const database = { url: '' };
doc && ('doc => ' + util.inspect(doc)), '\n');
}); */

console.log('HELLLLLLOOOOOOOO');
console.log('HELLLLLLOOOOOOOO');
console.log('HELLLLLLOOOOOOOO');
console.log('HELLLLLLOOOOOOOO');
console.log('HELLLLLLOOOOOOOO');
console.log('HELLLLLLOOOOOOOO');
console.log('HELLLLLLOOOOOOOO');
console.log('HELLLLLLOOOOOOOO');
console.log(process.env);
console.log(process.env.MONGODB_HOST);
console.log(process.env.MONGODB_PORT);
console.log('DONE!');
console.log('DONE!');
console.log('DONE!');
console.log('DONE!');
console.log('DONE!');
console.log('DONE!');

// Set the database url
if (
Expand Down
11 changes: 10 additions & 1 deletion src/server/components/comparison.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
ProteomicsLFQCollection,
ProteomicsTMTCollection,
Team,
ProteomicsSRMCollection,
} from '../models';
import { BioDomains, TargetNomination, Scores } from '../../app/models';

Expand Down Expand Up @@ -208,11 +209,19 @@ export async function getProteinComparisonGenes(method: string) {
.lean()
.sort({ hgnc_symbol: 1, tissue: 1 })
.exec();
} else {
} else if ('LFQ' === method) {
items = await ProteomicsLFQCollection.find()
.lean()
.sort({ hgnc_symbol: 1, tissue: 1 })
.exec();
} else if ('SRM' === method) {
items = await ProteomicsSRMCollection.find()
.lean()
.sort({ hgnc_symbol: 1, tissue: 1 })
.exec();
} else {
// TODO capture corner scenarios
throw 'unknown method selected: ' + method;
}

if (items) {
Expand Down
30 changes: 30 additions & 0 deletions tests/gene-comparison-tool.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { test, expect } from '@playwright/test';

test.describe('specific viewport block', () => {
test.slow();
test.use({ viewport: { width: 1600, height: 1200 } });

test('has title', async ({ page }) => {
await page.goto('/genes/comparison?category=Protein+-+Differential+Expression');

// wait for page to load (i.e. spinner to disappear)
await expect(page.locator('div:nth-child(4) > div > .spinner'))
.not.toBeVisible({ timeout: 250000});

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle('Gene Comparison | Visual comparison tool for AD genes');
});

test('sub-category is SRM by default', async ({ page }) => {
// set category for Protein - Differential Expression
await page.goto('/genes/comparison?category=Protein+-+Differential+Expression');

// wait for page to load (i.e. spinner to disappear)
await expect(page.locator('div:nth-child(4) > div > .spinner'))
.not.toBeVisible({ timeout: 150000});

// expect sub-category dropdown to be SRM
const dropdown = page.locator('#subCategory');
await expect(dropdown).toHaveText('Targeted Selected Reaction Monitoring (SRM)');
});
});

0 comments on commit d85512d

Please sign in to comment.