From eabd207af1e193cffb7c4668152398eadbcc2ab8 Mon Sep 17 00:00:00 2001 From: jingsu Date: Thu, 8 Aug 2019 15:22:33 -0400 Subject: [PATCH 1/8] Add pathway in genomic and keep main type and subtype in clinical --- package.json | 2 +- .../app/clinical/clinical.component.html | 8 +-- src/main/webapp/app/clinical/clinical.scss | 3 + .../webapp/app/genomic/genomic.component.html | 56 ++++++++++++++----- .../webapp/app/genomic/genomic.component.ts | 19 +++++++ src/main/webapp/app/genomic/genomic.model.ts | 1 + src/main/webapp/app/genomic/genomic.scss | 8 ++- src/main/webapp/app/panel/panel.component.ts | 43 +++----------- 8 files changed, 87 insertions(+), 53 deletions(-) diff --git a/package.json b/package.json index fe3c130a..41b97869 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "uglifyjs-webpack-plugin": "1.1.5", "web-app-manifest-loader": "0.1.1", "webpack": "3.10.0", - "webpack-dev-server": "2.9.5", + "webpack-dev-server": "^3.7.2", "webpack-merge": "4.1.1", "webpack-notifier": "1.5.1", "webpack-visualizer-plugin": "0.1.11", diff --git a/src/main/webapp/app/clinical/clinical.component.html b/src/main/webapp/app/clinical/clinical.component.html index c2d7bd23..a0811871 100644 --- a/src/main/webapp/app/clinical/clinical.component.html +++ b/src/main/webapp/app/clinical/clinical.component.html @@ -32,10 +32,10 @@
@@ -80,10 +80,10 @@
diff --git a/src/main/webapp/app/clinical/clinical.scss b/src/main/webapp/app/clinical/clinical.scss index e02327b0..80804fa5 100644 --- a/src/main/webapp/app/clinical/clinical.scss +++ b/src/main/webapp/app/clinical/clinical.scss @@ -25,3 +25,6 @@ label { .collapse-margin{ margin: 10px 0px 10px 30px; } +.gender-radio { + margin-right: 5px; +} diff --git a/src/main/webapp/app/genomic/genomic.component.html b/src/main/webapp/app/genomic/genomic.component.html index 0a477147..1392b893 100644 --- a/src/main/webapp/app/genomic/genomic.component.html +++ b/src/main/webapp/app/genomic/genomic.component.html @@ -1,12 +1,20 @@
+
+
pathway:
+
+ + +
+
hugo_symbol: {{ validationMessage['gene'] }}
- +
@@ -165,13 +173,21 @@
+
+
pathway:
+
+ + +
+
hugo_symbol: {{ validationMessage['gene'] }}
- +
@@ -324,20 +340,34 @@
-
-
- -
-
- {{getDisplayContent('hugo_symbol')}} +
+
+
+ +
+
+ {{unit.genomic.pathway}} +
-
-
- +
+
+
+ +
+
+ {{getDisplayContent('hugo_symbol')}} +
-
- {{getDisplayContent('annotated_variant')}} +
+
+
+
+ +
+
+ {{getDisplayContent('annotated_variant')}} +
diff --git a/src/main/webapp/app/genomic/genomic.component.ts b/src/main/webapp/app/genomic/genomic.component.ts index caf14ec5..a40608e0 100644 --- a/src/main/webapp/app/genomic/genomic.component.ts +++ b/src/main/webapp/app/genomic/genomic.component.ts @@ -22,6 +22,7 @@ export class GenomicComponent implements OnInit { indent = 1.2; // the relative indent between the genomic content with the title operationPool: {}; genomicInput: Genomic; + originalGenomic: Genomic; variant_categorys = ['Mutation', 'Copy Number Variation', 'Structural Variation', 'Any Variation']; variant_classifications = ['In_Frame_Del', 'In_Frame_Ins', 'Missense_Mutation', 'Nonsense_Mutation', 'Nonstop_Mutation', 'Del_Ins', 'Frameshift', 'Frame_Shift_Del', 'Frame_Shift_Ins', 'Frameshift_mutation', @@ -38,6 +39,8 @@ export class GenomicComponent implements OnInit { }; geneValidation = false; exampleValidation = false; + pathwayOptions = ['A', 'B', 'C']; + disableHugoSymbol = false; search = (text$: Observable) => text$ @@ -61,6 +64,10 @@ export class GenomicComponent implements OnInit { ngOnInit() { this.trialService.genomicInputObs.subscribe((message) => { this.genomicInput = message; + this.originalGenomic = _.clone(message); + if (this.originalGenomic.pathway) { + this.disableHugoSymbol = true; + } }); this.trialService.operationPoolObs.subscribe((message) => { this.operationPool = message; @@ -116,4 +123,16 @@ export class GenomicComponent implements OnInit { unCheckRadio(key, event) { this.genomicInput[key] = MainUtil.uncheckRadio(this.genomicInput[key], event.target.value); } + changePathway() { + if (this.genomicInput.pathway) { + this.disableHugoSymbol = true; + this.genomicInput.hugo_symbol = ''; + this.validationMessage['gene'] = 'Pathway is a category of genes so specific genes aren\'t allowed.'; + } else { + this.disableHugoSymbol = false; + if (this.originalGenomic.hugo_symbol) { + this.genomicInput.hugo_symbol = this.originalGenomic.hugo_symbol; + } + } + } } diff --git a/src/main/webapp/app/genomic/genomic.model.ts b/src/main/webapp/app/genomic/genomic.model.ts index 8622ab78..f7c92151 100644 --- a/src/main/webapp/app/genomic/genomic.model.ts +++ b/src/main/webapp/app/genomic/genomic.model.ts @@ -1,5 +1,6 @@ export interface Genomic { hugo_symbol?: string, + pathway?: string, annotated_variant?: string, matching_examples?: string, germline?: string, diff --git a/src/main/webapp/app/genomic/genomic.scss b/src/main/webapp/app/genomic/genomic.scss index 69c425ff..6ac4d309 100644 --- a/src/main/webapp/app/genomic/genomic.scss +++ b/src/main/webapp/app/genomic/genomic.scss @@ -1,6 +1,9 @@ label { min-width:180px; } +input:disabled { + background-color: #cccccc; +} .selectStyle { max-width:300px; } @@ -12,6 +15,9 @@ label { margin-top: -25px; margin-left: 30px; } -.icon-margin{ +.icon-margin { margin-left: 20px; } +.germline-radio { + margin-right: 5px; +} diff --git a/src/main/webapp/app/panel/panel.component.ts b/src/main/webapp/app/panel/panel.component.ts index 4a8c2862..27007932 100644 --- a/src/main/webapp/app/panel/panel.component.ts +++ b/src/main/webapp/app/panel/panel.component.ts @@ -24,7 +24,6 @@ export class PanelComponent implements OnInit { finalPath = []; message = ''; addNode = false; - moving = false; nodeOptions: Array = ['Genomic', 'Clinical', 'And', 'Or']; nodeType = ''; selectedItems = []; @@ -41,7 +40,6 @@ export class PanelComponent implements OnInit { allSubTypesOptions = this.trialService.getAllSubTypesOptions(); subToMainMapping = this.trialService.getSubToMainMapping(); mainTypesOptions = this.trialService.getMainTypesOptions(); - statusOptions = this.trialService.getStatusOptions(); nctIdChosen: string; oncokb = MainUtil.oncokb; isPermitted = MainUtil.isPermitted; @@ -180,23 +178,8 @@ export class PanelComponent implements OnInit { }); } } - hasEmptyGenomicFields(obj: any) { - let genomicFieldsToCheck = this.oncokbGenomicFields; - if (!this.oncokb) { - genomicFieldsToCheck = _.without(this.genomicFields, 'matching_examples'); - } - for (const key of genomicFieldsToCheck) { - if (!_.isUndefined(obj[key]) && obj[key].length > 0) { - return false; - } - } - return true; - } - hasEmptyClinicalFields(obj: any) { - // Check clinical input fields - // TODO: Use clinicalFields to replace the array after we remove main_type input field - const clinicalFieldsToCheck = ['age_numerical', 'sub_type', 'main_type']; - for (const key of clinicalFieldsToCheck) { + hasEmptyFields(obj: any) { + for (const key of _.keys(obj)) { if (!_.isUndefined(obj[key]) && obj[key].length > 0) { return false; } @@ -212,12 +195,12 @@ export class PanelComponent implements OnInit { getEmptySectionNames(type: string, emptySections: Array) { switch (type) { case 'Genomic': - if (this.hasEmptyGenomicFields(this.genomicInput)) { + if (this.hasEmptyFields(this.genomicInput)) { emptySections.push('Genomic'); } break; case 'Clinical': - if (this.hasEmptyClinicalFields(this.clinicalInput)) { + if (this.hasEmptyFields(this.clinicalInput)) { emptySections.push('Clinical'); } break; @@ -374,8 +357,6 @@ export class PanelComponent implements OnInit { prepareClinicalData() { this.clinicalInput['oncotree_primary_diagnosis'] = this.getOncotree(); const clinicalToSave = _.clone(this.clinicalInput); - delete clinicalToSave['main_type']; - delete clinicalToSave['sub_type']; this.prepareSectionByField('clinical', clinicalToSave); return clinicalToSave; } @@ -385,15 +366,9 @@ export class PanelComponent implements OnInit { return genomicToSave; } prepareSectionByField(type: string, nodeData: object) { - let keysToCheck = []; - if (type === 'clinical') { - keysToCheck = this.clinicalFields; - } else if (type === 'genomic') { - keysToCheck = this.genomicFields; - } - for (const key of keysToCheck) { + for (const key of _.keys(nodeData)) { // remove empty fields - if (!_.isUndefined(nodeData[key]) && nodeData[key].length === 0) { + if (_.isUndefined(nodeData[key]) || nodeData[key] === null || nodeData[key].length === 0) { delete nodeData[key]; } // apply not logic @@ -529,7 +504,7 @@ export class PanelComponent implements OnInit { } else if (this.unit.hasOwnProperty('clinical')) { this.trialService.setClinicalInput(_.clone(this.unit['clinical'])); this.setNotLogic('clinical'); - this.setOncotree(); + // this.setOncotree(); } else if (this.unit.hasOwnProperty('arm_description')) { const armToAdd: Arm = { arm_code: this.unit['arm_code'], @@ -568,14 +543,14 @@ export class PanelComponent implements OnInit { } setNotLogic(type: string) { if (type === 'clinical') { - for (const key of this.clinicalFields) { + for (const key of _.keys(this.clinicalInput)) { if (!_.isUndefined(this.clinicalInput[key]) && this.clinicalInput[key].startsWith('!')) { this.clinicalInput['no_' + key] = true; this.clinicalInput[key] = this.clinicalInput[key].substr(1); } } } else if (type === 'genomic') { - for (const key of this.genomicFields) { + for (const key of _.keys(this.genomicInput)) { if (!_.isUndefined(this.genomicInput[key]) && this.genomicInput[key].startsWith('!')) { this.genomicInput['no_' + key] = true; this.genomicInput[key] = this.genomicInput[key].substr(1); From 0186bf025cc49707aa357894b7c8293917e640d5 Mon Sep 17 00:00:00 2001 From: jingsu Date: Fri, 6 Sep 2019 16:26:14 -0400 Subject: [PATCH 2/8] Create Geneset for genomic node --- src/main/webapp/app/genomic/geneset.model.ts | 23 +++++++++++++ .../webapp/app/genomic/genomic.component.html | 28 +++++++++------ .../webapp/app/genomic/genomic.component.ts | 34 ++++++++++++------- src/main/webapp/app/genomic/genomic.model.ts | 3 +- .../webapp/app/service/connection.service.ts | 11 ++++++ src/main/webapp/app/service/trial.service.ts | 17 ++++++++++ 6 files changed, 93 insertions(+), 23 deletions(-) create mode 100644 src/main/webapp/app/genomic/geneset.model.ts diff --git a/src/main/webapp/app/genomic/geneset.model.ts b/src/main/webapp/app/genomic/geneset.model.ts new file mode 100644 index 00000000..e9045bc6 --- /dev/null +++ b/src/main/webapp/app/genomic/geneset.model.ts @@ -0,0 +1,23 @@ +export interface Geneset { + name: string, + id: number, + genes: Gene[] +} + +export interface Gene { + entrezGeneId: number, + hugoSymbol: string, + name: string, + oncogene: boolean, + curatedIsoform: string, + curatedRefSeq: string, + geneAliases: string[], + genesets: string[], + tsg: boolean +} + +export interface GenesetOption { + name: string, + id: number, + genes: string[] +} diff --git a/src/main/webapp/app/genomic/genomic.component.html b/src/main/webapp/app/genomic/genomic.component.html index 1392b893..0e878e7c 100644 --- a/src/main/webapp/app/genomic/genomic.component.html +++ b/src/main/webapp/app/genomic/genomic.component.html @@ -1,10 +1,10 @@
-
pathway:
+
geneset:
- +
@@ -174,10 +174,10 @@
-
pathway:
+
geneset:
- +
@@ -340,17 +340,25 @@
-
+
- +
- {{unit.genomic.pathway}} + {{getGenesetById(unit.genomic.geneset_id, 'name')}} +
+
+
+
+ +
+
+ {{getGenesetById(unit.genomic.geneset_id, 'genes')}}
-
+
diff --git a/src/main/webapp/app/genomic/genomic.component.ts b/src/main/webapp/app/genomic/genomic.component.ts index a40608e0..34e6a119 100644 --- a/src/main/webapp/app/genomic/genomic.component.ts +++ b/src/main/webapp/app/genomic/genomic.component.ts @@ -7,7 +7,8 @@ import 'rxjs/add/operator/distinctUntilChanged'; import { Genomic } from './genomic.model'; import * as _ from 'lodash'; import { ConnectionService } from '../service/connection.service'; -import MainUtil from '../service/mainutil'; +import { MainutilService } from '../service/mainutil.service'; +import { Geneset } from './geneset.model'; @Component({ selector: 'jhi-genomic', @@ -22,7 +23,6 @@ export class GenomicComponent implements OnInit { indent = 1.2; // the relative indent between the genomic content with the title operationPool: {}; genomicInput: Genomic; - originalGenomic: Genomic; variant_categorys = ['Mutation', 'Copy Number Variation', 'Structural Variation', 'Any Variation']; variant_classifications = ['In_Frame_Del', 'In_Frame_Ins', 'Missense_Mutation', 'Nonsense_Mutation', 'Nonstop_Mutation', 'Del_Ins', 'Frameshift', 'Frame_Shift_Del', 'Frame_Shift_Ins', 'Frameshift_mutation', @@ -39,7 +39,7 @@ export class GenomicComponent implements OnInit { }; geneValidation = false; exampleValidation = false; - pathwayOptions = ['A', 'B', 'C']; + genesetOptions = this.trialService.getGenesetsOptions(); disableHugoSymbol = false; search = (text$: Observable) => @@ -64,8 +64,7 @@ export class GenomicComponent implements OnInit { ngOnInit() { this.trialService.genomicInputObs.subscribe((message) => { this.genomicInput = message; - this.originalGenomic = _.clone(message); - if (this.originalGenomic.pathway) { + if (this.genomicInput.geneset_id) { this.disableHugoSymbol = true; } }); @@ -123,16 +122,27 @@ export class GenomicComponent implements OnInit { unCheckRadio(key, event) { this.genomicInput[key] = MainUtil.uncheckRadio(this.genomicInput[key], event.target.value); } - changePathway() { - if (this.genomicInput.pathway) { + changeGeneset() { + if (this.genomicInput.geneset_id) { this.disableHugoSymbol = true; - this.genomicInput.hugo_symbol = ''; - this.validationMessage['gene'] = 'Pathway is a category of genes so specific genes aren\'t allowed.'; + const selectedGenesetOption = _.some(this.genesetOptions, (option) => option.id === this.genomicInput.geneset_id); + this.genomicInput.hugo_symbol = selectedGenesetOption.genes.join(', '); + this.genomicInput.geneset = selectedGenesetOption.name; + this.genomicInput.annotated_variant = 'Oncogenic Mutations'; } else { this.disableHugoSymbol = false; - if (this.originalGenomic.hugo_symbol) { - this.genomicInput.hugo_symbol = this.originalGenomic.hugo_symbol; - } + this.genomicInput.geneset = null; + this.genomicInput.hugo_symbol = ''; + this.genomicInput.annotated_variant = ''; } } + getGenesetById(id: number, key: string) { + this.connectionService.getGenesetById(id).subscribe((res: Geneset) => { + if (key === 'genes') { + const selectedGenesetOption = _.some(this.genesetOptions, (option) => option.id === id); + return selectedGenesetOption.genes.join(', '); + } + return res[key]; + }); + } } diff --git a/src/main/webapp/app/genomic/genomic.model.ts b/src/main/webapp/app/genomic/genomic.model.ts index f7c92151..e8ad59f1 100644 --- a/src/main/webapp/app/genomic/genomic.model.ts +++ b/src/main/webapp/app/genomic/genomic.model.ts @@ -1,6 +1,7 @@ export interface Genomic { hugo_symbol?: string, - pathway?: string, + geneset?: string, + geneset_id?: number, annotated_variant?: string, matching_examples?: string, germline?: string, diff --git a/src/main/webapp/app/service/connection.service.ts b/src/main/webapp/app/service/connection.service.ts index cea38fb0..cb1fff33 100644 --- a/src/main/webapp/app/service/connection.service.ts +++ b/src/main/webapp/app/service/connection.service.ts @@ -21,6 +21,8 @@ export class ConnectionService { return 'http://oncotree.mskcc.org/api/tumorTypes/search'; case 'OncoKBVariant': return 'http://oncokb.org/api/v1/variants'; + case 'Genesets': + return 'http://oncokb.org/public/api/v1/genesets'; case 'GeneValidation': return 'http://mygene.info/v3/query?species=human&q=symbol:'; case 'ClinicalTrials': @@ -38,6 +40,8 @@ export class ConnectionService { return SERVER_API_URL + 'proxy/http/oncotree.mskcc.org/api/tumorTypes/search'; case 'OncoKBVariant': return SERVER_API_URL + 'proxy/http/oncokb.org/api/v1/variants'; + case 'Genesets': + return SERVER_API_URL + 'proxy/http/oncokb.org/api/v1/genesets'; case 'GeneValidation': return SERVER_API_URL + 'proxy/http/mygene.info/v3/query?species=human&q=symbol:'; case 'ClinicalTrials': @@ -81,4 +85,11 @@ export class ConnectionService { getDrugs(query: string) { return this.http.get(this.getAPIUrl('Drugs') + `?name=${query}`); } + + getGenesets() { + return this.http.get(this.getAPIUrl('Genesets')); + } + getGenesetById(id: number) { + return this.http.get(this.getAPIUrl('Genesets') + `/${id}`); + } } diff --git a/src/main/webapp/app/service/trial.service.ts b/src/main/webapp/app/service/trial.service.ts index 5c54d0ac..7c41b071 100644 --- a/src/main/webapp/app/service/trial.service.ts +++ b/src/main/webapp/app/service/trial.service.ts @@ -13,6 +13,7 @@ import { of } from 'rxjs/observable/of'; import { catchError, map } from 'rxjs/operators'; import { AngularFireDatabase, AngularFireObject } from '@angular/fire/database'; import MainUtil from './mainutil'; +import { Gene, Geneset, GenesetOption } from '../genomic/geneset.model'; @Injectable() export class TrialService { @@ -68,6 +69,7 @@ export class TrialService { subTypesOptions = {}; allSubTypesOptions = []; + genesetsOptions: GenesetOption[] = []; subToMainMapping = {}; mainTypesOptions = ['All Solid Tumors', 'All Liquid Tumors', 'All Tumors', 'All Pediatric Tumors']; statusOptions = ['Active', 'Administratively Complete', 'Approved', 'Closed', 'Closed to Accrual', @@ -145,6 +147,18 @@ export class TrialService { this.annotated_variants[key].sort(); } }); + + // prepare genesets list + this.connectionService.getGenesets().subscribe((res: Geneset[]) => { + for (const geneset of res) { + const genesetOption: GenesetOption = { + id: geneset.id, + name: geneset.name, + genes: _.map(geneset.genes, (gene: Gene) => gene.hugoSymbol) + }; + this.genesetsOptions.push(genesetOption); + } + }); } fetchTrials() { this.trialsRef.snapshotChanges().subscribe((action) => { @@ -239,6 +253,9 @@ export class TrialService { getSubTypesOptions() { return this.subTypesOptions; } + getGenesetsOptions() { + return this.genesetsOptions; + } loadDrugsOptions(query: string) { // prepare drugs list return this.connectionService.getDrugs(query).pipe( From 5278f5ba37531e37f3c7820c0ad8cd878d161aa6 Mon Sep 17 00:00:00 2001 From: jingsu Date: Fri, 6 Sep 2019 18:04:20 -0400 Subject: [PATCH 3/8] Finish geneses --- .../webapp/app/genomic/genomic.component.html | 24 ++++++++++---- .../webapp/app/genomic/genomic.component.ts | 32 +++++++------------ 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/main/webapp/app/genomic/genomic.component.html b/src/main/webapp/app/genomic/genomic.component.html index 0e878e7c..1aa92c59 100644 --- a/src/main/webapp/app/genomic/genomic.component.html +++ b/src/main/webapp/app/genomic/genomic.component.html @@ -8,13 +8,19 @@
-
+
+
hugo_symbol:
+
+ {{selectedGenesetOption.genes.join(', ')}} +
+
+
hugo_symbol: {{ validationMessage['gene'] }}
- +
@@ -181,13 +187,19 @@
-
+
+
hugo_symbol:
+
+ {{selectedGenesetOption.genes.join(', ')}} +
+
+
hugo_symbol: {{ validationMessage['gene'] }}
- +
@@ -346,7 +358,7 @@
- {{getGenesetById(unit.genomic.geneset_id, 'name')}} + {{selectedGenesetOption.name}}
@@ -354,7 +366,7 @@
- {{getGenesetById(unit.genomic.geneset_id, 'genes')}} + {{selectedGenesetOption.genes.join(', ')}}
diff --git a/src/main/webapp/app/genomic/genomic.component.ts b/src/main/webapp/app/genomic/genomic.component.ts index 34e6a119..8faaaf7d 100644 --- a/src/main/webapp/app/genomic/genomic.component.ts +++ b/src/main/webapp/app/genomic/genomic.component.ts @@ -8,7 +8,7 @@ import { Genomic } from './genomic.model'; import * as _ from 'lodash'; import { ConnectionService } from '../service/connection.service'; import { MainutilService } from '../service/mainutil.service'; -import { Geneset } from './geneset.model'; +import { Geneset, GenesetOption } from './geneset.model'; @Component({ selector: 'jhi-genomic', @@ -40,7 +40,7 @@ export class GenomicComponent implements OnInit { geneValidation = false; exampleValidation = false; genesetOptions = this.trialService.getGenesetsOptions(); - disableHugoSymbol = false; + selectedGenesetOption: GenesetOption; search = (text$: Observable) => text$ @@ -62,11 +62,11 @@ export class GenomicComponent implements OnInit { constructor(private trialService: TrialService, public connectionService: ConnectionService) {} ngOnInit() { + if (this.unit['genomic']['geneset_id']) { + this.selectedGenesetOption = _.find(this.genesetOptions, { id: this.unit['genomic']['geneset_id'] }); + } this.trialService.genomicInputObs.subscribe((message) => { this.genomicInput = message; - if (this.genomicInput.geneset_id) { - this.disableHugoSymbol = true; - } }); this.trialService.operationPoolObs.subscribe((message) => { this.operationPool = message; @@ -124,25 +124,17 @@ export class GenomicComponent implements OnInit { } changeGeneset() { if (this.genomicInput.geneset_id) { - this.disableHugoSymbol = true; - const selectedGenesetOption = _.some(this.genesetOptions, (option) => option.id === this.genomicInput.geneset_id); - this.genomicInput.hugo_symbol = selectedGenesetOption.genes.join(', '); - this.genomicInput.geneset = selectedGenesetOption.name; - this.genomicInput.annotated_variant = 'Oncogenic Mutations'; + this.selectedGenesetOption = _.find(this.genesetOptions, { id: this.genomicInput.geneset_id }); + this.genomicInput.hugo_symbol = this.selectedGenesetOption.genes.join(', '); + this.genomicInput.geneset = this.selectedGenesetOption.name; + if (_.isEmpty(this.genomicInput.annotated_variant)) { + this.genomicInput.annotated_variant = 'Oncogenic Mutations'; + } } else { - this.disableHugoSymbol = false; this.genomicInput.geneset = null; + this.selectedGenesetOption = null; this.genomicInput.hugo_symbol = ''; this.genomicInput.annotated_variant = ''; } } - getGenesetById(id: number, key: string) { - this.connectionService.getGenesetById(id).subscribe((res: Geneset) => { - if (key === 'genes') { - const selectedGenesetOption = _.some(this.genesetOptions, (option) => option.id === id); - return selectedGenesetOption.genes.join(', '); - } - return res[key]; - }); - } } From 8808870a3acc20573e91d540b49d695e64a6ed00 Mon Sep 17 00:00:00 2001 From: jingsu Date: Mon, 9 Sep 2019 14:20:51 -0400 Subject: [PATCH 4/8] Validate type of geneset --- src/main/webapp/app/genomic/genomic.component.html | 4 ++-- src/main/webapp/app/genomic/genomic.component.ts | 5 ++++- src/main/webapp/app/panel/panel.component.ts | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/app/genomic/genomic.component.html b/src/main/webapp/app/genomic/genomic.component.html index 1aa92c59..b5e77c01 100644 --- a/src/main/webapp/app/genomic/genomic.component.html +++ b/src/main/webapp/app/genomic/genomic.component.html @@ -8,13 +8,13 @@
-
+
hugo_symbol:
{{selectedGenesetOption.genes.join(', ')}}
-
+
hugo_symbol: {{ validationMessage['gene'] }}
diff --git a/src/main/webapp/app/genomic/genomic.component.ts b/src/main/webapp/app/genomic/genomic.component.ts index 8faaaf7d..752ea3c3 100644 --- a/src/main/webapp/app/genomic/genomic.component.ts +++ b/src/main/webapp/app/genomic/genomic.component.ts @@ -41,6 +41,7 @@ export class GenomicComponent implements OnInit { exampleValidation = false; genesetOptions = this.trialService.getGenesetsOptions(); selectedGenesetOption: GenesetOption; + disableHugoSymbol = false; search = (text$: Observable) => text$ @@ -62,7 +63,7 @@ export class GenomicComponent implements OnInit { constructor(private trialService: TrialService, public connectionService: ConnectionService) {} ngOnInit() { - if (this.unit['genomic']['geneset_id']) { + if (!_.isUndefined(this.unit['genomic']) && !_.isUndefined(this.unit['genomic']['geneset_id'])) { this.selectedGenesetOption = _.find(this.genesetOptions, { id: this.unit['genomic']['geneset_id'] }); } this.trialService.genomicInputObs.subscribe((message) => { @@ -124,6 +125,7 @@ export class GenomicComponent implements OnInit { } changeGeneset() { if (this.genomicInput.geneset_id) { + this.disableHugoSymbol = true; this.selectedGenesetOption = _.find(this.genesetOptions, { id: this.genomicInput.geneset_id }); this.genomicInput.hugo_symbol = this.selectedGenesetOption.genes.join(', '); this.genomicInput.geneset = this.selectedGenesetOption.name; @@ -131,6 +133,7 @@ export class GenomicComponent implements OnInit { this.genomicInput.annotated_variant = 'Oncogenic Mutations'; } } else { + this.disableHugoSymbol = false; this.genomicInput.geneset = null; this.selectedGenesetOption = null; this.genomicInput.hugo_symbol = ''; diff --git a/src/main/webapp/app/panel/panel.component.ts b/src/main/webapp/app/panel/panel.component.ts index 27007932..4b318df6 100644 --- a/src/main/webapp/app/panel/panel.component.ts +++ b/src/main/webapp/app/panel/panel.component.ts @@ -544,14 +544,14 @@ export class PanelComponent implements OnInit { setNotLogic(type: string) { if (type === 'clinical') { for (const key of _.keys(this.clinicalInput)) { - if (!_.isUndefined(this.clinicalInput[key]) && this.clinicalInput[key].startsWith('!')) { + if (!_.isUndefined(this.clinicalInput[key]) && _.isString(this.genomicInput[key]) && this.clinicalInput[key].startsWith('!')) { this.clinicalInput['no_' + key] = true; this.clinicalInput[key] = this.clinicalInput[key].substr(1); } } } else if (type === 'genomic') { for (const key of _.keys(this.genomicInput)) { - if (!_.isUndefined(this.genomicInput[key]) && this.genomicInput[key].startsWith('!')) { + if (!_.isUndefined(this.genomicInput[key]) && _.isString(this.genomicInput[key]) && this.genomicInput[key].startsWith('!')) { this.genomicInput['no_' + key] = true; this.genomicInput[key] = this.genomicInput[key].substr(1); } From 60c87d97092d871a2929d92c3eac9cf523413175 Mon Sep 17 00:00:00 2001 From: jingsu Date: Mon, 9 Sep 2019 14:31:10 -0400 Subject: [PATCH 5/8] Change url --- src/main/webapp/app/service/connection.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/service/connection.service.ts b/src/main/webapp/app/service/connection.service.ts index cb1fff33..d9347302 100644 --- a/src/main/webapp/app/service/connection.service.ts +++ b/src/main/webapp/app/service/connection.service.ts @@ -22,7 +22,7 @@ export class ConnectionService { case 'OncoKBVariant': return 'http://oncokb.org/api/v1/variants'; case 'Genesets': - return 'http://oncokb.org/public/api/v1/genesets'; + return 'http://oncokb.org/api/v1/genesets'; case 'GeneValidation': return 'http://mygene.info/v3/query?species=human&q=symbol:'; case 'ClinicalTrials': From 32b91fb581b94e6b2e2ea7810ef3decc9d67e51b Mon Sep 17 00:00:00 2001 From: jingsu Date: Mon, 9 Sep 2019 15:12:19 -0400 Subject: [PATCH 6/8] Removed genesets in Gene model --- src/main/webapp/app/genomic/geneset.model.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/webapp/app/genomic/geneset.model.ts b/src/main/webapp/app/genomic/geneset.model.ts index e9045bc6..7eb1791e 100644 --- a/src/main/webapp/app/genomic/geneset.model.ts +++ b/src/main/webapp/app/genomic/geneset.model.ts @@ -12,7 +12,6 @@ export interface Gene { curatedIsoform: string, curatedRefSeq: string, geneAliases: string[], - genesets: string[], tsg: boolean } From af7d50ff86d7aa91da107c8966c598da8b15e3a1 Mon Sep 17 00:00:00 2001 From: jingsu Date: Mon, 9 Sep 2019 17:00:55 -0400 Subject: [PATCH 7/8] Rename sub_type to subtype --- .../webapp/app/clinical/clinical.component.html | 4 ++-- src/main/webapp/app/clinical/clinical.component.ts | 4 ++-- src/main/webapp/app/clinical/clinical.model.ts | 2 +- src/main/webapp/app/genomic/genomic.component.ts | 7 ------- src/main/webapp/app/panel/panel.component.ts | 14 ++++++++------ 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/main/webapp/app/clinical/clinical.component.html b/src/main/webapp/app/clinical/clinical.component.html index a0811871..04a2f3a3 100644 --- a/src/main/webapp/app/clinical/clinical.component.html +++ b/src/main/webapp/app/clinical/clinical.component.html @@ -21,7 +21,7 @@
-
@@ -69,7 +69,7 @@
-
diff --git a/src/main/webapp/app/clinical/clinical.component.ts b/src/main/webapp/app/clinical/clinical.component.ts index 14f7c1ac..d3ace4ca 100644 --- a/src/main/webapp/app/clinical/clinical.component.ts +++ b/src/main/webapp/app/clinical/clinical.component.ts @@ -106,13 +106,13 @@ export class ClinicalComponent implements OnInit { } onSingleSelected(option) { if (_.isUndefined(option)) { - this.clinicalInput.sub_type = ''; + this.clinicalInput.subtype = ''; } else if (option && this.clinicalInput.main_type !== this.subToMainMapping[option]) { this.clinicalInput.main_type = this.subToMainMapping[option]; } } onSingleDeselectedMaintype() { - this.clinicalInput.sub_type = ''; + this.clinicalInput.subtype = ''; this.clinicalInput.main_type = ''; } getDisplayContent(key: string) { diff --git a/src/main/webapp/app/clinical/clinical.model.ts b/src/main/webapp/app/clinical/clinical.model.ts index 5814dfdb..8da3953f 100644 --- a/src/main/webapp/app/clinical/clinical.model.ts +++ b/src/main/webapp/app/clinical/clinical.model.ts @@ -2,7 +2,7 @@ export interface Clinical { age_numerical?: string, oncotree_primary_diagnosis?: string, main_type?: string, - sub_type?: string, + subtype?: string, gender?: string, no_oncotree_primary_diagnosis?: boolean } diff --git a/src/main/webapp/app/genomic/genomic.component.ts b/src/main/webapp/app/genomic/genomic.component.ts index 752ea3c3..f073b282 100644 --- a/src/main/webapp/app/genomic/genomic.component.ts +++ b/src/main/webapp/app/genomic/genomic.component.ts @@ -41,7 +41,6 @@ export class GenomicComponent implements OnInit { exampleValidation = false; genesetOptions = this.trialService.getGenesetsOptions(); selectedGenesetOption: GenesetOption; - disableHugoSymbol = false; search = (text$: Observable) => text$ @@ -125,18 +124,12 @@ export class GenomicComponent implements OnInit { } changeGeneset() { if (this.genomicInput.geneset_id) { - this.disableHugoSymbol = true; this.selectedGenesetOption = _.find(this.genesetOptions, { id: this.genomicInput.geneset_id }); - this.genomicInput.hugo_symbol = this.selectedGenesetOption.genes.join(', '); - this.genomicInput.geneset = this.selectedGenesetOption.name; if (_.isEmpty(this.genomicInput.annotated_variant)) { this.genomicInput.annotated_variant = 'Oncogenic Mutations'; } } else { - this.disableHugoSymbol = false; - this.genomicInput.geneset = null; this.selectedGenesetOption = null; - this.genomicInput.hugo_symbol = ''; this.genomicInput.annotated_variant = ''; } } diff --git a/src/main/webapp/app/panel/panel.component.ts b/src/main/webapp/app/panel/panel.component.ts index 4b318df6..eb377a4c 100644 --- a/src/main/webapp/app/panel/panel.component.ts +++ b/src/main/webapp/app/panel/panel.component.ts @@ -347,8 +347,8 @@ export class PanelComponent implements OnInit { } getOncotree() { let oncotree_primary_diagnosis = ''; - if (this.clinicalInput.sub_type) { - oncotree_primary_diagnosis = this.clinicalInput.sub_type; + if (this.clinicalInput.subtype) { + oncotree_primary_diagnosis = this.clinicalInput.subtype; }else if (this.clinicalInput.main_type) { oncotree_primary_diagnosis = this.clinicalInput.main_type; } @@ -504,7 +504,9 @@ export class PanelComponent implements OnInit { } else if (this.unit.hasOwnProperty('clinical')) { this.trialService.setClinicalInput(_.clone(this.unit['clinical'])); this.setNotLogic('clinical'); - // this.setOncotree(); + if (_.isUndefined(this.clinicalInput.main_type) && _.isUndefined(this.clinicalInput.subtype)) { + this.setOncotree(); + } } else if (this.unit.hasOwnProperty('arm_description')) { const armToAdd: Arm = { arm_code: this.unit['arm_code'], @@ -523,12 +525,12 @@ export class PanelComponent implements OnInit { } setOncotree() { const oncotree_primary_diagnosis = this.clinicalInput['oncotree_primary_diagnosis']; - this.clinicalInput['sub_type'] = ''; + this.clinicalInput['subtype'] = ''; this.clinicalInput['main_type'] = ''; let isSubtype = false; for (const item of this.allSubTypesOptions) { if (item === oncotree_primary_diagnosis) { - this.clinicalInput['sub_type'] = oncotree_primary_diagnosis; + this.clinicalInput['subtype'] = oncotree_primary_diagnosis; this.clinicalInput['main_type'] = this.subToMainMapping[oncotree_primary_diagnosis]; isSubtype = true; } @@ -544,7 +546,7 @@ export class PanelComponent implements OnInit { setNotLogic(type: string) { if (type === 'clinical') { for (const key of _.keys(this.clinicalInput)) { - if (!_.isUndefined(this.clinicalInput[key]) && _.isString(this.genomicInput[key]) && this.clinicalInput[key].startsWith('!')) { + if (!_.isUndefined(this.clinicalInput[key]) && _.isString(this.clinicalInput[key]) && this.clinicalInput[key].startsWith('!')) { this.clinicalInput['no_' + key] = true; this.clinicalInput[key] = this.clinicalInput[key].substr(1); } From 8a7a365b380aa4ce0f7b399393c0a1b8560acc54 Mon Sep 17 00:00:00 2001 From: jingsu Date: Fri, 20 Sep 2019 13:47:19 -0400 Subject: [PATCH 8/8] Replace id by uuid --- src/main/webapp/app/genomic/geneset.model.ts | 4 ++-- src/main/webapp/app/genomic/genomic.component.html | 12 ++++++------ src/main/webapp/app/genomic/genomic.component.ts | 8 ++++---- src/main/webapp/app/genomic/genomic.model.ts | 2 +- src/main/webapp/app/panel/panel.component.ts | 2 +- src/main/webapp/app/service/connection.service.ts | 4 ++-- src/main/webapp/app/service/trial.service.ts | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/webapp/app/genomic/geneset.model.ts b/src/main/webapp/app/genomic/geneset.model.ts index 7eb1791e..102ed865 100644 --- a/src/main/webapp/app/genomic/geneset.model.ts +++ b/src/main/webapp/app/genomic/geneset.model.ts @@ -1,6 +1,6 @@ export interface Geneset { name: string, - id: number, + uuid: number, genes: Gene[] } @@ -17,6 +17,6 @@ export interface Gene { export interface GenesetOption { name: string, - id: number, + uuid: number, genes: string[] } diff --git a/src/main/webapp/app/genomic/genomic.component.html b/src/main/webapp/app/genomic/genomic.component.html index b5e77c01..f9b6c06e 100644 --- a/src/main/webapp/app/genomic/genomic.component.html +++ b/src/main/webapp/app/genomic/genomic.component.html @@ -3,7 +3,7 @@
geneset:
-
@@ -182,18 +182,18 @@
geneset:
-
-
+
hugo_symbol:
{{selectedGenesetOption.genes.join(', ')}}
-
+
hugo_symbol: {{ validationMessage['gene'] }}
@@ -352,7 +352,7 @@
-
+
@@ -370,7 +370,7 @@
-
+
diff --git a/src/main/webapp/app/genomic/genomic.component.ts b/src/main/webapp/app/genomic/genomic.component.ts index f073b282..89d6a7bf 100644 --- a/src/main/webapp/app/genomic/genomic.component.ts +++ b/src/main/webapp/app/genomic/genomic.component.ts @@ -62,8 +62,8 @@ export class GenomicComponent implements OnInit { constructor(private trialService: TrialService, public connectionService: ConnectionService) {} ngOnInit() { - if (!_.isUndefined(this.unit['genomic']) && !_.isUndefined(this.unit['genomic']['geneset_id'])) { - this.selectedGenesetOption = _.find(this.genesetOptions, { id: this.unit['genomic']['geneset_id'] }); + if (!_.isUndefined(this.unit['genomic']) && !_.isUndefined(this.unit['genomic']['geneset_uuid'])) { + this.selectedGenesetOption = _.find(this.genesetOptions, { uuid: this.unit['genomic']['geneset_uuid'] }); } this.trialService.genomicInputObs.subscribe((message) => { this.genomicInput = message; @@ -123,8 +123,8 @@ export class GenomicComponent implements OnInit { this.genomicInput[key] = MainUtil.uncheckRadio(this.genomicInput[key], event.target.value); } changeGeneset() { - if (this.genomicInput.geneset_id) { - this.selectedGenesetOption = _.find(this.genesetOptions, { id: this.genomicInput.geneset_id }); + if (this.genomicInput.geneset_uuid) { + this.selectedGenesetOption = _.find(this.genesetOptions, { uuid: this.genomicInput.geneset_uuid }); if (_.isEmpty(this.genomicInput.annotated_variant)) { this.genomicInput.annotated_variant = 'Oncogenic Mutations'; } diff --git a/src/main/webapp/app/genomic/genomic.model.ts b/src/main/webapp/app/genomic/genomic.model.ts index e8ad59f1..5798638b 100644 --- a/src/main/webapp/app/genomic/genomic.model.ts +++ b/src/main/webapp/app/genomic/genomic.model.ts @@ -1,7 +1,7 @@ export interface Genomic { hugo_symbol?: string, geneset?: string, - geneset_id?: number, + geneset_uuid?: number, annotated_variant?: string, matching_examples?: string, germline?: string, diff --git a/src/main/webapp/app/panel/panel.component.ts b/src/main/webapp/app/panel/panel.component.ts index eb377a4c..7b9d72af 100644 --- a/src/main/webapp/app/panel/panel.component.ts +++ b/src/main/webapp/app/panel/panel.component.ts @@ -180,7 +180,7 @@ export class PanelComponent implements OnInit { } hasEmptyFields(obj: any) { for (const key of _.keys(obj)) { - if (!_.isUndefined(obj[key]) && obj[key].length > 0) { + if (!_.isUndefined(obj[key]) && obj[key] && obj[key].length > 0) { return false; } } diff --git a/src/main/webapp/app/service/connection.service.ts b/src/main/webapp/app/service/connection.service.ts index d9347302..03350fc9 100644 --- a/src/main/webapp/app/service/connection.service.ts +++ b/src/main/webapp/app/service/connection.service.ts @@ -89,7 +89,7 @@ export class ConnectionService { getGenesets() { return this.http.get(this.getAPIUrl('Genesets')); } - getGenesetById(id: number) { - return this.http.get(this.getAPIUrl('Genesets') + `/${id}`); + getGenesetById(uuid: number) { + return this.http.get(this.getAPIUrl('Genesets') + `/${uuid}`); } } diff --git a/src/main/webapp/app/service/trial.service.ts b/src/main/webapp/app/service/trial.service.ts index 7c41b071..cbe80b03 100644 --- a/src/main/webapp/app/service/trial.service.ts +++ b/src/main/webapp/app/service/trial.service.ts @@ -152,7 +152,7 @@ export class TrialService { this.connectionService.getGenesets().subscribe((res: Geneset[]) => { for (const geneset of res) { const genesetOption: GenesetOption = { - id: geneset.id, + uuid: geneset.uuid, name: geneset.name, genes: _.map(geneset.genes, (gene: Gene) => gene.hugoSymbol) };