Skip to content

Commit

Permalink
AG-1599 remove pharos class
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed Dec 17, 2024
1 parent 4524665 commit 3adca17
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 110 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ <h4 class="gene-hero-biodomains-heading">Biological Domains</h4>
{{ getBiodomains() }}
</p>
</div>
<div *ngIf="gene.druggability[0].pharos_class" class="gene-hero-pharos">
<div *ngIf="gene.druggability && gene.druggability.pharos_class" class="gene-hero-pharos">
<h4 class="gene-hero-pharos-heading">Pharos Class</h4>
<p>{{ gene.druggability[0].pharos_class }}</p>
<p>{{ gene.druggability.pharos_class.join(', ') }}</p>
</div>
<div class="gene-hero-aliases">
<h4 class="gene-hero-aliases-heading">Also known as</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions src/app/models/genes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface TargetNomination {
input_data: string;
validation_study_details: string;
initial_nomination: number;
//
team_data?: Team;
}

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
130 changes: 60 additions & 70 deletions src/app/testing/gene-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/server/models/genes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const DruggabilitySchema = new Schema<Druggability>({
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 },
Expand All @@ -76,7 +76,7 @@ const GeneSchema = new Schema<Gene>(
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 }
},
Expand Down

0 comments on commit 3adca17

Please sign in to comment.