Skip to content

Commit 65e4431

Browse files
authored
Merge pull request #271 from oncokb/rc
May Release
2 parents 77a9b9f + 8540939 commit 65e4431

16 files changed

+437
-194
lines changed

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ module.exports = function(grunt) {
313313
options: {
314314
collapseWhitespace: true,
315315
conservativeCollapse: true,
316-
collapseBooleanAttributes: true,
316+
collapseBooleanAttributes: false,
317317
removeCommentsFromCDATA: true,
318318
removeOptionalTags: true
319319
},

app/index.html

+28-20
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!doctype html>
22
<html class="no-js">
33
<head>
4-
<base href="/" />
4+
<base href="/"/>
55
<meta charset="utf-8">
66
<title>OncoKB</title>
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width">
99
<script src="https://browser.sentry-cdn.com/4.5.3/bundle.min.js" crossorigin="anonymous"></script>
1010
<script>
11-
Sentry.init({ dsn: 'https://[email protected]/1382470' });
11+
Sentry.init({dsn: 'https://[email protected]/1382470'});
1212
</script>
1313
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
1414
<!-- build:css(.) styles/vendor.css -->
@@ -21,6 +21,8 @@
2121
<!-- endbower -->
2222
<!-- endbuild -->
2323

24+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/bundles/ng-table.min.css"/>
25+
2426
<!-- build:css styles/mutationMapper.css -->
2527
<link rel="stylesheet" href="lib/mutation-mapper/css/jquery-ui-1.10.3.custom.css"/>
2628
<link rel="stylesheet" href="lib/mutation-mapper/css/mutationMapper.css"/>
@@ -88,32 +90,37 @@
8890
<ul class="nav navbar-nav">
8991
<li ng-click="toggled=false" ng-class="{ active: isActive('/levels')}"><a data-toggle="collapse"
9092
data-target=".in"
91-
href="levels"><span>Levels of Evidence</span></a>
93+
href="levels"><span>Levels of
94+
Evidence</span></a>
9295
</li>
9396
<li ng-click="toggled=false" ng-class="{ active: isActive('/actionableGenes')}"><a
94-
data-toggle="collapse" data-target=".in" href="actionableGenes"><span>Actionable Genes</span></a>
97+
data-toggle="collapse" data-target=".in"
98+
href="actionableGenes"><span><span>Actionable Genes</span></span></a>
9599
</li>
100+
<li ng-click="toggled=false" ng-class="{ active: isActive('/cancerGenes')}"><a href="cancerGenes"
101+
data-toggle="collapse"
102+
data-target=".in"><span>Cancer
103+
Genes</span></a></li>
96104
<li ng-click="toggled=false" ng-class="{ active: isActive('/dataAccess')}"><a data-toggle="collapse"
97105
data-target=".in"
98-
href="dataAccess"><span>Data Access</span></a>
106+
href="dataAccess"><span>Data
107+
Access</span></a>
108+
</li>
109+
<li ng-click="toggled=false" ng-class="{ active: isActive('/about')}"><a href="about"
110+
data-toggle="collapse"
111+
data-target=".in"><span>About</span></a>
112+
</li>
113+
<li ng-click="toggled=false" ng-class="{ active: isActive('/team')}"><a data-toggle="collapse"
114+
data-target=".in"
115+
href="team"><span>Team</span></a>
99116
</li>
100117
<li ng-click="toggled=false" ng-class="{ active: isActive('/news')}"><a data-toggle="collapse"
101-
data-target=".in"
102-
href="news"><span>News</span></a>
118+
data-target=".in"
119+
href="news"><span>News</span></a>
103120
</li>
104121
<li ng-click="toggled=false" ng-class="{ active: isActive('/terms')}"><a data-toggle="collapse"
105122
data-target=".in"
106-
href="terms"><span>Usage Terms</span></a>
107-
</li>
108-
<li class="dropdown">
109-
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
110-
aria-haspopup="true"
111-
aria-expanded="false"><span>More <div class="caret"></div></span></a>
112-
<ul class="dropdown-menu">
113-
<li><a href="cancerGenes">OncoKB Cancer Gene List</a></li>
114-
<li><a href="about">About</a></li>
115-
<li><a href="team">Team</a></li>
116-
</ul>
123+
href="terms"><span>Terms</span></a>
117124
</li>
118125
</li>
119126
<li ng-class="{hidden: toggled}" class="nav-search-li" style="float: right">
@@ -122,9 +129,9 @@
122129
</ul>
123130
<div class="pull-right" ng-class="{hidden: toggled}">
124131
<span><a href="https://mskcc.org"><img class="mskcc-logo"
125-
src="resources/images/MSKLogo_fff.png"/></a></span>
132+
src="resources/images/MSKLogo_fff.png"/></a></span>
126133
<span><a href="https://mskcc.org"><img class="mskcc-icon"
127-
src="resources/images/MSKIcon_fff.png"/></a></span>
134+
src="resources/images/MSKIcon_fff.png"/></a></span>
128135
</div>
129136
</div>
130137
</div>
@@ -275,6 +282,7 @@
275282
<script src="scripts/directives/search-box.js"></script>
276283
<script src="scripts/directives/search-icon.js"></script>
277284
<!-- endbuild -->
285+
<script src="https://unpkg.com/[email protected]/bundles/ng-table.min.js"></script>
278286
</body>
279287
</html>
280288

app/scripts/app.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ angular
2121
'datatables',
2222
'datatables.bootstrap',
2323
'ui.bootstrap',
24+
'ngTable',
2425
'swaggerUi'
2526
])
2627
.constant('_', window._)
@@ -133,6 +134,7 @@ angular
133134
angular.module('oncokbStaticApp').run(
134135
function($timeout, $rootScope, $location, _, api, swaggerModules, markedSwagger, $window) {
135136
$rootScope.meta = {
137+
clinicalTableSearchKeyWord: '',
136138
levelsDesc: {
137139
'1': 'FDA-recognized biomarker predictive of response to an FDA-approved drug in this indication',
138140
'2A': 'Standard of care biomarker predictive of response to an FDA-approved drug in this indication',
@@ -172,8 +174,8 @@ angular.module('oncokbStaticApp').run(
172174
}, {content: '4472 Variants'}, {content: '38 Tumor Types'}]
173175
};
174176
$rootScope.data = {
175-
lastUpdate: 'February 28, 2019',
176-
version: '1.19_patch_1',
177+
lastUpdate: 'May 9, 2019',
178+
version: '1.20',
177179
levelColors: {
178180
'1': '#33A02C',
179181
'2A': '#1F78B4',

app/scripts/controllers/cancerGenes.js

+48-60
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,8 @@
1111
* Controller of the oncokbStaticApp
1212
*/
1313
angular.module('oncokbStaticApp')
14-
.controller('CancerGenesCtrl', function($scope, _, api, $q, apiLink) {
15-
// DataTable initialization & options
16-
$scope.dt = {};
17-
$scope.dt.dtOptions = {
18-
paging: true,
19-
hasBootstrap: true,
20-
language: {
21-
loadingRecords: '<img src="resources/images/loader.gif">'
22-
},
23-
pageLength: 15,
24-
lengthMenu: [[15, 30, 50, 100, -1], [15, 30, 50, 100, 'All']],
25-
pagingType: 'numbers',
26-
aaSorting: [[9, 'desc'], [0, 'asc'], [1, 'desc']],
27-
columns: [
28-
{type: 'html', orderSequence: ['asc', 'desc']},
29-
{type: 'html', orderSequence: ['desc', 'asc']},
30-
{type: 'string', orderSequence: ['desc', 'asc']},
31-
{type: 'string', orderSequence: ['desc', 'asc']},
32-
{type: 'string', orderSequence: ['desc', 'asc']},
33-
{type: 'string', orderSequence: ['desc', 'asc']},
34-
{type: 'string', orderSequence: ['desc', 'asc']},
35-
{type: 'string', orderSequence: ['desc', 'asc']},
36-
{type: 'string', orderSequence: ['desc', 'asc']},
37-
{type: 'number', orderSequence: ['desc', 'asc']}
38-
],
39-
responsive: true
40-
};
14+
.controller('CancerGenesCtrl', function($rootScope, $scope, _, api, $q, apiLink, NgTableParams) {
15+
4116

4217
function displayConvert(obj, keys) {
4318
_.each(keys, function(key) {
@@ -46,46 +21,59 @@ angular.module('oncokbStaticApp')
4621
return obj;
4722
}
4823

49-
$scope.fetchedDate = '05/30/2017';
50-
$scope.doneLoading = false;
51-
$scope.columnOrder = ['mSKImpact', 'mSKHeme', 'foundation', 'foundationHeme', 'vogelstein', 'sangerCGC'];
24+
$scope.fetchedDate = '05/07/2019';
25+
$scope.sources = ['oncokbAnnotated', 'foundation', 'foundationHeme', 'mSKImpact', 'mSKHeme', 'vogelstein', 'sangerCGC'];
26+
$scope.numOfGenes = _.reduce($scope.sources, function(acc, next) {
27+
acc[next] = 0;
28+
return acc;
29+
}, {total: 0});
5230

53-
$q.all([api.getGenes(), api.getCancerGeneList()]).then(function(result) {
54-
var geneTypeMapping = {};
55-
_.each(result[0].data, function(gene) {
56-
if (gene.oncogene) {
57-
if (gene.tsg) {
58-
geneTypeMapping[gene.hugoSymbol] = 'Both';
31+
$scope.doneLoading = true;
32+
33+
$scope.data = {
34+
searchTerm: '',
35+
lastUpdate: $rootScope.data.lastUpdate
36+
};
37+
38+
function getNgTable(data) {
39+
return new NgTableParams({
40+
sorting: {occurrenceCount: 'desc', hugoSymbol: 'asc', oncokbAnnotated: 'desc'},
41+
count: 15
42+
}, {
43+
counts: [15, 30, 50, 100],
44+
dataset: data
45+
});
46+
}
47+
48+
$scope.updateSearchTerm = function() {
49+
$scope.tableParams.filter({$: $scope.data.searchTerm});
50+
};
51+
52+
api.getCancerGeneList().then(function(result) {
53+
var tempData = result.data;
54+
_.each(tempData, function(item) {
55+
item = displayConvert(item, $scope.sources);
56+
if (item.oncogene) {
57+
if (item.tsg) {
58+
item.geneType = 'Oncogene/TSG';
5959
} else {
60-
geneTypeMapping[gene.hugoSymbol] = 'Oncogene';
60+
item.geneType = 'Oncogene';
6161
}
62-
} else if (gene.tsg) {
63-
geneTypeMapping[gene.hugoSymbol] = 'TSG';
62+
} else if (item.tsg) {
63+
item.geneType = 'TSG';
6464
}
6565
});
66-
var tempData = result[1].data;
67-
_.each(tempData, function(item) {
68-
item = displayConvert(item, ['oncokbAnnotated', 'foundation', 'foundationHeme', 'mSKImpact', 'mSKHeme', 'vogelstein', 'sangerCGC']);
69-
switch (geneTypeMapping[item.hugoSymbol]) {
70-
case 'Oncogene':
71-
item.oncogene = 'Yes';
72-
break;
73-
case 'TSG':
74-
item.tsg = 'Yes';
75-
break;
76-
case 'Both':
77-
item.oncogene = 'Yes';
78-
item.tsg = 'Yes';
79-
break;
80-
default:
81-
break;
82-
}
66+
_.each($scope.sources, function(key) {
67+
$scope.numOfGenes[key] = _.filter(tempData, function(item) {
68+
return item[key] === 'Yes';
69+
}).length;
8370
});
84-
$scope.cancerGeneList = tempData;
85-
$scope.doneLoading = true;
71+
$scope.tableParams = getNgTable(tempData);
72+
$scope.numOfGenes.total = tempData.length;
73+
$scope.doneLoading = false;
8674
}, function(error) {
87-
$scope.cancerGeneList = [];
88-
$scope.doneLoading = true;
75+
$scope.tableParams = getNgTable([]);
76+
$scope.doneLoading = false;
8977
});
9078
$scope.apiLink = apiLink;
9179
});

app/scripts/controllers/gene.js

+7
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,13 @@ angular.module('oncokbStaticApp')
736736
}
737737
}
738738
};
739+
740+
$scope.clinicalTableInstanceCallback = function(dtInstance) {
741+
if($rootScope.meta.clinicalTableSearchKeyWord) {
742+
dtInstance.DataTable.search($rootScope.meta.clinicalTableSearchKeyWord).draw();
743+
$rootScope.meta.clinicalTableSearchKeyWord = '';
744+
}
745+
};
739746
$scope.view.biologicalTableOptions = {
740747
hasBootstrap: true,
741748
aoColumns: [

app/scripts/controllers/main.js

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ angular.module('oncokbStaticApp')
1313
return viewLocation === $location.path();
1414
};
1515

16+
$scope.searchConfirmedEvent = function(record) {
17+
if(record.drug) {
18+
$rootScope.meta.clinicalTableSearchKeyWord = record.drug.drugName;
19+
}
20+
};
21+
1622
$scope.tabs = {
1723
apiSummary: {
1824
name: 'Summary',

app/scripts/controllers/news.js

+12
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ angular.module('oncokbStaticApp')
147147
'the FDA approved lorlatinib</a> for patients with anaplastic lymphoma kinase (ALK)-positive metastatic non-small cell lung cancer (NSCLC) whose disease has progressed on crizotinib and at least one other ALK inhibitor or whose disease has progressed on alectinib or ceritinib for metastatic disease.'
148148
]
149149
},
150+
'05092019': {
151+
'Level 1': [
152+
'April 12, 2019: <a target="_blank" ' +
153+
'href="https://www.fda.gov/drugs/resources-information-approved-drugs/fda-grants-accelerated-approval-erdafitinib-metastatic-urothelial-carcinoma">' +
154+
'the FDA approved erdafitinib</a> for patients with locally advanced or metastatic urothelial carcinoma, with susceptible FGFR3 or FGFR2 genetic alterations (FGFR2 Fusions, FGFR3 Fusions or FGFR3 R248C, S249C, G370C, Y373C mutations), that has progressed during or following platinum-containing chemotherapy.'
155+
],
156+
'Level 4': [
157+
'MET - Fusions - All Tumors - Crizotinib (<b>new association</b>)',
158+
'CDK12 - Truncating Mutations - All Tumors - Pembrolizumab, Nivolumab, Cemiplimab (<b>new association</b>)',
159+
],
160+
},
150161
};
151162
$scope.data.newlyAddedLevelFour = [
152163
{
@@ -234,5 +245,6 @@ angular.module('oncokbStaticApp')
234245
'10262018': ['NT5C2','P2RY8','PCBP1','PDS5B','PTPN1','PTPN2 ','STAG1','TRAF3','TRAF5'],
235246
'12142018': ['KSR2','LCK','LTB','MGAM','MOB3B','MPEG1','NCOR2','PIGA','PLCG1','POT1','ROBO1','RUNX1T1','SAMHD1','SETD1A','SGK1','SMC1A','SMC3','SMG1','SP140','STAT6','TBL1XR1','UBR5','VAV1','VAV2','XBP1'],
236247
'01242019': ['ECT2L','RELN','TAL1','MLLT10','TLX3','TLX1','TRA','TRB','TRD','TRG','EPOR','ABL2','MECOM','DEK','RBM15','BCL9'],
248+
'05092019': ['ATF1','CCNB3','CMTR2','CREB1','CTR9','CXORF67','DDIT3','ETAA1','ETV5','FEV','FLI1','IL3','KAT6A','KBTBD4','KLF2','LMO2','LZTR1','MAF','MAFB','NR4A3','NRG1','NUP98','PDGFB','PGBD5','PHF6','PRKACA','SETBP1','SLFN11','SPRTN','SS18','TCL1A','TCL1B','TFE3','TRIP13','USP8','YY1','ZNRF3'],
237249
};
238250
});

app/scripts/directives/search-box.js

+17-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ angular.module('oncokbStaticApp')
1414
scope: {
1515
searchConfirmedEvent: '='
1616
},
17-
link: function postLink(scope, element, attrs) {
17+
link: function postLink(scope) {
18+
function getAllVariantsName(variants) {
19+
return variants ? variants.map(function(variant) {
20+
return variant.name;
21+
}).join(', ') : '';
22+
}
23+
24+
function getAllTumorTypesName(tumorTypes) {
25+
return tumorTypes ? tumorTypes.map(function(tumorType) {
26+
return tumorType.name ? tumorType.name : (tumorType.mainType ? tumorType.mainType.name : '');
27+
}).join(', ') : '';
28+
}
1829
scope.content = {
1930
selectedGene: '',
2031
loadingSearchResult: false
@@ -23,11 +34,11 @@ angular.module('oncokbStaticApp')
2334
scope.searchConfirmed = function() {
2435
if (scope.content.selectedItem) {
2536
var link = scope.content.selectedItem.link;
26-
scope.content.selectedItem = undefined;
27-
$location.path(link);
2837
if (angular.isFunction(scope.searchConfirmedEvent)) {
29-
scope.searchConfirmedEvent();
38+
scope.searchConfirmedEvent(scope.content.selectedItem);
3039
}
40+
$location.path(link);
41+
scope.content.selectedItem = undefined;
3142
}
3243
};
3344

@@ -45,6 +56,8 @@ angular.module('oncokbStaticApp')
4556
if (item.highestResistanceLevel) {
4657
item.highestResistanceLevel = item.highestResistanceLevel.replace('LEVEL_', '');
4758
}
59+
item.variantsName = getAllVariantsName(item.variants);
60+
item.tumorTypesName = getAllTumorTypesName(item.tumorTypes);
4861
});
4962
return result;
5063
}, function() {

app/styles/_layout.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
}
154154
}
155155

156-
@media (max-width: 1025px) {
156+
@media (max-width: 1120px) {
157157
.navbar-nav {
158158
width: calc(100% - 165px);
159159
}
@@ -165,14 +165,14 @@
165165
}
166166
}
167167

168-
@media (max-width: 960px) and (min-width: $range-min-sm-width) {
168+
@media (max-width: 1050px) and (min-width: $range-min-sm-width) {
169169
.navbar-nav > li > a, .search-icon .search-icon-rect {
170170
padding: 15px 0px;
171171
}
172172
.navbar-nav > li > a > span {
173173
padding: 0 5px;
174174
}
175-
.navbar-nav > li:not(:nth-child(6)) > a > span {
175+
.navbar-nav > li:not(:nth-child(8)) > a > span {
176176
border-right: 1px solid $darker-blue;
177177
}
178178
}
@@ -186,7 +186,7 @@
186186
}
187187
}
188188

189-
@media (max-width: $range-max-width) and (min-width: 1025px) {
189+
@media (max-width: $range-max-width) and (min-width: 1120px) {
190190
.navbar-nav {
191191
width: calc(100% - 165px - 63px);
192192
}

0 commit comments

Comments
 (0)