Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AG-1565 remove druggability #1340

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
AG-1565 remove druggability columns
sagely1 committed Dec 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 57fa18ac51b10e12a8978f0ab22579e4a5494a12
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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\"",
Original file line number Diff line number Diff line change
@@ -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';
}
});

Original file line number Diff line number Diff line change
@@ -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';
}
});

Original file line number Diff line number Diff line change
@@ -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;
}
3 changes: 0 additions & 3 deletions src/app/models/genes.ts
Original file line number Diff line number Diff line change
@@ -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;
53 changes: 0 additions & 53 deletions tests/nominated-targets.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
});
});
7 changes: 0 additions & 7 deletions tests/similar-genes.spec.ts
Original file line number Diff line number Diff line change
@@ -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('');
});
});