Skip to content

Commit

Permalink
AG-1221 add SRM option to GCT
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed Jan 22, 2024
1 parent f4734b7 commit 52b7db8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 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
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
8 changes: 7 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,16 @@ 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();
}

if (items) {
Expand Down
31 changes: 31 additions & 0 deletions tests/gene-comparison-tool.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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 }) => {
test.slow();
// 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 = await page.locator('#subCategory');
await expect(dropdown).toHaveText('Targeted Selected Reaction Monitoring (SRM)');
});
});

0 comments on commit 52b7db8

Please sign in to comment.