@@ -18,17 +18,30 @@ angular.module('oncokbStaticApp')
18
18
titleStyleClass : 'level-1' ,
19
19
description : 'FDA-approved' ,
20
20
treatments : [ ] ,
21
+ treatmentsBlackList : [ ] ,
21
22
numOfGenes : 0 ,
22
- numOfVariants : 0
23
+ numOfAlterations : 0
23
24
} ,
24
25
{
25
26
key : 'two' ,
26
27
title : '2' ,
27
28
titleStyleClass : 'level-2A' ,
28
29
description : 'Standard care' ,
29
30
treatments : [ ] ,
31
+ treatmentsBlackList : [
32
+ 'KIT-D816A, D816E, D816F, D816G, D816H, D816N, D816V, D816Y-Melanoma-Imatinib' ,
33
+ 'KIT-D816A, D816E, D816F, D816G, D816H, D816N, D816V, D816Y-Thymic Tumor-Sunitinib, Sorafenib' ,
34
+ 'KIT-D816-Melanoma-Imatinib' ,
35
+ 'KIT-D816-Thymic Tumor-Sunitinib, Sorafenib' ,
36
+ 'KIT-Exon 17 mutations-Melanoma-Imatinib' ,
37
+ 'KIT-Exon 17 mutations-Thymic Tumor-Sunitinib, Sorafenib' ,
38
+ 'KIT-T670I-Melanoma-Imatinib' ,
39
+ 'KIT-T670I-Thymic Tumor-Sunitinib, Sorafenib' ,
40
+ 'KIT-V654A-Melanoma-Imatinib' ,
41
+ 'KIT-V654A-Thymic Tumor-Sunitinib, Sorafenib'
42
+ ] ,
30
43
numOfGenes : 0 ,
31
- numOfVariants : 0
44
+ numOfAlterations : 0
32
45
} ,
33
46
{
34
47
key : 'three' ,
@@ -37,7 +50,7 @@ angular.module('oncokbStaticApp')
37
50
description : 'Clinical evidence' ,
38
51
treatments : [ ] ,
39
52
numOfGenes : 0 ,
40
- numOfVariants : 0
53
+ numOfAlterations : 0
41
54
} ,
42
55
{
43
56
key : 'four' ,
@@ -46,7 +59,7 @@ angular.module('oncokbStaticApp')
46
59
description : 'Biological evidence' ,
47
60
treatments : [ ] ,
48
61
numOfGenes : 0 ,
49
- numOfVariants : 0
62
+ numOfAlterations : 0
50
63
} ,
51
64
{
52
65
key : 'r1' ,
@@ -55,7 +68,7 @@ angular.module('oncokbStaticApp')
55
68
description : 'Standard care resistance' ,
56
69
treatments : [ ] ,
57
70
numOfGenes : 0 ,
58
- numOfVariants : 0
71
+ numOfAlterations : 0
59
72
}
60
73
]
61
74
} ;
@@ -79,15 +92,9 @@ angular.module('oncokbStaticApp')
79
92
hasBootstrap : true ,
80
93
columnDefs : [
81
94
{ responsivePriority : 1 , targets : 0 , width : '10%' } ,
82
- { responsivePriority : 2 , targets : 1 , width : '25 %' } ,
95
+ { responsivePriority : 2 , targets : 1 , width : '35 %' } ,
83
96
{ responsivePriority : 3 , targets : 2 , width : '25%' } ,
84
- { responsivePriority : 4 , targets : 3 , width : '20%' } ,
85
- {
86
- responsivePriority : 5 ,
87
- targets : 4 ,
88
- width : '20%' ,
89
- type : 'num-html'
90
- }
97
+ { responsivePriority : 4 , targets : 3 , width : '30%' }
91
98
] ,
92
99
aaSorting : [ [ 0 , 'asc' ] , [ 1 , 'asc' ] , [ 2 , 'asc' ] , [ 3 , 'asc' ] ] ,
93
100
responsive : {
@@ -97,10 +104,10 @@ angular.module('oncokbStaticApp')
97
104
renderer : function ( api , rowIdx , columns ) {
98
105
var data = $ . map ( columns , function ( col ) {
99
106
return col . hidden ?
100
- '<tr data-dt-row="' + col . rowIndex + '" data-dt-column="' + col . columnIndex + '">' +
101
- '<td>' + col . title + ':</td> ' +
102
- '<td>' + col . data + '</td>' +
103
- '</tr>' :
107
+ '<tr data-dt-row="' + col . rowIndex + '" data-dt-column="' + col . columnIndex + '">' +
108
+ '<td>' + col . title + ':</td> ' +
109
+ '<td>' + col . data + '</td>' +
110
+ '</tr>' :
104
111
'' ;
105
112
} ) . join ( '' ) ;
106
113
@@ -115,17 +122,16 @@ angular.module('oncokbStaticApp')
115
122
DTColumnDefBuilder . newColumnDef ( 0 ) ,
116
123
DTColumnDefBuilder . newColumnDef ( 1 ) ,
117
124
DTColumnDefBuilder . newColumnDef ( 2 ) ,
118
- DTColumnDefBuilder . newColumnDef ( 3 ) ,
119
- DTColumnDefBuilder . newColumnDef ( 4 )
125
+ DTColumnDefBuilder . newColumnDef ( 3 )
120
126
] ;
121
127
122
128
$scope . clickGene = function ( gene ) {
123
129
$location . path ( '/gene/' + gene ) ;
124
130
} ;
125
131
126
- $scope . getVariantsLink = function ( gene , variants ) {
127
- return _ . map ( variants . split ( ',' ) , function ( variant ) {
128
- return utils . getVariantCellContent ( gene , variant ) ;
132
+ $scope . getAlterationsLink = function ( gene , alterations ) {
133
+ return _ . map ( alterations . split ( ',' ) , function ( alteration ) {
134
+ return utils . getAlterationCellContent ( gene , alteration ) ;
129
135
} ) . join ( ', ' ) ;
130
136
} ;
131
137
@@ -165,24 +171,22 @@ angular.module('oncokbStaticApp')
165
171
try {
166
172
var treatments = getTreatments ( result . data [ 0 ] ) ;
167
173
var genes = { } ;
168
- var variants = { } ;
174
+ var alterations = { } ;
169
175
_ . each ( treatments , function ( treatment ) {
170
176
if ( treatment . gene ) {
171
177
genes [ treatment . gene ] = true ;
172
178
}
173
- if ( _ . isArray ( treatment . alterations ) ) {
174
- _ . each ( treatment . alterations , function ( alt ) {
175
- var id = treatment . gene + '-' + alt ;
176
- variants [ id ] = true ;
177
- } ) ;
178
- }
179
+ _ . each ( treatment . alterations . split ( ',' ) , function ( alt ) {
180
+ var id = treatment . gene + '-' + alt . trim ( ) ;
181
+ alterations [ id ] = true ;
182
+ } ) ;
179
183
} ) ;
180
184
181
185
var _levelData = getLevelInDataByKey ( level . variable ) ;
182
186
if ( _levelData ) {
183
- _levelData . treatments = treatments ;
187
+ _levelData . treatments = mergeTreatments ( treatments , _levelData . treatmentsBlackList ) ;
184
188
_levelData . numOfGenes = Object . keys ( genes ) . length ;
185
- _levelData . numOfVariants = Object . keys ( variants ) . length ;
189
+ _levelData . numOfAlterations = Object . keys ( alterations ) . length ;
186
190
}
187
191
$scope . status . loading . level [ level . loadingStatus ] = false ;
188
192
} catch ( error ) {
@@ -206,33 +210,63 @@ angular.module('oncokbStaticApp')
206
210
_ . each ( metadata , function ( item ) {
207
211
var treatment = {
208
212
gene : item . gene . hugoSymbol || 'NA' ,
209
- variants : item . alterations . map ( function ( alt ) {
210
- return alt . name ? alt . name : alt . alteration ;
211
- } ) . sort ( ) . join ( ', ' ) || 'NA' ,
212
213
alterations : item . alterations . map ( function ( alt ) {
213
214
return alt . name ? alt . name : alt . alteration ;
214
- } ) . sort ( ) ,
215
+ } ) . sort ( ) . join ( ', ' ) || 'NA' ,
215
216
disease : utils . getCancerTypeNameFromOncoTreeType ( item . oncoTreeType ) ,
216
217
drugs : item . treatments . map ( function ( treatment ) {
217
218
return treatment . drugs . map ( function ( drug ) {
218
219
return drug . drugName ;
219
220
} ) . sort ( ) . join ( '+' ) ;
220
- } ) . sort ( ) . join ( ', ' ) ,
221
- articles : item . articles
221
+ } ) . sort ( ) . join ( ', ' )
222
222
} ;
223
-
224
- treatment . pmids = _ . map ( _ . uniq ( _ . filter ( item . articles , function ( article ) {
225
- return ! isNaN ( article . pmid ) ;
226
- } ) ) , function ( item ) {
227
- return item . pmid ;
228
- } ) . sort ( ) ;
229
- treatment . abstracts = _ . uniq ( _ . filter ( item . articles , function ( article ) {
230
- return _ . isString ( article . abstract ) ;
231
- } ) ) . sort ( ) ;
232
223
treatments . push ( treatment ) ;
233
224
} ) ;
234
225
}
235
226
return treatments ;
236
227
}
228
+
229
+ function mergeTreatments ( treatments , treatmentsBlackList ) {
230
+ var map = { } ;
231
+ var mergedTreatments = [ ] ;
232
+ _ . each ( treatments , function ( treatment ) {
233
+ var _key = treatment . gene + treatment . alterations + treatment . disease ;
234
+
235
+ if ( ! map . hasOwnProperty ( _key ) ) {
236
+ map [ _key ] = [ ] ;
237
+ }
238
+ map [ _key ] . push ( treatment ) ;
239
+ } ) ;
240
+ _ . each ( map , function ( treatments ) {
241
+ var _treatment = treatments [ 0 ] ;
242
+ _treatment . drugs = treatments . map ( function ( t ) {
243
+ return t . drugs ;
244
+ } ) . join ( ', ' ) ;
245
+ var _treatmentsBlackList = treatmentsBlackList || [ ] ;
246
+ var _key = [ _treatment . gene , _treatment . alterations , _treatment . disease , _treatment . drugs ] . join ( '-' ) ;
247
+ if ( _treatmentsBlackList . indexOf ( _key ) == - 1 ) {
248
+ mergedTreatments . push ( _treatment ) ;
249
+ }
250
+ } ) ;
251
+
252
+ map = { } ;
253
+ _ . each ( mergedTreatments , function ( treatment ) {
254
+ var _key = treatment . gene + treatment . disease + treatment . drugs ;
255
+
256
+ if ( ! map . hasOwnProperty ( _key ) ) {
257
+ map [ _key ] = [ ] ;
258
+ }
259
+ map [ _key ] . push ( treatment ) ;
260
+ } ) ;
261
+ mergedTreatments = [ ] ;
262
+ _ . each ( map , function ( treatments ) {
263
+ var _treatment = treatments [ 0 ] ;
264
+ _treatment . alterations = treatments . map ( function ( t ) {
265
+ return t . alterations ;
266
+ } ) . join ( ', ' ) ;
267
+ mergedTreatments . push ( _treatment ) ;
268
+ } ) ;
269
+ return mergedTreatments ;
270
+ }
237
271
} ) ;
238
272
0 commit comments