Skip to content

Commit 7f98813

Browse files
authored
Merge pull request #209 from oncokb/rc
Merge rc to master
2 parents 0010b02 + 08d9970 commit 7f98813

31 files changed

+5645
-276
lines changed

Gruntfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ module.exports = function(grunt) {
6565
// The actual grunt server settings
6666
connect: {
6767
options: {
68-
port: 9000,
68+
port: 9010,
6969
// Change this to '0.0.0.0' to access the server from outside.
7070
hostname: 'localhost',
71-
livereload: 35729
71+
livereload: 35739
7272
},
7373
livereload: {
7474
options: {

app/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@
124124
</div>
125125
</div>
126126
<div class="subNavWrapper"
127-
ng-class="{'sub-nav-block': view.currentPage === 'gene' || view.currentPage === 'variant'}">
127+
ng-class="{'sub-nav-block': view.currentPage === 'gene' || view.currentPage === 'alteration'}">
128128
<div class="container">
129129
<div class="subNav">
130130
<!-- In order to use last child css style, add div wrapper -->
131131
<div ng-show="view.subNavItems.length > 0"
132132
class="pull-left col-md-9 col-lg-9 col-sm-12 col-xs-12 subNav-sxn-1">
133133
<span ng-repeat="item in view.subNavItems" class="item">
134134
<span ng-if="!item.link">{{item.content}}</span>
135-
<a ng-if="item.link" ng-href="{{item.link}}" target="_self" uib-tooltip-placement="top" uib-tooltip="All Variants">{{item.content}}</a>
135+
<a ng-if="item.link" ng-href="{{item.link}}" target="_self" uib-tooltip-placement="top" uib-tooltip="All Alterations">{{item.content}}</a>
136136
</span>
137137
</div>
138138

app/scripts/app.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ angular
5757
controller: 'GenesCtrl',
5858
controllerAs: 'genes'
5959
})
60-
.when('/gene/:geneName/variant/:variantName', {
60+
.when('/gene/:geneName/alteration/:alterationName', {
6161
templateUrl: 'views/gene.html',
6262
controller: 'GeneCtrl',
6363
controllerAs: 'gene'
6464
})
65+
.when('/gene/:geneName/variant/:alterationName', {
66+
redirectTo: '/gene/:geneName/alteration/:alterationName'
67+
})
6568
.when('/about', {
6669
templateUrl: 'views/about.html',
6770
controller: 'AboutCtrl',
@@ -142,8 +145,8 @@ angular.module('oncokbStaticApp').run(
142145
}, {content: '3855 Variants'}, {content: '60 Tumor Types'}]
143146
};
144147
$rootScope.data = {
145-
lastUpdate: 'July 17, 2018',
146-
version: '1.14_patch_1',
148+
lastUpdate: 'August 20, 2018',
149+
version: '1.15',
147150
levelColors: {
148151
'1': '#33A02C',
149152
'2A': '#1F78B4',
@@ -196,8 +199,8 @@ angular.module('oncokbStaticApp').run(
196199
});
197200
$rootScope.$on('$routeChangeSuccess', function() {
198201
var path = $location.path().split('/') || [];
199-
if (path.length === 5 && path[3] === 'variant') {
200-
$rootScope.view.currentPage = 'variant';
202+
if (path.length === 5 && path[3] === 'alteration') {
203+
$rootScope.view.currentPage = 'alteration';
201204
} else {
202205
$rootScope.view.currentPage = path.length > 2 ? path[1] : '';
203206
}

app/scripts/controllers/actionalGenes.js

+80-46
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,30 @@ angular.module('oncokbStaticApp')
1818
titleStyleClass: 'level-1',
1919
description: 'FDA-approved',
2020
treatments: [],
21+
treatmentsBlackList: [],
2122
numOfGenes: 0,
22-
numOfVariants: 0
23+
numOfAlterations: 0
2324
},
2425
{
2526
key: 'two',
2627
title: '2',
2728
titleStyleClass: 'level-2A',
2829
description: 'Standard care',
2930
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+
],
3043
numOfGenes: 0,
31-
numOfVariants: 0
44+
numOfAlterations: 0
3245
},
3346
{
3447
key: 'three',
@@ -37,7 +50,7 @@ angular.module('oncokbStaticApp')
3750
description: 'Clinical evidence',
3851
treatments: [],
3952
numOfGenes: 0,
40-
numOfVariants: 0
53+
numOfAlterations: 0
4154
},
4255
{
4356
key: 'four',
@@ -46,7 +59,7 @@ angular.module('oncokbStaticApp')
4659
description: 'Biological evidence',
4760
treatments: [],
4861
numOfGenes: 0,
49-
numOfVariants: 0
62+
numOfAlterations: 0
5063
},
5164
{
5265
key: 'r1',
@@ -55,7 +68,7 @@ angular.module('oncokbStaticApp')
5568
description: 'Standard care resistance',
5669
treatments: [],
5770
numOfGenes: 0,
58-
numOfVariants: 0
71+
numOfAlterations: 0
5972
}
6073
]
6174
};
@@ -79,15 +92,9 @@ angular.module('oncokbStaticApp')
7992
hasBootstrap: true,
8093
columnDefs: [
8194
{responsivePriority: 1, targets: 0, width: '10%'},
82-
{responsivePriority: 2, targets: 1, width: '25%'},
95+
{responsivePriority: 2, targets: 1, width: '35%'},
8396
{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%'}
9198
],
9299
aaSorting: [[0, 'asc'], [1, 'asc'], [2, 'asc'], [3, 'asc']],
93100
responsive: {
@@ -97,10 +104,10 @@ angular.module('oncokbStaticApp')
97104
renderer: function(api, rowIdx, columns) {
98105
var data = $.map(columns, function(col) {
99106
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>' :
104111
'';
105112
}).join('');
106113

@@ -115,17 +122,16 @@ angular.module('oncokbStaticApp')
115122
DTColumnDefBuilder.newColumnDef(0),
116123
DTColumnDefBuilder.newColumnDef(1),
117124
DTColumnDefBuilder.newColumnDef(2),
118-
DTColumnDefBuilder.newColumnDef(3),
119-
DTColumnDefBuilder.newColumnDef(4)
125+
DTColumnDefBuilder.newColumnDef(3)
120126
];
121127

122128
$scope.clickGene = function(gene) {
123129
$location.path('/gene/' + gene);
124130
};
125131

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);
129135
}).join(', ');
130136
};
131137

@@ -165,24 +171,22 @@ angular.module('oncokbStaticApp')
165171
try {
166172
var treatments = getTreatments(result.data[0]);
167173
var genes = {};
168-
var variants = {};
174+
var alterations = {};
169175
_.each(treatments, function(treatment) {
170176
if (treatment.gene) {
171177
genes[treatment.gene] = true;
172178
}
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+
});
179183
});
180184

181185
var _levelData = getLevelInDataByKey(level.variable);
182186
if (_levelData) {
183-
_levelData.treatments = treatments;
187+
_levelData.treatments = mergeTreatments(treatments, _levelData.treatmentsBlackList);
184188
_levelData.numOfGenes = Object.keys(genes).length;
185-
_levelData.numOfVariants = Object.keys(variants).length;
189+
_levelData.numOfAlterations = Object.keys(alterations).length;
186190
}
187191
$scope.status.loading.level[level.loadingStatus] = false;
188192
} catch (error) {
@@ -206,33 +210,63 @@ angular.module('oncokbStaticApp')
206210
_.each(metadata, function(item) {
207211
var treatment = {
208212
gene: item.gene.hugoSymbol || 'NA',
209-
variants: item.alterations.map(function(alt) {
210-
return alt.name ? alt.name : alt.alteration;
211-
}).sort().join(', ') || 'NA',
212213
alterations: item.alterations.map(function(alt) {
213214
return alt.name ? alt.name : alt.alteration;
214-
}).sort(),
215+
}).sort().join(', ') || 'NA',
215216
disease: utils.getCancerTypeNameFromOncoTreeType(item.oncoTreeType),
216217
drugs: item.treatments.map(function(treatment) {
217218
return treatment.drugs.map(function(drug) {
218219
return drug.drugName;
219220
}).sort().join('+');
220-
}).sort().join(', '),
221-
articles: item.articles
221+
}).sort().join(', ')
222222
};
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();
232223
treatments.push(treatment);
233224
});
234225
}
235226
return treatments;
236227
}
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+
}
237271
});
238272

0 commit comments

Comments
 (0)