From 3adca17e79c0839c98baea0beda97eda43376cb6 Mon Sep 17 00:00:00 2001 From: sagely1 <114952739+sagely1@users.noreply.github.com> Date: Tue, 17 Dec 2024 02:36:10 -0800 Subject: [PATCH] AG-1599 remove pharos class --- .../gene-druggability.component.ts | 31 ++--- .../gene-hero/gene-hero.component.html | 4 +- .../gene-nominated-targets.component.ts | 8 +- .../gene-similar/gene-similar.component.ts | 8 +- src/app/models/genes.ts | 7 +- src/app/testing/gene-mocks.ts | 130 ++++++++---------- src/server/models/genes.ts | 4 +- 7 files changed, 82 insertions(+), 110 deletions(-) diff --git a/src/app/features/genes/components/gene-druggability/gene-druggability.component.ts b/src/app/features/genes/components/gene-druggability/gene-druggability.component.ts index 5a5cfd9f..65e2e2df 100644 --- a/src/app/features/genes/components/gene-druggability/gene-druggability.component.ts +++ b/src/app/features/genes/components/gene-druggability/gene-druggability.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Gene, Druggability } from '../../../../models'; @@ -18,7 +18,7 @@ export interface GeneResourceType { templateUrl: './gene-druggability.component.html', styleUrls: ['./gene-druggability.component.scss'], }) -export class GeneDruggabilityComponent implements OnInit { +export class GeneDruggabilityComponent { _gene: Gene | undefined; get gene(): Gene | undefined { return this._gene; @@ -43,28 +43,23 @@ export class GeneDruggabilityComponent implements OnInit { private geneService: GeneService ) {} - ngOnInit() { - // - } - init() { // Update the initial buckets if (this.gene) { if (!this.gene.druggability) { - this.gene.druggability = [ - { - sm_druggability_bucket: this.getDefaultBucketNumber(), - safety_bucket: this.getDefaultBucketNumber(), - abability_bucket: this.getDefaultBucketNumber(), - pharos_class: '', - classification: this.getDefaultText(), - safety_bucket_definition: this.getDefaultText(), - abability_bucket_definition: this.getDefaultText(), - }, - ]; + this.gene.druggability = + { + sm_druggability_bucket: this.getDefaultBucketNumber(), + safety_bucket: this.getDefaultBucketNumber(), + abability_bucket: this.getDefaultBucketNumber(), + pharos_class: [], + classification: this.getDefaultText(), + safety_bucket_definition: this.getDefaultText(), + abability_bucket_definition: this.getDefaultText(), + }; } - this.druggability = this.gene.druggability[0]; + this.druggability = this.gene.druggability; this.currentBucketSM = this.druggability.sm_druggability_bucket; this.currentBucketAB = this.druggability.abability_bucket; this.currentBucketSF = this.druggability.safety_bucket; diff --git a/src/app/features/genes/components/gene-hero/gene-hero.component.html b/src/app/features/genes/components/gene-hero/gene-hero.component.html index fdd55361..49773c20 100644 --- a/src/app/features/genes/components/gene-hero/gene-hero.component.html +++ b/src/app/features/genes/components/gene-hero/gene-hero.component.html @@ -22,9 +22,9 @@

Biological Domains

{{ getBiodomains() }}

-
+

Pharos Class

-

{{ gene.druggability[0].pharos_class }}

+

{{ gene.druggability.pharos_class.join(', ') }}

Also known as

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 8ba8aebb..d50d9e36 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 @@ -119,13 +119,7 @@ export class GeneNominatedTargetsComponent implements OnInit { : undefined; // Populate Druggability display fields - if (de.druggability && de.druggability.length) { - de.pharos_class_display_value = de.druggability[0].pharos_class - ? de.druggability[0].pharos_class - : 'No value'; - } else { - de.pharos_class_display_value = 'No value'; - } + de.pharos_class_display_value = de.druggability.pharos_class; }); this.genes = genes; 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 3bcb4159..4135149f 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 @@ -107,13 +107,7 @@ export class GeneSimilarComponent implements OnInit { de.nominated_target_display_value = false; // Populate Druggability display fields - if (de.druggability && de.druggability.length) { - de.pharos_class_display_value = de.druggability[0].pharos_class - ? de.druggability[0].pharos_class - : 'No value'; - } else { - de.pharos_class_display_value = 'No value'; - } + de.pharos_class_display_value = de.druggability.pharos_class; }); this.genes = genes; diff --git a/src/app/models/genes.ts b/src/app/models/genes.ts index f7ea1958..f7ba2e8f 100644 --- a/src/app/models/genes.ts +++ b/src/app/models/genes.ts @@ -23,7 +23,6 @@ export interface TargetNomination { input_data: string; validation_study_details: string; initial_nomination: number; - // team_data?: Team; } @@ -41,7 +40,7 @@ export interface Druggability { sm_druggability_bucket: number; safety_bucket: number; abability_bucket: number; - pharos_class: string; + pharos_class: string[]; // classification should really be named sm_druggability_bucket_definition classification: string; safety_bucket_definition: string; @@ -64,7 +63,7 @@ export interface Gene { protein_brain_change_studied: boolean; target_nominations: TargetNomination[] | null; median_expression: MedianExpression[]; - druggability: Druggability[]; + druggability: Druggability; total_nominations: number | null; is_adi: boolean; is_tep: boolean; @@ -85,7 +84,7 @@ export interface Gene { similar_genes_network?: SimilarGenesNetwork; // Similar table (not in mongo document) - pharos_class_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; nominated_target_display_value?: boolean; diff --git a/src/app/testing/gene-mocks.ts b/src/app/testing/gene-mocks.ts index 3ba576d3..0edc07b0 100644 --- a/src/app/testing/gene-mocks.ts +++ b/src/app/testing/gene-mocks.ts @@ -205,20 +205,18 @@ export const geneMock1: Gene = { tissue: 'STG', }, ], - druggability: [ - { - sm_druggability_bucket: 3, - safety_bucket: 4, - abability_bucket: 3, - pharos_class: 'Tbio', - classification: - 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', - safety_bucket_definition: - 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', - abability_bucket_definition: - 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', - }, - ], + druggability: { + sm_druggability_bucket: 3, + safety_bucket: 4, + abability_bucket: 3, + pharos_class: ['Tbio'], + classification: + 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', + safety_bucket_definition: + 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', + abability_bucket_definition: + 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', + }, total_nominations: 5, rna_differential_expression: [ { @@ -3129,20 +3127,18 @@ export const geneMock2: Gene = { tissue: 'STG', }, ], - druggability: [ - { - sm_druggability_bucket: 3, - safety_bucket: 4, - abability_bucket: 3, - pharos_class: 'Tbio', - classification: - 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', - safety_bucket_definition: - 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', - abability_bucket_definition: - 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', - }, - ], + druggability: { + sm_druggability_bucket: 3, + safety_bucket: 4, + abability_bucket: 3, + pharos_class: ['Tbio'], + classification: + 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', + safety_bucket_definition: + 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', + abability_bucket_definition: + 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', + }, total_nominations: 3, is_adi: false, is_tep: true, @@ -3257,20 +3253,18 @@ export const geneMock3: Gene = { tissue: 'STG', }, ], - druggability: [ - { - sm_druggability_bucket: 3, - safety_bucket: 4, - abability_bucket: 3, - pharos_class: 'Tbio', - classification: - 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', - safety_bucket_definition: - 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', - abability_bucket_definition: - 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', - }, - ], + druggability: { + sm_druggability_bucket: 3, + safety_bucket: 4, + abability_bucket: 3, + pharos_class: ['Tbio'], + classification: + 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', + safety_bucket_definition: + 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', + abability_bucket_definition: + 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', + }, total_nominations: null, is_adi: false, is_tep: true, @@ -3441,20 +3435,18 @@ export const nominatedGeneMock1: Gene = { }, ], median_expression: [], - druggability: [ - { - sm_druggability_bucket: 3, - safety_bucket: 4, - abability_bucket: 3, - pharos_class: 'Tbio', - classification: - 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', - safety_bucket_definition: - 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', - abability_bucket_definition: - 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', - }, - ], + druggability: { + sm_druggability_bucket: 3, + safety_bucket: 4, + abability_bucket: 3, + pharos_class: ['Tbio'], + classification: + 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', + safety_bucket_definition: + 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', + abability_bucket_definition: + 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', + }, total_nominations: 4, is_adi: false, is_tep: false, @@ -3544,20 +3536,18 @@ export const noHGNCgeneMock: Gene = { }, ], median_expression: [], - druggability: [ - { - sm_druggability_bucket: 3, - safety_bucket: 4, - abability_bucket: 3, - pharos_class: 'Tbio', - classification: - 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', - safety_bucket_definition: - 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', - abability_bucket_definition: - 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', - }, - ], + druggability: { + sm_druggability_bucket: 3, + safety_bucket: 4, + abability_bucket: 3, + pharos_class: ['Tbio'], + classification: + 'Targetable by structure: Structurally druggable protein, based on the presence of a druggable pocket in the protein (DrugEBIlity/CanSAR).', + safety_bucket_definition: + 'More than two of: high off target gene expression, cancer driver, essential gene, associated deleterious genetic disorder, HPO phenotype associated gene, or black box warning on clinically used drug.', + abability_bucket_definition: + 'Cell membrane-bound proteins. Highly accessible to antibody-based therapies, but potentially less so than secreted proteins or ECM components.', + }, total_nominations: 4, is_adi: false, is_tep: false, diff --git a/src/server/models/genes.ts b/src/server/models/genes.ts index aea8b9e3..e714e078 100644 --- a/src/server/models/genes.ts +++ b/src/server/models/genes.ts @@ -53,7 +53,7 @@ const DruggabilitySchema = new Schema({ sm_druggability_bucket: { type: Number, required: true }, safety_bucket: { type: Number, required: true }, abability_bucket: { type: Number, required: true }, - pharos_class: { type: String, required: true }, + pharos_class: { type: [String], required: true }, classification: { type: String, required: true }, safety_bucket_definition: { type: String, required: true }, abability_bucket_definition: { type: String, required: true }, @@ -76,7 +76,7 @@ const GeneSchema = new Schema( protein_brain_change_studied: { type: Boolean, required: true }, target_nominations: { type: [TargetNominationSchema], required: true }, median_expression: { type: [MedianExpressionSchema], required: true }, - druggability: { type: [DruggabilitySchema], required: true }, + druggability: { type: DruggabilitySchema, required: true }, total_nominations: { type: Number, required: true }, ensembl_info: { type: EnsemblInfoSchema, required: true } },