diff --git a/package.json b/package.json index d310d92a..638b6ba1 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "agora", - "version": "3.4.0", + "version": "3.5.0", "data-file": "syn13363290", - "data-version": "70", + "data-version": "71", "private": true, "scripts": { "dev": "concurrently --kill-others \"npm:dev:server\" \"npm:dev:app\"", diff --git a/src/app/features/genes/components/gene-nominated-targets/gene-nominated-targets.component.ts b/src/app/features/genes/components/gene-nominated-targets/gene-nominated-targets.component.ts index 7db6dccb..8ba8aebb 100644 --- a/src/app/features/genes/components/gene-nominated-targets/gene-nominated-targets.component.ts +++ b/src/app/features/genes/components/gene-nominated-targets/gene-nominated-targets.component.ts @@ -56,21 +56,6 @@ export class GeneNominatedTargetsComponent implements OnInit { header: 'Pharos Class', selected: false, }, - { - field: 'sm_druggability_display_value', - header: 'Small Molecule Druggability', - selected: false, - }, - { - field: 'safety_rating_display_value', - header: 'Safety Rating', - selected: false, - }, - { - field: 'ab_modality_display_value', - header: 'Antibody Modality', - selected: false, - }, ]; constructor(private apiService: ApiService) {} @@ -138,23 +123,8 @@ export class GeneNominatedTargetsComponent implements OnInit { de.pharos_class_display_value = de.druggability[0].pharos_class ? de.druggability[0].pharos_class : 'No value'; - de.sm_druggability_display_value = - de.druggability[0].sm_druggability_bucket + - ': ' + - de.druggability[0].classification; - de.safety_rating_display_value = - de.druggability[0].safety_bucket + - ': ' + - de.druggability[0].safety_bucket_definition; - de.ab_modality_display_value = - de.druggability[0].abability_bucket + - ': ' + - de.druggability[0].abability_bucket_definition; } else { de.pharos_class_display_value = 'No value'; - de.sm_druggability_display_value = 'No value'; - de.safety_rating_display_value = 'No value'; - de.ab_modality_display_value = 'No value'; } }); diff --git a/src/app/features/genes/components/gene-similar/gene-similar.component.ts b/src/app/features/genes/components/gene-similar/gene-similar.component.ts index 1d475610..3bcb4159 100644 --- a/src/app/features/genes/components/gene-similar/gene-similar.component.ts +++ b/src/app/features/genes/components/gene-similar/gene-similar.component.ts @@ -45,12 +45,6 @@ export class GeneSimilarComponent implements OnInit { header: 'Protein Expression Change', }, { field: 'pharos_class_display_value', header: 'Pharos Class' }, - { - field: 'sm_druggability_display_value', - header: 'Small Molecule Druggability', - }, - { field: 'safety_rating_display_value', header: 'Safety Rating' }, - { field: 'ab_modality_display_value', header: 'Antibody Modality' }, ]; gctLink: { [key: string]: string } | undefined; @@ -117,23 +111,8 @@ export class GeneSimilarComponent implements OnInit { de.pharos_class_display_value = de.druggability[0].pharos_class ? de.druggability[0].pharos_class : 'No value'; - de.sm_druggability_display_value = - de.druggability[0].sm_druggability_bucket + - ': ' + - de.druggability[0].classification; - de.safety_rating_display_value = - de.druggability[0].safety_bucket + - ': ' + - de.druggability[0].safety_bucket_definition; - de.ab_modality_display_value = - de.druggability[0].abability_bucket + - ': ' + - de.druggability[0].abability_bucket_definition; } else { de.pharos_class_display_value = 'No value'; - de.sm_druggability_display_value = 'No value'; - de.safety_rating_display_value = 'No value'; - de.ab_modality_display_value = 'No value'; } }); diff --git a/src/app/features/genes/components/gene-table/gene-table.component.ts b/src/app/features/genes/components/gene-table/gene-table.component.ts index fc80a076..452622c3 100644 --- a/src/app/features/genes/components/gene-table/gene-table.component.ts +++ b/src/app/features/genes/components/gene-table/gene-table.component.ts @@ -116,20 +116,7 @@ export class GeneTableComponent implements OnInit { } else if (a == null && b == null) { result = 0; } else if (typeof a === 'string' && typeof b === 'string') { - // Natural sorting for this score type, which can be >= 10 - if (event.field === 'sm_druggability_display_value' - || event.field === 'safety_rating_display_value' - || event.field === 'ab_modality_display_value') { - let nA = parseInt(a.split(':')[0], 10); - let nB = parseInt(b.split(':')[0], 10); - - nA = !isNaN(nA) ? nA : 999 * event.order; - nB = !isNaN(nB) ? nB : 999 * event.order; - - result = nA < nB ? -1 : nA > nB ? 1 : 0; - } else { - result = a.localeCompare(b); - } + result = a.localeCompare(b); } else { result = a < b ? -1 : a > b ? 1 : 0; } diff --git a/src/app/models/genes.ts b/src/app/models/genes.ts index f153a8a5..f7ea1958 100644 --- a/src/app/models/genes.ts +++ b/src/app/models/genes.ts @@ -85,9 +85,6 @@ export interface Gene { similar_genes_network?: SimilarGenesNetwork; // Similar table (not in mongo document) - ab_modality_display_value?: string; - safety_rating_display_value?: string; - sm_druggability_display_value?: string; pharos_class_display_value?: string; is_any_rna_changed_in_ad_brain_display_value?: string; is_any_protein_changed_in_ad_brain_display_value?: string; diff --git a/tests/nominated-targets.spec.ts b/tests/nominated-targets.spec.ts index d350f668..757c8a80 100644 --- a/tests/nominated-targets.spec.ts +++ b/tests/nominated-targets.spec.ts @@ -9,57 +9,4 @@ test.describe('specific viewport block', () => { // Expect a title "to contain" a substring. await expect(page).toHaveTitle('Nominated Targets | Candidate genes for AD treatment or prevention'); }); - - test('has correct sort on druggability columns', async ({ page }) => { - await page.goto('/genes/nominated-targets'); - - await expect(page.locator('table')).toBeVisible(); - - await page.locator('#pr_id_3 span').click(); - - await page.getByLabel('Nominations').click(); - await page.getByLabel('Year First Nominated').click(); - await page.getByLabel('Nominating Teams').click(); - await page.getByLabel('Cohort Study').click(); - await page.getByLabel('Small Molecule Druggability').click(); - await page.getByLabel('Safety Rating').click(); - await page.getByLabel('Antibody Modality').click(); - - // sort forward on small molecule druggability - await page.getByRole('cell', { name: 'Small Molecule Druggability' }).click(); - - const row = page.locator('table tr:nth-child(2)'); - let cell = row.getByRole('cell').nth(1); - await expect(cell).not.toContainText('No Value'); - - // sort reverse on small molecule druggability - await page.getByRole('cell', { name: 'Small Molecule Druggability' }).click(); - - cell = row.getByRole('cell').nth(1); - await expect(cell).not.toContainText('No Value'); - - // sort forward on safety rating - await page.getByRole('cell', { name: 'Safety Rating' }).click(); - - cell = row.getByRole('cell').nth(2); - await expect(cell).not.toContainText('No Value'); - - // sort reverse on safety rating - await page.getByRole('cell', { name: 'Safety Rating' }).click(); - - cell = row.getByRole('cell').nth(2); - await expect(cell).not.toContainText('No Value'); - - // sort forward on antibody modality - await page.getByRole('cell', { name: 'Antibody Modality' }).click(); - - cell = row.getByRole('cell').nth(3); - await expect(cell).not.toContainText('No Value'); - - // sort reverse on antibody modality - await page.getByRole('cell', { name: 'Antibody Modality' }).click(); - - cell = row.getByRole('cell').nth(3); - await expect(cell).not.toContainText('No Value'); - }); }); \ No newline at end of file diff --git a/tests/similar-genes.spec.ts b/tests/similar-genes.spec.ts index c0292a09..4796e075 100644 --- a/tests/similar-genes.spec.ts +++ b/tests/similar-genes.spec.ts @@ -20,12 +20,5 @@ test.describe('specific viewport block', () => { const cell = await page.getByRole('row').nth(1).getByRole('cell').nth(1).innerText(); expect(cell).not.toBe(''); - - - // sort reverse on small molecule druggability - await page.getByRole('cell', { name: 'Nominated Target' }).click(); - - const cell2 = await page.getByRole('row').nth(1).getByRole('cell').nth(1).innerText(); - expect(cell2).not.toBe(''); }); }); \ No newline at end of file