react-mutation-mapper 0.8.20 → 0.8.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/lollipopMutationPlot/LollipopMutationPlot.d.ts +1 -0
- package/dist/component/mutationMapper/MutationMapper.d.ts +1 -0
- package/dist/component/track/TrackItem.d.ts +2 -1
- package/dist/component/track/TrackPanel.d.ts +1 -0
- package/dist/component/track/TrackSelector.d.ts +6 -1
- package/dist/component/track/UniprotTopologyTrack.d.ts +38 -0
- package/dist/index.es.js +412 -106
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +412 -105
- package/dist/index.js.map +1 -1
- package/dist/model/MutationMapperDataFetcher.d.ts +1 -1
- package/dist/model/MutationMapperStore.d.ts +2 -1
- package/dist/store/DefaultMutationMapperDataFetcher.d.ts +1 -1
- package/dist/store/DefaultMutationMapperStore.d.ts +2 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ___default, { isEmpty, reduce, uniq, map, groupBy, keys } from 'lodash';
|
|
2
2
|
import { makeObservable, observable, action, computed, reaction } from 'mobx';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import React__default, { createElement, Component, useState, Fragment } from 'react';
|
|
5
5
|
import { DefaultTooltip, TruncatedText, getNCBIlink, trimOffHtmlTagEntities, cachePostMethodsOnClient, CanonicalMutationType, MutationTumorTypeFrequencyTable, FREQUENCY_COLUMNS_DEFINITION, FrequencyTableColumnEnum, CheckedSelect, getSelectedValuesMap, Checklist, MUT_COLOR_MISSENSE, MUT_COLOR_MISSENSE_PASSENGER, MUT_COLOR_INFRAME, MUT_COLOR_INFRAME_PASSENGER, MUT_COLOR_TRUNC, MUT_COLOR_TRUNC_PASSENGER, MUT_COLOR_SPLICE, MUT_COLOR_SPLICE_PASSENGER, STRUCTURAL_VARIANT_COLOR, STRUCTURAL_VARIANT_PASSENGER_COLOR, MUT_COLOR_OTHER, getCanonicalMutationType, getProteinImpactTypeFromCanonical, ProteinImpactType, getProteinImpactType, resolveColumnVisibility, resolveColumnVisibilityByColumnDefinition, longestCommonStartingSubstring, getTextWidth, unhoverAllComponents, SVGAxis, getComponentIndex, initHitZoneFromConfig, defaultHitzoneConfig, EditableSpan, DownloadControls, EllipsisTextTooltip, remoteData, WindowWrapper } from 'cbioportal-frontend-commons';
|
|
6
|
-
import { CIVIC_NA_VALUE, generateQueryVariantId, parseMyCancerGenomeLink, OncoKbCardDataType, defaultArraySortMethod, defaultSortMethod, LEVELS, uniqueGenomicLocations, indexAnnotationsByGenomicLocation, getCivicEntry, getRemoteDataGroupStatus, getMyCancerGenomeLinks, isLinearClusterHotspot, is3dHotspot, calculateOncoKbAvailableDataType, getVariantAnnotation, getDbsnpRsId, getMyVariantInfoAnnotation, generateHgvsgByMutation, calcProteinChangeSortValue, extendMutations, formatNumberValueInSignificantDigits, generateTumorTypeDecomposition, formatPercentValue, countMutationsByProteinChange, numberOfLeadingDecimalZeros, filterLinearClusterHotspotsByMutations, filter3dHotspotsByMutations, isHotspot, defaultHotspotFilter, defaultStringArraySortMethod, extractExonInformation, formatExonLocation, compareByPtmTypePriority, ptmColor, PtmSource, PTM_SOURCE_URL, getMyVariantInfoAnnotationsFromIndexedVariantAnnotations, generateProteinChangeQuery, StructuralVariantType, generateAnnotateStructuralVariantQuery, getMutationsByTranscriptId, groupMutationsByProteinStartPos, groupHotspotsByMutations, getMyCancerGenomeData, convertUniprotFeatureToPtm, convertDbPtmToPtm, indexHotspotsData, genomicLocationString, groupPtmDataByPosition, groupPtmDataByTypeAndPosition, groupCancerHotspotDataByPosition, fetchCivicGenes, fetchCivicVariants } from 'cbioportal-utils';
|
|
6
|
+
import { CIVIC_NA_VALUE, generateQueryVariantId, parseMyCancerGenomeLink, OncoKbCardDataType, defaultArraySortMethod, defaultSortMethod, LEVELS, uniqueGenomicLocations, indexAnnotationsByGenomicLocation, getCivicEntry, getRemoteDataGroupStatus, getMyCancerGenomeLinks, isLinearClusterHotspot, is3dHotspot, calculateOncoKbAvailableDataType, getVariantAnnotation, getDbsnpRsId, getMyVariantInfoAnnotation, generateHgvsgByMutation, calcProteinChangeSortValue, extendMutations, formatNumberValueInSignificantDigits, generateTumorTypeDecomposition, formatPercentValue, countMutationsByProteinChange, numberOfLeadingDecimalZeros, filterLinearClusterHotspotsByMutations, filter3dHotspotsByMutations, isHotspot, defaultHotspotFilter, defaultStringArraySortMethod, extractExonInformation, formatExonLocation, compareByPtmTypePriority, ptmColor, UniprotTopologyTypeToTitle, UniprotTopologyTrackToColor, PtmSource, PTM_SOURCE_URL, getMyVariantInfoAnnotationsFromIndexedVariantAnnotations, generateProteinChangeQuery, StructuralVariantType, generateAnnotateStructuralVariantQuery, getMutationsByTranscriptId, groupMutationsByProteinStartPos, groupHotspotsByMutations, getMyCancerGenomeData, convertUniprotFeatureToPtm, convertDbPtmToPtm, indexHotspotsData, genomicLocationString, UniprotCategory, convertUniprotFeatureToUniprotTopology, groupPtmDataByPosition, groupPtmDataByTypeAndPosition, groupCancerHotspotDataByPosition, fetchCivicGenes, fetchCivicVariants } from 'cbioportal-utils';
|
|
7
7
|
import classnames from 'classnames';
|
|
8
8
|
import autobind from 'autobind-decorator';
|
|
9
9
|
import { Collapse } from 'react-collapse';
|
|
@@ -142,7 +142,7 @@ var CivicCard = /** @class */ (function (_super) {
|
|
|
142
142
|
writable: true,
|
|
143
143
|
value: function (variantMap) {
|
|
144
144
|
var list = [];
|
|
145
|
-
if (
|
|
145
|
+
if (___default.isEmpty(variantMap)) {
|
|
146
146
|
list.push(this.variantItem('_naVariant_'));
|
|
147
147
|
}
|
|
148
148
|
else {
|
|
@@ -247,10 +247,10 @@ function download(civicEntry) {
|
|
|
247
247
|
if (!civicEntry) {
|
|
248
248
|
return CIVIC_NA_VALUE;
|
|
249
249
|
}
|
|
250
|
-
var variants =
|
|
250
|
+
var variants = ___default.values(civicEntry.variants);
|
|
251
251
|
var values = [];
|
|
252
252
|
if (variants && variants.length > 0 && variants[0].evidenceCounts) {
|
|
253
|
-
|
|
253
|
+
___default.forEach(variants[0].evidenceCounts, function (value, key) {
|
|
254
254
|
values.push(key + ": " + value);
|
|
255
255
|
});
|
|
256
256
|
}
|
|
@@ -445,12 +445,12 @@ function mergeAlterations(alterations) {
|
|
|
445
445
|
var positions = {};
|
|
446
446
|
var regular = [];
|
|
447
447
|
var regExp = new RegExp('^([A-Z])([0-9]+)([A-Z]$)');
|
|
448
|
-
if (
|
|
448
|
+
if (___default.isString(alterations)) {
|
|
449
449
|
return alterations;
|
|
450
450
|
}
|
|
451
|
-
|
|
451
|
+
___default.each(alterations, function (alteration) {
|
|
452
452
|
var result = regExp.exec(alteration);
|
|
453
|
-
if (
|
|
453
|
+
if (___default.isArray(result) && result.length === 4) {
|
|
454
454
|
if (!positions.hasOwnProperty(result[2])) {
|
|
455
455
|
positions[result[2]] = {};
|
|
456
456
|
}
|
|
@@ -464,15 +464,15 @@ function mergeAlterations(alterations) {
|
|
|
464
464
|
regular.push(alteration);
|
|
465
465
|
}
|
|
466
466
|
});
|
|
467
|
-
|
|
467
|
+
___default.each(___default.keys(positions)
|
|
468
468
|
.map(function (e) {
|
|
469
469
|
return Number(e);
|
|
470
470
|
})
|
|
471
471
|
.sort(), function (position) {
|
|
472
|
-
|
|
472
|
+
___default.each(___default.keys(positions[position]).sort(), function (aa) {
|
|
473
473
|
regular.push(aa +
|
|
474
474
|
position +
|
|
475
|
-
|
|
475
|
+
___default.keys(positions[position][aa])
|
|
476
476
|
.sort()
|
|
477
477
|
.join('/'));
|
|
478
478
|
});
|
|
@@ -491,7 +491,7 @@ function getPositionalVariant(alteration) {
|
|
|
491
491
|
// result[1]: reference alleles (there could be multiple reference alleles, we only return the first allele)
|
|
492
492
|
// result[2]: position(protein start/end)
|
|
493
493
|
// result[3]: variant alleles (empty if the alteration is positional variant already)
|
|
494
|
-
if (
|
|
494
|
+
if (___default.isArray(result) &&
|
|
495
495
|
result.length === 4 &&
|
|
496
496
|
(!result[3] || result[1].length === result[3].length)) {
|
|
497
497
|
return "" + result[1][0] + result[2];
|
|
@@ -514,7 +514,7 @@ function getTumorTypeName(tumorType) {
|
|
|
514
514
|
}
|
|
515
515
|
function groupOncoKbIndicatorDataByMutations(mutationsByPosition, oncoKbData, getTumorType, getEntrezGeneId, filter) {
|
|
516
516
|
var indicatorMap = {};
|
|
517
|
-
|
|
517
|
+
___default.keys(mutationsByPosition).forEach(function (key) {
|
|
518
518
|
var position = Number(key);
|
|
519
519
|
var indicators = mutationsByPosition[position]
|
|
520
520
|
.map(function (mutation) {
|
|
@@ -569,7 +569,7 @@ function download$1(links) {
|
|
|
569
569
|
}
|
|
570
570
|
function myCancerGenomeLinks(linksHTML) {
|
|
571
571
|
var links = [];
|
|
572
|
-
|
|
572
|
+
___default.each(linksHTML, function (link, index) {
|
|
573
573
|
// TODO this is a workaround, ideally we should fix the data itself
|
|
574
574
|
// parse the data as an HTML dom element, since it is formatted as an HTML link.
|
|
575
575
|
var myCancerGenomeLink = parseMyCancerGenomeLink(link);
|
|
@@ -781,11 +781,11 @@ var OncoKbHelper = /** @class */ (function () {
|
|
|
781
781
|
switch (dataType) {
|
|
782
782
|
case OncoKbCardDataType.TXS:
|
|
783
783
|
case OncoKbCardDataType.TXR:
|
|
784
|
-
return
|
|
784
|
+
return ___default.pick(this.LEVEL_DESC, this.TX_LEVELS);
|
|
785
785
|
case OncoKbCardDataType.DX:
|
|
786
|
-
return
|
|
786
|
+
return ___default.pick(this.LEVEL_DESC, this.DX_LEVELS);
|
|
787
787
|
case OncoKbCardDataType.PX:
|
|
788
|
-
return
|
|
788
|
+
return ___default.pick(this.LEVEL_DESC, this.PX_LEVELS);
|
|
789
789
|
default:
|
|
790
790
|
return {};
|
|
791
791
|
}
|
|
@@ -927,7 +927,7 @@ var OncoKbHelper = /** @class */ (function () {
|
|
|
927
927
|
var content = createElement("span", null, mergedAlteration);
|
|
928
928
|
if (alterations.length > 5) {
|
|
929
929
|
var lowerCasedQueryVariant_1 = variant.toLowerCase();
|
|
930
|
-
var matchedAlteration =
|
|
930
|
+
var matchedAlteration = ___default.find(alterations, function (alteration) {
|
|
931
931
|
return alteration.toLocaleLowerCase() === lowerCasedQueryVariant_1;
|
|
932
932
|
});
|
|
933
933
|
if (!matchedAlteration) {
|
|
@@ -1012,7 +1012,7 @@ var ReferenceList = /** @class */ (function (_super) {
|
|
|
1012
1012
|
get: function () {
|
|
1013
1013
|
var _this = this;
|
|
1014
1014
|
if (this.props.pmidData && this.props.pmids) {
|
|
1015
|
-
var loadingItems =
|
|
1015
|
+
var loadingItems = ___default.filter(this.props.pmids, function (uid) {
|
|
1016
1016
|
var cacheData = _this.props.pmidData[uid.toString()];
|
|
1017
1017
|
// when the cacheData is undefined, the pmidData will fetch the uid info later which eventually results to an object with a status
|
|
1018
1018
|
return !cacheData || cacheData.status === 'pending';
|
|
@@ -1041,7 +1041,7 @@ var ReferenceList = /** @class */ (function (_super) {
|
|
|
1041
1041
|
var cacheData = _this.props.pmidData[uid.toString()];
|
|
1042
1042
|
var articleContent = cacheData ? cacheData.data : null;
|
|
1043
1043
|
if (articleContent) {
|
|
1044
|
-
list.push(createElement(PmidItem, { title: articleContent.title, author:
|
|
1044
|
+
list.push(createElement(PmidItem, { title: articleContent.title, author: ___default.isArray(articleContent.authors) &&
|
|
1045
1045
|
articleContent.authors.length > 0
|
|
1046
1046
|
? articleContent.authors[0].name + ' et al.'
|
|
1047
1047
|
: 'Unknown', source: articleContent.source, date: new Date(articleContent.pubdate)
|
|
@@ -1510,7 +1510,7 @@ var OncoKbTooltip = /** @class */ (function (_super) {
|
|
|
1510
1510
|
allPmids_1 = allPmids_1.concat(implication.pmids);
|
|
1511
1511
|
});
|
|
1512
1512
|
}
|
|
1513
|
-
for (var _i = 0, _a =
|
|
1513
|
+
for (var _i = 0, _a = ___default.uniq(allPmids_1).map(function (pmid) { return Number(pmid); }); _i < _a.length; _i++) {
|
|
1514
1514
|
var ref = _a[_i];
|
|
1515
1515
|
this.props.pubMedCache.get(ref);
|
|
1516
1516
|
}
|
|
@@ -1628,14 +1628,14 @@ function sortValue$2(indicator) {
|
|
|
1628
1628
|
return values;
|
|
1629
1629
|
}
|
|
1630
1630
|
function download$2(indicator) {
|
|
1631
|
+
var _a, _b;
|
|
1631
1632
|
if (!indicator) {
|
|
1632
1633
|
return 'NA';
|
|
1633
1634
|
}
|
|
1634
1635
|
var oncogenic = indicator.oncogenic ? indicator.oncogenic : 'Unknown';
|
|
1635
|
-
var
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
return oncogenic + ", " + level;
|
|
1636
|
+
var sensitivityLevel = ((_a = indicator.highestSensitiveLevel) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || 'level NA';
|
|
1637
|
+
var resistanceLevel = ((_b = indicator.highestResistanceLevel) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || 'resistance NA';
|
|
1638
|
+
return oncogenic + ", " + sensitivityLevel + ", " + resistanceLevel;
|
|
1639
1639
|
}
|
|
1640
1640
|
var OncoKB = /** @class */ (function (_super) {
|
|
1641
1641
|
__extends(OncoKB, _super);
|
|
@@ -1893,7 +1893,7 @@ var ONCOKB_DEFAULT_INFO = {
|
|
|
1893
1893
|
};
|
|
1894
1894
|
var DEFAULT_GENOME_NEXUS_CLIENT = initGenomeNexusClient();
|
|
1895
1895
|
function getUrl(urlTemplate, templateVariables) {
|
|
1896
|
-
return
|
|
1896
|
+
return ___default.template(urlTemplate)(templateVariables);
|
|
1897
1897
|
}
|
|
1898
1898
|
function fetchVariantAnnotationsByMutation(mutations, fields, isoformOverrideSource, client) {
|
|
1899
1899
|
if (fields === void 0) { fields = ['annotation_summary']; }
|
|
@@ -2010,7 +2010,7 @@ function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGen
|
|
|
2010
2010
|
var isOncoKbCancerGene = false;
|
|
2011
2011
|
if (oncoKbCancerGenes && !(oncoKbCancerGenes.result instanceof Error)) {
|
|
2012
2012
|
oncoKbGeneExist =
|
|
2013
|
-
|
|
2013
|
+
___default.find(oncoKbCancerGenes.result, function (gene) {
|
|
2014
2014
|
return (mutation.mutationType &&
|
|
2015
2015
|
mutation.mutationType.toLowerCase() ===
|
|
2016
2016
|
CanonicalMutationType.FUSION) ||
|
|
@@ -2018,7 +2018,7 @@ function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGen
|
|
|
2018
2018
|
gene.entrezGeneId === entrezGeneId_1);
|
|
2019
2019
|
}) !== undefined;
|
|
2020
2020
|
isOncoKbCancerGene =
|
|
2021
|
-
|
|
2021
|
+
___default.find(oncoKbCancerGenes.result, function (gene) { return gene.entrezGeneId === entrezGeneId_1; }) !== undefined;
|
|
2022
2022
|
}
|
|
2023
2023
|
value = {
|
|
2024
2024
|
hugoGeneSymbol: hugoGeneSymbol,
|
|
@@ -2072,7 +2072,7 @@ function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGen
|
|
|
2072
2072
|
!(oncoKbData.result instanceof Error) &&
|
|
2073
2073
|
oncoKbData.status === 'complete') {
|
|
2074
2074
|
oncoKbIndicator = getIndicatorData(mutation, oncoKbData.result, resolveTumorType, resolveEntrezGeneId);
|
|
2075
|
-
oncoKbAvailableDataTypes =
|
|
2075
|
+
oncoKbAvailableDataTypes = ___default.uniq(__spreadArrays(oncoKbAvailableDataTypes, calculateOncoKbAvailableDataType(___default.values(oncoKbData.result.indicatorMap))));
|
|
2076
2076
|
}
|
|
2077
2077
|
value = __assign(__assign({}, value), { oncoKbStatus: oncoKbData ? oncoKbData.status : 'pending', oncoKbIndicator: oncoKbIndicator,
|
|
2078
2078
|
oncoKbAvailableDataTypes: oncoKbAvailableDataTypes });
|
|
@@ -2096,7 +2096,7 @@ function annotationSortMethod(a, b) {
|
|
|
2096
2096
|
return defaultArraySortMethod(sortValue$4(a), sortValue$4(b));
|
|
2097
2097
|
}
|
|
2098
2098
|
function sortValue$4(annotation) {
|
|
2099
|
-
return
|
|
2099
|
+
return ___default.flatten([
|
|
2100
2100
|
sortValue$2(annotation.oncoKbIndicator),
|
|
2101
2101
|
sortValue(annotation.civicEntry),
|
|
2102
2102
|
sortValue$1(annotation.myCancerGenomeLinks),
|
|
@@ -2402,7 +2402,7 @@ function getGnomadDataSortedByFrequency(myVariantInfo) {
|
|
|
2402
2402
|
}
|
|
2403
2403
|
function sortGnomadDataByFrequency(gnomadData) {
|
|
2404
2404
|
// sort by frequency
|
|
2405
|
-
var sorted =
|
|
2405
|
+
var sorted = ___default.sortBy(Object.values(gnomadData).slice(0, 8), [
|
|
2406
2406
|
'alleleFrequency',
|
|
2407
2407
|
]).reverse();
|
|
2408
2408
|
// add the total row at the bottom
|
|
@@ -3329,10 +3329,10 @@ function calculateBadgeAlignmentStyles(options, numberOfColumnsPerRow, uniformBa
|
|
|
3329
3329
|
var iterationCount = options.length;
|
|
3330
3330
|
var maxLength = Math.max.apply(Math, getOptionContentLengths(options));
|
|
3331
3331
|
var badgeWidth_1 = calculateBadgeAlignmentStyle(maxLength, maxLength, badgeCharWidth, badgeContentPadding, true);
|
|
3332
|
-
return
|
|
3332
|
+
return ___default.times(iterationCount, function () { return badgeWidth_1; });
|
|
3333
3333
|
}
|
|
3334
3334
|
else if (numberOfColumnsPerRow > 0) {
|
|
3335
|
-
var groupedByCol_1 =
|
|
3335
|
+
var groupedByCol_1 = ___default.groupBy(options, function (option) { return options.indexOf(option) % numberOfColumnsPerRow; });
|
|
3336
3336
|
return options.map(function (option, index) {
|
|
3337
3337
|
// define a max badge length for each column
|
|
3338
3338
|
var maxLengthInCol = Math.max.apply(Math, getOptionContentLengths(groupedByCol_1[index % numberOfColumnsPerRow]));
|
|
@@ -3512,7 +3512,7 @@ function getColorForProteinImpactType(mutations, colors, getMutationCount, isPut
|
|
|
3512
3512
|
};
|
|
3513
3513
|
counts[key].count += pMut.count;
|
|
3514
3514
|
}
|
|
3515
|
-
var sortedMutations =
|
|
3515
|
+
var sortedMutations = ___default.sortBy(___default.values(counts), [
|
|
3516
3516
|
function (pMut) { return (pMut.isPutativeDriver ? 0 : 1); },
|
|
3517
3517
|
function (// putative driver preferred non putative driver
|
|
3518
3518
|
pMut) { return -pMut.count; },
|
|
@@ -3918,7 +3918,7 @@ function updatePositionSelectionFilters(dataStore, position, isMultiSelect, defa
|
|
|
3918
3918
|
selectedPositions = findAllUniquePositions(dataStore.selectionFilters);
|
|
3919
3919
|
// remove current position if already selected
|
|
3920
3920
|
if (currentlySelected) {
|
|
3921
|
-
selectedPositions =
|
|
3921
|
+
selectedPositions = ___default.without(selectedPositions, position);
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
3924
3924
|
// add current position into list if not selected
|
|
@@ -3955,7 +3955,7 @@ function updatePositionRangeHighlightFilters(dataStore, startPosition, endPositi
|
|
|
3955
3955
|
updatePositionHighlightFilters(dataStore, positions, defaultFilters);
|
|
3956
3956
|
}
|
|
3957
3957
|
function findAllUniquePositions(filters) {
|
|
3958
|
-
return
|
|
3958
|
+
return ___default.uniq(___default.flatten(filters
|
|
3959
3959
|
// pick only position filters
|
|
3960
3960
|
.filter(function (f) { return f.type === DataFilterType.POSITION; })
|
|
3961
3961
|
// we need to spread f.values, since it might be an observable mobx array
|
|
@@ -3963,7 +3963,7 @@ function findAllUniquePositions(filters) {
|
|
|
3963
3963
|
.map(function (f) { return __spreadArrays(f.values); })));
|
|
3964
3964
|
}
|
|
3965
3965
|
function indexPositions(filters) {
|
|
3966
|
-
return
|
|
3966
|
+
return ___default.keyBy(findAllUniquePositions(filters).map(function (p) { return ({ position: p }); }), 'position');
|
|
3967
3967
|
}
|
|
3968
3968
|
function includesSearchTextIgnoreCase(value, searchText) {
|
|
3969
3969
|
return (searchText &&
|
|
@@ -3976,7 +3976,7 @@ function findNonTextInputFilters(dataFilters) {
|
|
|
3976
3976
|
return dataFilters.filter(function (f) { return f.id !== TEXT_INPUT_FILTER_ID; });
|
|
3977
3977
|
}
|
|
3978
3978
|
function findOneMutationFilterValue(filter) {
|
|
3979
|
-
return filter.values.length > 0 ?
|
|
3979
|
+
return filter.values.length > 0 ? ___default.values(filter.values[0])[0] : undefined;
|
|
3980
3980
|
}
|
|
3981
3981
|
function applyDefaultPositionFilter(filter, mutation) {
|
|
3982
3982
|
// const positions: {[position: string]: {position: number}} = indexPositions([filter]);
|
|
@@ -3988,7 +3988,7 @@ function applyDefaultProteinImpactTypeFilter(filter, mutation) {
|
|
|
3988
3988
|
}
|
|
3989
3989
|
function applyDefaultMutationStatusFilter(filter, mutation) {
|
|
3990
3990
|
return (mutation.mutationStatus !== undefined &&
|
|
3991
|
-
|
|
3991
|
+
___default.some(filter.values, function (value) {
|
|
3992
3992
|
return value.toLowerCase() === mutation.mutationStatus.toLowerCase();
|
|
3993
3993
|
}));
|
|
3994
3994
|
}
|
|
@@ -4012,7 +4012,7 @@ function groupDataByGroupFilters(groupFilters, sortedFilteredData, applyFilter)
|
|
|
4012
4012
|
group: groupFilter.group,
|
|
4013
4013
|
data: sortedFilteredData.filter(
|
|
4014
4014
|
// TODO simplify array flatten if possible
|
|
4015
|
-
function (m) { return applyFilter(groupFilter.filter,
|
|
4015
|
+
function (m) { return applyFilter(groupFilter.filter, ___default.flatten([m])[0]); }),
|
|
4016
4016
|
}); });
|
|
4017
4017
|
}
|
|
4018
4018
|
function groupDataByProteinImpactType(sortedFilteredData) {
|
|
@@ -4024,7 +4024,7 @@ function groupDataByProteinImpactType(sortedFilteredData) {
|
|
|
4024
4024
|
},
|
|
4025
4025
|
}); });
|
|
4026
4026
|
var groupedData = groupDataByGroupFilters(filters, sortedFilteredData, applyDefaultProteinImpactTypeFilter);
|
|
4027
|
-
return
|
|
4027
|
+
return ___default.keyBy(groupedData, function (d) { return d.group; });
|
|
4028
4028
|
}
|
|
4029
4029
|
function onFilterOptionSelect(selectedValues, allValuesSelected, dataStore, dataFilterType, dataFilterId) {
|
|
4030
4030
|
// all other filters except the current filter with the given data filter id
|
|
@@ -4126,7 +4126,7 @@ var DataTableToolbar = /** @class */ (function (_super) {
|
|
|
4126
4126
|
createElement(ColumnSelector, __assign({ columnVisibility: this.props.columnVisibility, onColumnToggled: this.props.visibilityToggle }, this.props.columnSelectorProps)))),
|
|
4127
4127
|
this.props.showSearchBox && (createElement("div", { className: "small", style: { width: 200, marginLeft: this.searchBoxMargin } },
|
|
4128
4128
|
createElement(SearchBox, { placeholder: this.props.searchPlaceHolder, onChange: this.props.onSearch
|
|
4129
|
-
?
|
|
4129
|
+
? ___default.debounce(this.props.onSearch, this.props.searchDelay)
|
|
4130
4130
|
: this.props.onSearch, filterInputRef: this.props.filterInputRef })))));
|
|
4131
4131
|
}
|
|
4132
4132
|
});
|
|
@@ -4153,7 +4153,7 @@ var ColumnSortDirection;
|
|
|
4153
4153
|
})(ColumnSortDirection || (ColumnSortDirection = {}));
|
|
4154
4154
|
function getInitialSortDataStatus(initialSortRemoteData) {
|
|
4155
4155
|
return initialSortRemoteData
|
|
4156
|
-
? getRemoteDataGroupStatus.apply(void 0,
|
|
4156
|
+
? getRemoteDataGroupStatus.apply(void 0, ___default.compact(initialSortRemoteData)) : 'complete';
|
|
4157
4157
|
}
|
|
4158
4158
|
function getColumnVisibilityDef(columns, columnVisibility) {
|
|
4159
4159
|
var colVisProp = [];
|
|
@@ -4891,7 +4891,7 @@ function mergeColumns(defaultColumns, customColumns) {
|
|
|
4891
4891
|
overrides.push(colOverride);
|
|
4892
4892
|
}
|
|
4893
4893
|
});
|
|
4894
|
-
return __spreadArrays(merged,
|
|
4894
|
+
return __spreadArrays(merged, ___default.difference(customColumns, overrides));
|
|
4895
4895
|
}
|
|
4896
4896
|
|
|
4897
4897
|
var DefaultMutationTableComponent = /** @class */ (function (_super) {
|
|
@@ -4925,7 +4925,7 @@ var DefaultMutationTable = /** @class */ (function (_super) {
|
|
|
4925
4925
|
});
|
|
4926
4926
|
Object.defineProperty(DefaultMutationTable.prototype, "annotationColumnDataStatus", {
|
|
4927
4927
|
get: function () {
|
|
4928
|
-
return getRemoteDataGroupStatus.apply(void 0,
|
|
4928
|
+
return getRemoteDataGroupStatus.apply(void 0, ___default.compact(this.annotationColumnData));
|
|
4929
4929
|
},
|
|
4930
4930
|
enumerable: false,
|
|
4931
4931
|
configurable: true
|
|
@@ -5672,6 +5672,7 @@ var TrackName;
|
|
|
5672
5672
|
TrackName["dbPTM"] = "DB_PTM";
|
|
5673
5673
|
TrackName["UniprotPTM"] = "UNIPROT_PTM";
|
|
5674
5674
|
TrackName["Exon"] = "EXON";
|
|
5675
|
+
TrackName["UniprotTopology"] = "UNIPROT_TOPOLOGY";
|
|
5675
5676
|
})(TrackName || (TrackName = {}));
|
|
5676
5677
|
var TrackSelector = /** @class */ (function (_super) {
|
|
5677
5678
|
__extends(TrackSelector, _super);
|
|
@@ -5741,6 +5742,13 @@ var TrackSelector = /** @class */ (function (_super) {
|
|
|
5741
5742
|
this.isPending(TrackName.Exon) && this.loaderIcon())),
|
|
5742
5743
|
value: TrackName.Exon,
|
|
5743
5744
|
},
|
|
5745
|
+
_a[TrackName.UniprotTopology] = {
|
|
5746
|
+
label: (createElement("span", null,
|
|
5747
|
+
"Uniprot Topology",
|
|
5748
|
+
this.isPending(TrackName.UniprotTopology) &&
|
|
5749
|
+
this.loaderIcon())),
|
|
5750
|
+
value: TrackName.UniprotTopology,
|
|
5751
|
+
},
|
|
5744
5752
|
_a;
|
|
5745
5753
|
},
|
|
5746
5754
|
enumerable: false,
|
|
@@ -5808,6 +5816,7 @@ var TrackSelector = /** @class */ (function (_super) {
|
|
|
5808
5816
|
TrackName.dbPTM,
|
|
5809
5817
|
TrackName.PDB,
|
|
5810
5818
|
TrackName.Exon,
|
|
5819
|
+
TrackName.UniprotTopology,
|
|
5811
5820
|
],
|
|
5812
5821
|
}
|
|
5813
5822
|
});
|
|
@@ -5838,6 +5847,7 @@ function initDefaultTrackVisibility() {
|
|
|
5838
5847
|
_a[TrackName.UniprotPTM] = 'hidden',
|
|
5839
5848
|
_a[TrackName.PDB] = 'hidden',
|
|
5840
5849
|
_a[TrackName.Exon] = 'hidden',
|
|
5850
|
+
_a[TrackName.UniprotTopology] = 'hidden',
|
|
5841
5851
|
_a;
|
|
5842
5852
|
}
|
|
5843
5853
|
|
|
@@ -6558,7 +6568,7 @@ var LollipopPlotNoTooltip = /** @class */ (function (_super) {
|
|
|
6558
6568
|
var _this = this;
|
|
6559
6569
|
var sequenceComponents = [];
|
|
6560
6570
|
var start = 0;
|
|
6561
|
-
var segments =
|
|
6571
|
+
var segments = ___default.map(this.props.domains, function (domain) {
|
|
6562
6572
|
var segment = {
|
|
6563
6573
|
start: start,
|
|
6564
6574
|
end: _this.codonToX(domain.startCodon),
|
|
@@ -7098,7 +7108,7 @@ var LollipopMutationPlotControls = /** @class */ (function (_super) {
|
|
|
7098
7108
|
Object.defineProperty(LollipopMutationPlotControls.prototype, "showBottomYAxisSlider", {
|
|
7099
7109
|
get: function () {
|
|
7100
7110
|
return (this.props.bottomCountRange &&
|
|
7101
|
-
|
|
7111
|
+
___default.compact(this.props.bottomCountRange).length > 0 &&
|
|
7102
7112
|
this.props.onBottomYAxisMaxSliderChange &&
|
|
7103
7113
|
this.props.onBottomYAxisMaxChange &&
|
|
7104
7114
|
this.props.bottomYMaxSlider &&
|
|
@@ -7472,7 +7482,7 @@ var TrackItem = /** @class */ (function (_super) {
|
|
|
7472
7482
|
return (createElement(TrackCircle, __assign({ isHovered: this.isHovered, radius: this.props.dim1, hoverRadius: this.props.hoverdim1 }, this.props)));
|
|
7473
7483
|
}
|
|
7474
7484
|
else {
|
|
7475
|
-
return (createElement(TrackRect, __assign({ isHovered: this.isHovered, width: this.props.dim1 }, this.props)));
|
|
7485
|
+
return (createElement(TrackRect, __assign({ isHovered: this.isHovered, width: this.props.dim1, height: this.props.dim2 }, this.props)));
|
|
7476
7486
|
}
|
|
7477
7487
|
}
|
|
7478
7488
|
});
|
|
@@ -7491,6 +7501,7 @@ var TrackItem = /** @class */ (function (_super) {
|
|
|
7491
7501
|
var styles$6 = {"trackTitle":"trackStyles-module_trackTitle__HOHY0"};
|
|
7492
7502
|
|
|
7493
7503
|
var DEFAULT_ID_CLASS_PREFIX = 'track-circle-';
|
|
7504
|
+
var DEFAULT_HEIGHT = 15; // height of rectangle element
|
|
7494
7505
|
var Track = /** @class */ (function (_super) {
|
|
7495
7506
|
__extends(Track, _super);
|
|
7496
7507
|
function Track(props) {
|
|
@@ -7679,7 +7690,7 @@ var Track = /** @class */ (function (_super) {
|
|
|
7679
7690
|
});
|
|
7680
7691
|
Object.defineProperty(Track.prototype, "svgHeight", {
|
|
7681
7692
|
get: function () {
|
|
7682
|
-
return 10;
|
|
7693
|
+
return 10; // height of baseline element
|
|
7683
7694
|
},
|
|
7684
7695
|
enumerable: false,
|
|
7685
7696
|
configurable: true
|
|
@@ -7698,8 +7709,8 @@ var Track = /** @class */ (function (_super) {
|
|
|
7698
7709
|
((spec.endCodon - spec.startCodon) /
|
|
7699
7710
|
_this.props.proteinLength) *
|
|
7700
7711
|
_this.props.width;
|
|
7701
|
-
dim2 =
|
|
7702
|
-
y =
|
|
7712
|
+
dim2 = spec.height || DEFAULT_HEIGHT;
|
|
7713
|
+
y = (_this.svgHeight - dim2) / 2; // y is the vertical start position of rectangle, half of baseline element height = half of element height + y
|
|
7703
7714
|
specFeats = __assign(__assign({}, spec), { endCodon: spec.endCodon, itemType: TrackItemType.RECTANGLE });
|
|
7704
7715
|
}
|
|
7705
7716
|
else {
|
|
@@ -7873,7 +7884,7 @@ function hotspotTooltip(mutations, hotspotIndex, hotspots) {
|
|
|
7873
7884
|
return isHotspot(mutation, hotspotIndex, defaultHotspotFilter);
|
|
7874
7885
|
}).length;
|
|
7875
7886
|
// generate custom info
|
|
7876
|
-
var residues =
|
|
7887
|
+
var residues = ___default.uniq(hotspots.map(function (hotspot) { return hotspot.residue; }));
|
|
7877
7888
|
var residuesText = createElement("b", null, "" + residues.join(', '));
|
|
7878
7889
|
var pluralSuffix = residues.length > 1 ? 's' : undefined;
|
|
7879
7890
|
var residueInfo = (createElement("span", null,
|
|
@@ -7898,8 +7909,8 @@ var HotspotTrack = /** @class */ (function (_super) {
|
|
|
7898
7909
|
var _this = this;
|
|
7899
7910
|
var filteredHotspotsByProteinPosStart = this.props.store
|
|
7900
7911
|
.hotspotsByPosition;
|
|
7901
|
-
if (!
|
|
7902
|
-
return
|
|
7912
|
+
if (!___default.isEmpty(filteredHotspotsByProteinPosStart)) {
|
|
7913
|
+
return ___default.keys(filteredHotspotsByProteinPosStart)
|
|
7903
7914
|
.filter(function (position) { return Number(position) >= 0; })
|
|
7904
7915
|
.map(function (position) { return ({
|
|
7905
7916
|
startCodon: Number(position),
|
|
@@ -8081,8 +8092,8 @@ function oncoKbTooltip(usingPublicOncoKbInstance, indicatorData) {
|
|
|
8081
8092
|
var sampleCount = indicatorData.length;
|
|
8082
8093
|
// generate info
|
|
8083
8094
|
var pluralSuffix = sampleCount > 1 ? 's' : undefined;
|
|
8084
|
-
var groupedByImplication =
|
|
8085
|
-
var oncogenicKeywords =
|
|
8095
|
+
var groupedByImplication = ___default.groupBy(indicatorData, 'oncogenic');
|
|
8096
|
+
var oncogenicKeywords = ___default.keys(groupedByImplication).map(function (keyword) { return (createElement("b", null, keyword)); });
|
|
8086
8097
|
var oncogenicInfo = [];
|
|
8087
8098
|
if (oncogenicKeywords.length > 1) {
|
|
8088
8099
|
// join all except the last one with ','
|
|
@@ -8102,14 +8113,14 @@ function oncoKbTooltip(usingPublicOncoKbInstance, indicatorData) {
|
|
|
8102
8113
|
// use oncogenic keywords array as is
|
|
8103
8114
|
oncogenicInfo = oncogenicKeywords;
|
|
8104
8115
|
}
|
|
8105
|
-
var groupedByProteinChange =
|
|
8106
|
-
var tableData =
|
|
8116
|
+
var groupedByProteinChange = ___default.groupBy(indicatorData, function (d) { return d.query.alteration; });
|
|
8117
|
+
var tableData = ___default.keys(groupedByProteinChange).map(function (proteinChange) { return ({
|
|
8107
8118
|
count: groupedByProteinChange[proteinChange].length,
|
|
8108
8119
|
proteinChange: proteinChange,
|
|
8109
|
-
clinicalImplication:
|
|
8120
|
+
clinicalImplication: ___default.uniq(groupedByProteinChange[proteinChange].map(function (indicator) {
|
|
8110
8121
|
return indicator.oncogenic ? indicator.oncogenic : 'Unknown';
|
|
8111
8122
|
})),
|
|
8112
|
-
biologicalEffect:
|
|
8123
|
+
biologicalEffect: ___default.uniq(groupedByProteinChange[proteinChange].map(function (indicator) {
|
|
8113
8124
|
return indicator.mutationEffect && indicator.mutationEffect.knownEffect
|
|
8114
8125
|
? indicator.mutationEffect.knownEffect
|
|
8115
8126
|
: 'Unknown';
|
|
@@ -8137,11 +8148,11 @@ function generateLevelData(indicatorData) {
|
|
|
8137
8148
|
levels[level].push(indicator.query.tumorType);
|
|
8138
8149
|
});
|
|
8139
8150
|
});
|
|
8140
|
-
return
|
|
8151
|
+
return ___default.keys(levels)
|
|
8141
8152
|
.sort(function (a, b) {
|
|
8142
8153
|
return LEVELS.all.indexOf(a) > LEVELS.all.indexOf(b) ? -1 : 1;
|
|
8143
8154
|
})
|
|
8144
|
-
.map(function (level) { return ({ level: level, tumorTypes:
|
|
8155
|
+
.map(function (level) { return ({ level: level, tumorTypes: ___default.uniq(levels[level]) }); });
|
|
8145
8156
|
}
|
|
8146
8157
|
var OncoKbTrackTooltip = function (props) {
|
|
8147
8158
|
return props.indicatorData
|
|
@@ -8166,8 +8177,8 @@ var OncoKbTrack = /** @class */ (function (_super) {
|
|
|
8166
8177
|
var _this = this;
|
|
8167
8178
|
var filteredOncoKbDataByProteinPosStart = this.props.store
|
|
8168
8179
|
.oncoKbDataByPosition;
|
|
8169
|
-
if (!
|
|
8170
|
-
return
|
|
8180
|
+
if (!___default.isEmpty(filteredOncoKbDataByProteinPosStart)) {
|
|
8181
|
+
return ___default.keys(filteredOncoKbDataByProteinPosStart)
|
|
8171
8182
|
.filter(function (position) { return Number(position) >= 0; })
|
|
8172
8183
|
.map(function (position) { return ({
|
|
8173
8184
|
startCodon: Number(position),
|
|
@@ -8443,14 +8454,14 @@ var PtmAnnotationTable = /** @class */ (function (_super) {
|
|
|
8443
8454
|
if (!this.props.pubMedCache) {
|
|
8444
8455
|
cellRenderFn = function () { return null; };
|
|
8445
8456
|
}
|
|
8446
|
-
else if (!
|
|
8457
|
+
else if (!___default.isEmpty(this.pmidData)) {
|
|
8447
8458
|
cellRenderFn = function (props) {
|
|
8448
|
-
return !
|
|
8459
|
+
return !___default.isEmpty(props.original.pubmedIds) ? (createElement(PtmReferenceList, { pmidData: _this.pmidData, pubmedIds: props.original.pubmedIds || [] })) : null;
|
|
8449
8460
|
};
|
|
8450
8461
|
}
|
|
8451
8462
|
else {
|
|
8452
8463
|
cellRenderFn = function (props) {
|
|
8453
|
-
return !
|
|
8464
|
+
return !___default.isEmpty(props.original.pubmedIds) ? (createElement("i", { className: "fa fa-spinner fa-pulse" })) : null;
|
|
8454
8465
|
};
|
|
8455
8466
|
}
|
|
8456
8467
|
return cellRenderFn;
|
|
@@ -8567,7 +8578,7 @@ var PtmTrack = /** @class */ (function (_super) {
|
|
|
8567
8578
|
var ptms = Number(position) >= 0
|
|
8568
8579
|
? filterPtmsBySource(ptmData, _this.props.dataSource)
|
|
8569
8580
|
: [];
|
|
8570
|
-
if (!
|
|
8581
|
+
if (!___default.isEmpty(ptms)) {
|
|
8571
8582
|
acc.push({
|
|
8572
8583
|
startCodon: Number(position),
|
|
8573
8584
|
color: ptmColor(ptms),
|
|
@@ -8585,8 +8596,8 @@ var PtmTrack = /** @class */ (function (_super) {
|
|
|
8585
8596
|
get: function () {
|
|
8586
8597
|
var ptmDataByProteinPosStart = this.props.store
|
|
8587
8598
|
.ptmDataByProteinPosStart.result;
|
|
8588
|
-
if (ptmDataByProteinPosStart && !
|
|
8589
|
-
return
|
|
8599
|
+
if (ptmDataByProteinPosStart && !___default.isEmpty(ptmDataByProteinPosStart)) {
|
|
8600
|
+
return ___default.reduce(ptmDataByProteinPosStart, this.ptmDataToTrackItemSpecsReducer, []);
|
|
8590
8601
|
}
|
|
8591
8602
|
else {
|
|
8592
8603
|
return [];
|
|
@@ -8601,14 +8612,14 @@ var PtmTrack = /** @class */ (function (_super) {
|
|
|
8601
8612
|
var ptmDataByTypeAndProteinPosStart = this.props.store
|
|
8602
8613
|
.ptmDataByTypeAndProteinPosStart.result;
|
|
8603
8614
|
if (ptmDataByTypeAndProteinPosStart &&
|
|
8604
|
-
!
|
|
8605
|
-
return
|
|
8615
|
+
!___default.isEmpty(ptmDataByTypeAndProteinPosStart)) {
|
|
8616
|
+
return ___default.keys(ptmDataByTypeAndProteinPosStart)
|
|
8606
8617
|
.sort(compareByPtmTypePriority)
|
|
8607
8618
|
.map(function (type) { return ({
|
|
8608
8619
|
title: type,
|
|
8609
|
-
specs:
|
|
8620
|
+
specs: ___default.reduce(ptmDataByTypeAndProteinPosStart[type], _this.ptmDataToTrackItemSpecsReducer, []),
|
|
8610
8621
|
}); })
|
|
8611
|
-
.filter(function (s) { return !
|
|
8622
|
+
.filter(function (s) { return !___default.isEmpty(s.specs); });
|
|
8612
8623
|
}
|
|
8613
8624
|
else {
|
|
8614
8625
|
return [];
|
|
@@ -8768,6 +8779,255 @@ var PtmTrack = /** @class */ (function (_super) {
|
|
|
8768
8779
|
return PtmTrack;
|
|
8769
8780
|
}(Component));
|
|
8770
8781
|
|
|
8782
|
+
function topologyRectangleBlockSpec(color, title, uniprotData) {
|
|
8783
|
+
return {
|
|
8784
|
+
color: color,
|
|
8785
|
+
startCodon: uniprotData.startPosition,
|
|
8786
|
+
endCodon: uniprotData.endPosition,
|
|
8787
|
+
tooltip: (createElement("span", null,
|
|
8788
|
+
createElement("h5", null, title),
|
|
8789
|
+
"Start: ",
|
|
8790
|
+
uniprotData.startPosition,
|
|
8791
|
+
createElement("br", null),
|
|
8792
|
+
"End: ",
|
|
8793
|
+
uniprotData.endPosition,
|
|
8794
|
+
createElement("br", null),
|
|
8795
|
+
"Length: ",
|
|
8796
|
+
uniprotData.endPosition - uniprotData.startPosition,
|
|
8797
|
+
createElement("br", null),
|
|
8798
|
+
"Description: ",
|
|
8799
|
+
uniprotData.description)),
|
|
8800
|
+
};
|
|
8801
|
+
}
|
|
8802
|
+
var UniprotTopologyTrackDescriptionTooltip = function (props) {
|
|
8803
|
+
var dataSourceDiv = props.uniprotId ? (createElement("div", null,
|
|
8804
|
+
"Data Source:",
|
|
8805
|
+
' ',
|
|
8806
|
+
createElement("a", { href: "https://www.uniprot.org/uniprot/" + props.uniprotId, target: "_blank" }, "UniProt"))) : (createElement("div", null,
|
|
8807
|
+
"Data Source:",
|
|
8808
|
+
' ',
|
|
8809
|
+
createElement("a", { href: 'https://www.uniprot.org/', target: "_blank" }, "UniProt")));
|
|
8810
|
+
return (createElement("div", { style: { maxWidth: 400 } },
|
|
8811
|
+
createElement("p", null, "Information of the subcellular location of the mature protein."),
|
|
8812
|
+
props.displayList.length > 0 && (createElement("p", null,
|
|
8813
|
+
"Domains and corresponding color codes are as follows:",
|
|
8814
|
+
createElement("ul", null, map(props.displayList, function (type) { return (createElement("li", { style: {
|
|
8815
|
+
color: UniprotTopologyTrackToColor[type],
|
|
8816
|
+
} },
|
|
8817
|
+
createElement("strong", null, UniprotTopologyTypeToTitle[type]))); })))),
|
|
8818
|
+
dataSourceDiv));
|
|
8819
|
+
};
|
|
8820
|
+
var UniprotTopologyTrack = /** @class */ (function (_super) {
|
|
8821
|
+
__extends(UniprotTopologyTrack, _super);
|
|
8822
|
+
function UniprotTopologyTrack(props) {
|
|
8823
|
+
var _this = _super.call(this, props) || this;
|
|
8824
|
+
Object.defineProperty(_this, "expanded", {
|
|
8825
|
+
enumerable: true,
|
|
8826
|
+
configurable: true,
|
|
8827
|
+
writable: true,
|
|
8828
|
+
value: !_this.props.collapsed
|
|
8829
|
+
});
|
|
8830
|
+
Object.defineProperty(_this, "uniprotDataToTrackItemSpecsReducer", {
|
|
8831
|
+
enumerable: true,
|
|
8832
|
+
configurable: true,
|
|
8833
|
+
writable: true,
|
|
8834
|
+
value: function (acc, uniprotData) {
|
|
8835
|
+
var trackColor = UniprotTopologyTrackToColor[uniprotData.type];
|
|
8836
|
+
var trackTitle = UniprotTopologyTypeToTitle[uniprotData.type];
|
|
8837
|
+
if (trackTitle && trackColor) {
|
|
8838
|
+
acc.push(topologyRectangleBlockSpec(trackColor, trackTitle, uniprotData));
|
|
8839
|
+
}
|
|
8840
|
+
return acc;
|
|
8841
|
+
}
|
|
8842
|
+
});
|
|
8843
|
+
makeObservable(_this);
|
|
8844
|
+
return _this;
|
|
8845
|
+
}
|
|
8846
|
+
UniprotTopologyTrack_1 = UniprotTopologyTrack;
|
|
8847
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "subTrackMargin", {
|
|
8848
|
+
get: function () {
|
|
8849
|
+
return (this.props.subTrackMargin ||
|
|
8850
|
+
UniprotTopologyTrack_1.defaultProps.subTrackMargin);
|
|
8851
|
+
},
|
|
8852
|
+
enumerable: false,
|
|
8853
|
+
configurable: true
|
|
8854
|
+
});
|
|
8855
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "subTrackTitleWidth", {
|
|
8856
|
+
get: function () {
|
|
8857
|
+
return this.props.xOffset
|
|
8858
|
+
? this.props.xOffset - this.subTrackMargin
|
|
8859
|
+
: 0;
|
|
8860
|
+
},
|
|
8861
|
+
enumerable: false,
|
|
8862
|
+
configurable: true
|
|
8863
|
+
});
|
|
8864
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "uniprotTopologySpecs", {
|
|
8865
|
+
get: function () {
|
|
8866
|
+
var uniprotData = this.props.store.uniprotTopologyData.result;
|
|
8867
|
+
if (uniprotData && !isEmpty(uniprotData)) {
|
|
8868
|
+
return reduce(uniprotData, this.uniprotDataToTrackItemSpecsReducer, []);
|
|
8869
|
+
}
|
|
8870
|
+
else {
|
|
8871
|
+
return [];
|
|
8872
|
+
}
|
|
8873
|
+
},
|
|
8874
|
+
enumerable: false,
|
|
8875
|
+
configurable: true
|
|
8876
|
+
});
|
|
8877
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "expander", {
|
|
8878
|
+
get: function () {
|
|
8879
|
+
var className = this.hasSubTracks
|
|
8880
|
+
? this.mainTrackHidden
|
|
8881
|
+
? 'fa fa-caret-down'
|
|
8882
|
+
: 'fa fa-caret-right'
|
|
8883
|
+
: null;
|
|
8884
|
+
if (className) {
|
|
8885
|
+
return (createElement("i", { className: className, style: { width: 10, marginLeft: 2 } }));
|
|
8886
|
+
}
|
|
8887
|
+
return null;
|
|
8888
|
+
},
|
|
8889
|
+
enumerable: false,
|
|
8890
|
+
configurable: true
|
|
8891
|
+
});
|
|
8892
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "mainTrackTitle", {
|
|
8893
|
+
get: function () {
|
|
8894
|
+
return (createElement("span", { style: { cursor: 'pointer' } },
|
|
8895
|
+
createElement("span", { onClick: this.handleToggleExpand }, this.expander),
|
|
8896
|
+
createElement(DefaultTooltip, { placement: "right", overlay: createElement(UniprotTopologyTrackDescriptionTooltip, { displayList: this.uniprotTopologyTypes, uniprotId: this.props.store.uniprotId.result }), destroyTooltipOnHide: true },
|
|
8897
|
+
createElement("span", { style: { marginLeft: 4 }, onClick: this.handleToggleExpand },
|
|
8898
|
+
"Topology ",
|
|
8899
|
+
createElement("i", { className: "fa fa-info-circle" })))));
|
|
8900
|
+
},
|
|
8901
|
+
enumerable: false,
|
|
8902
|
+
configurable: true
|
|
8903
|
+
});
|
|
8904
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "uniprotTopologyTypes", {
|
|
8905
|
+
get: function () {
|
|
8906
|
+
var uniprotData = this.props.store.uniprotTopologyData.result;
|
|
8907
|
+
var uniprotDataByType = uniq(map(uniprotData, function (data) { return data.type; }));
|
|
8908
|
+
return uniprotDataByType || [];
|
|
8909
|
+
},
|
|
8910
|
+
enumerable: false,
|
|
8911
|
+
configurable: true
|
|
8912
|
+
});
|
|
8913
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "uniprotTopologySubSpecs", {
|
|
8914
|
+
get: function () {
|
|
8915
|
+
var _this = this;
|
|
8916
|
+
var uniprotData = this.props.store.uniprotTopologyData.result;
|
|
8917
|
+
var uniprotDataByType = groupBy(uniprotData, function (data) { return data.type; });
|
|
8918
|
+
return keys(uniprotDataByType)
|
|
8919
|
+
.map(function (type) { return ({
|
|
8920
|
+
title: UniprotTopologyTypeToTitle[type],
|
|
8921
|
+
specs: reduce(uniprotDataByType[type], _this.uniprotDataToTrackItemSpecsReducer, []),
|
|
8922
|
+
}); })
|
|
8923
|
+
.filter(function (s) { return !isEmpty(s.specs); });
|
|
8924
|
+
},
|
|
8925
|
+
enumerable: false,
|
|
8926
|
+
configurable: true
|
|
8927
|
+
});
|
|
8928
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "mainTrackHidden", {
|
|
8929
|
+
get: function () {
|
|
8930
|
+
return this.expanded && this.hasSubTracks;
|
|
8931
|
+
},
|
|
8932
|
+
enumerable: false,
|
|
8933
|
+
configurable: true
|
|
8934
|
+
});
|
|
8935
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "hasSubTracks", {
|
|
8936
|
+
get: function () {
|
|
8937
|
+
return this.uniprotTopologySubSpecs.length > 0;
|
|
8938
|
+
},
|
|
8939
|
+
enumerable: false,
|
|
8940
|
+
configurable: true
|
|
8941
|
+
});
|
|
8942
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "subTracks", {
|
|
8943
|
+
get: function () {
|
|
8944
|
+
var _this = this;
|
|
8945
|
+
return this.hasSubTracks
|
|
8946
|
+
? this.uniprotTopologySubSpecs.map(function (item, index) { return (createElement(Track, { key: item.title, dataStore: _this.props.dataStore, xOffset: _this.props.xOffset, trackTitle: createElement("span", { style: {
|
|
8947
|
+
marginLeft: _this.subTrackMargin,
|
|
8948
|
+
width: _this.subTrackTitleWidth,
|
|
8949
|
+
display: 'flex',
|
|
8950
|
+
} },
|
|
8951
|
+
createElement(EllipsisTextTooltip, { text: item.title, style: {
|
|
8952
|
+
overflow: 'hidden',
|
|
8953
|
+
whiteSpace: 'nowrap',
|
|
8954
|
+
textOverflow: 'ellipsis',
|
|
8955
|
+
} })), width: _this.props.width, proteinLength: _this.props.proteinLength, trackItems: item.specs, idClassPrefix: "uniprot-topology-" + index + "-", isSubTrack: true })); })
|
|
8956
|
+
: null;
|
|
8957
|
+
},
|
|
8958
|
+
enumerable: false,
|
|
8959
|
+
configurable: true
|
|
8960
|
+
});
|
|
8961
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "render", {
|
|
8962
|
+
enumerable: false,
|
|
8963
|
+
configurable: true,
|
|
8964
|
+
writable: true,
|
|
8965
|
+
value: function () {
|
|
8966
|
+
return (createElement("span", null,
|
|
8967
|
+
createElement(Track, { dataStore: this.props.dataStore, width: this.props.width, xOffset: this.props.xOffset, proteinLength: this.props.proteinLength, trackTitle: this.mainTrackTitle, trackItems: this.mainTrackHidden ? [] : this.uniprotTopologySpecs, hideBaseline: this.mainTrackHidden, idClassPrefix: 'uniprot-topology-track-' }),
|
|
8968
|
+
createElement(Collapse, { isOpened: this.mainTrackHidden },
|
|
8969
|
+
createElement("span", null, this.subTracks))));
|
|
8970
|
+
}
|
|
8971
|
+
});
|
|
8972
|
+
Object.defineProperty(UniprotTopologyTrack.prototype, "handleToggleExpand", {
|
|
8973
|
+
enumerable: false,
|
|
8974
|
+
configurable: true,
|
|
8975
|
+
writable: true,
|
|
8976
|
+
value: function () {
|
|
8977
|
+
this.expanded = !this.expanded;
|
|
8978
|
+
}
|
|
8979
|
+
});
|
|
8980
|
+
var UniprotTopologyTrack_1;
|
|
8981
|
+
Object.defineProperty(UniprotTopologyTrack, "defaultProps", {
|
|
8982
|
+
enumerable: true,
|
|
8983
|
+
configurable: true,
|
|
8984
|
+
writable: true,
|
|
8985
|
+
value: {
|
|
8986
|
+
subTrackMargin: 25,
|
|
8987
|
+
}
|
|
8988
|
+
});
|
|
8989
|
+
__decorate([
|
|
8990
|
+
observable
|
|
8991
|
+
], UniprotTopologyTrack.prototype, "expanded", void 0);
|
|
8992
|
+
__decorate([
|
|
8993
|
+
computed
|
|
8994
|
+
], UniprotTopologyTrack.prototype, "subTrackMargin", null);
|
|
8995
|
+
__decorate([
|
|
8996
|
+
computed
|
|
8997
|
+
], UniprotTopologyTrack.prototype, "subTrackTitleWidth", null);
|
|
8998
|
+
__decorate([
|
|
8999
|
+
computed
|
|
9000
|
+
], UniprotTopologyTrack.prototype, "uniprotTopologySpecs", null);
|
|
9001
|
+
__decorate([
|
|
9002
|
+
computed
|
|
9003
|
+
], UniprotTopologyTrack.prototype, "expander", null);
|
|
9004
|
+
__decorate([
|
|
9005
|
+
computed
|
|
9006
|
+
], UniprotTopologyTrack.prototype, "mainTrackTitle", null);
|
|
9007
|
+
__decorate([
|
|
9008
|
+
computed
|
|
9009
|
+
], UniprotTopologyTrack.prototype, "uniprotTopologyTypes", null);
|
|
9010
|
+
__decorate([
|
|
9011
|
+
computed
|
|
9012
|
+
], UniprotTopologyTrack.prototype, "uniprotTopologySubSpecs", null);
|
|
9013
|
+
__decorate([
|
|
9014
|
+
computed
|
|
9015
|
+
], UniprotTopologyTrack.prototype, "mainTrackHidden", null);
|
|
9016
|
+
__decorate([
|
|
9017
|
+
computed
|
|
9018
|
+
], UniprotTopologyTrack.prototype, "hasSubTracks", null);
|
|
9019
|
+
__decorate([
|
|
9020
|
+
computed
|
|
9021
|
+
], UniprotTopologyTrack.prototype, "subTracks", null);
|
|
9022
|
+
__decorate([
|
|
9023
|
+
action.bound
|
|
9024
|
+
], UniprotTopologyTrack.prototype, "handleToggleExpand", null);
|
|
9025
|
+
UniprotTopologyTrack = UniprotTopologyTrack_1 = __decorate([
|
|
9026
|
+
observer
|
|
9027
|
+
], UniprotTopologyTrack);
|
|
9028
|
+
return UniprotTopologyTrack;
|
|
9029
|
+
}(Component));
|
|
9030
|
+
|
|
8771
9031
|
var TrackPanel = /** @class */ (function (_super) {
|
|
8772
9032
|
__extends(TrackPanel, _super);
|
|
8773
9033
|
function TrackPanel(props) {
|
|
@@ -8796,6 +9056,9 @@ var TrackPanel = /** @class */ (function (_super) {
|
|
|
8796
9056
|
_a[TrackName.UniprotPTM] = this.getPtmTrack(TrackName.UniprotPTM, PtmSource.Uniprot),
|
|
8797
9057
|
_a[TrackName.Exon] = !this.props.trackVisibility ||
|
|
8798
9058
|
this.props.trackVisibility[TrackName.Exon] === 'visible' ? (createElement(ExonTrack, { store: this.props.store, dataStore: this.props.store.dataStore, width: this.props.geneWidth, xOffset: this.props.geneXOffset, proteinLength: this.proteinLength })) : null,
|
|
9059
|
+
_a[TrackName.UniprotTopology] = !this.props.trackVisibility ||
|
|
9060
|
+
this.props.trackVisibility[TrackName.UniprotTopology] ===
|
|
9061
|
+
'visible' ? (createElement(UniprotTopologyTrack, { store: this.props.store, dataStore: this.props.store.dataStore, width: this.props.geneWidth, xOffset: this.props.geneXOffset, proteinLength: this.proteinLength, collapsed: this.props.collapseUniprotTopologyTrack })) : null,
|
|
8799
9062
|
_a;
|
|
8800
9063
|
},
|
|
8801
9064
|
enumerable: false,
|
|
@@ -8855,6 +9118,7 @@ var TrackPanel = /** @class */ (function (_super) {
|
|
|
8855
9118
|
TrackName.OncoKB,
|
|
8856
9119
|
TrackName.dbPTM,
|
|
8857
9120
|
TrackName.Exon,
|
|
9121
|
+
TrackName.UniprotTopology,
|
|
8858
9122
|
],
|
|
8859
9123
|
}
|
|
8860
9124
|
});
|
|
@@ -9096,7 +9360,7 @@ var LollipopMutationPlot = /** @class */ (function (_super) {
|
|
|
9096
9360
|
: -1;
|
|
9097
9361
|
});
|
|
9098
9362
|
var specs = this.createInitialSpecs(positionMutations, countsByPosition, group, placement);
|
|
9099
|
-
var noLabelsAreShown = !
|
|
9363
|
+
var noLabelsAreShown = !___default.isEmpty(specs) && specs.every(function (spec) { return !spec.label.show; });
|
|
9100
9364
|
if (noLabelsAreShown) {
|
|
9101
9365
|
this.labelOneLollipopByDefault(this.getRemainingDomains(positionMutations), specs);
|
|
9102
9366
|
}
|
|
@@ -9307,7 +9571,7 @@ var LollipopMutationPlot = /** @class */ (function (_super) {
|
|
|
9307
9571
|
if (!this.props.store.pfamDomainData.isPending &&
|
|
9308
9572
|
this.props.store.pfamDomainData.result &&
|
|
9309
9573
|
this.props.store.pfamDomainData.result.length > 0) {
|
|
9310
|
-
return
|
|
9574
|
+
return ___default.keyBy(this.props.store.pfamDomainData.result, 'pfamAccession');
|
|
9311
9575
|
}
|
|
9312
9576
|
else {
|
|
9313
9577
|
return {};
|
|
@@ -9507,7 +9771,7 @@ var LollipopMutationPlot = /** @class */ (function (_super) {
|
|
|
9507
9771
|
createElement(LollipopPlot, { sequence: this.sequence, lollipops: this.lollipops, domains: this.domains, dataStore: this.props.store.dataStore, vizWidth: this.props.geneWidth, vizHeight: this.props.vizHeight, hugoGeneSymbol: this.hugoGeneSymbol, xMax: this.proteinLength, yMax: this.yMaxInput, yMaxFractionDigits: this.yMaxSliderStep < 1
|
|
9508
9772
|
? this.props.yMaxFractionDigits
|
|
9509
9773
|
: undefined, yMaxLabelPostfix: this.props.yMaxLabelPostfix, yAxisLabelPadding: this.props.yAxisLabelPadding, showYAxis: this.props.showYAxis, bottomYMax: this.bottomYMaxInput, onXAxisOffset: this.onXAxisOffset, topYAxisSymbol: this.props.topYAxisSymbol, bottomYAxisSymbol: this.props.bottomYAxisSymbol, groups: this.groups }),
|
|
9510
|
-
createElement(TrackPanel, { store: this.props.store, geneWidth: this.props.geneWidth, tracks: this.props.tracks, trackVisibility: this.trackVisibility, pubMedCache: this.props.pubMedCache, proteinLength: this.proteinLength, geneXOffset: this.geneXOffset, collapsePtmTrack: this.props.collapsePtmTrack })));
|
|
9774
|
+
createElement(TrackPanel, { store: this.props.store, geneWidth: this.props.geneWidth, tracks: this.props.tracks, trackVisibility: this.trackVisibility, pubMedCache: this.props.pubMedCache, proteinLength: this.proteinLength, geneXOffset: this.geneXOffset, collapsePtmTrack: this.props.collapsePtmTrack, collapseUniprotTopologyTrack: this.props.collapseUniprotTopologyTrack })));
|
|
9511
9775
|
}
|
|
9512
9776
|
else if (this.props.store.canonicalTranscript.isComplete &&
|
|
9513
9777
|
this.props.store.canonicalTranscript.result === undefined) {
|
|
@@ -9644,7 +9908,7 @@ var DefaultStringQueryCache = /** @class */ (function () {
|
|
|
9644
9908
|
});
|
|
9645
9909
|
Object.defineProperty(DefaultStringQueryCache.prototype, "cache", {
|
|
9646
9910
|
get: function () {
|
|
9647
|
-
return
|
|
9911
|
+
return ___default.fromPairs(this._cache.toJSON());
|
|
9648
9912
|
},
|
|
9649
9913
|
enumerable: false,
|
|
9650
9914
|
configurable: true
|
|
@@ -9791,7 +10055,7 @@ var DefaultMutationMapperDataStore = /** @class */ (function () {
|
|
|
9791
10055
|
}
|
|
9792
10056
|
Object.defineProperty(DefaultMutationMapperDataStore.prototype, "groupFiltersKeyedByGroup", {
|
|
9793
10057
|
get: function () {
|
|
9794
|
-
return
|
|
10058
|
+
return ___default.keyBy(this.groupFilters, 'group');
|
|
9795
10059
|
},
|
|
9796
10060
|
enumerable: false,
|
|
9797
10061
|
configurable: true
|
|
@@ -9808,7 +10072,7 @@ var DefaultMutationMapperDataStore = /** @class */ (function () {
|
|
|
9808
10072
|
var _this = this;
|
|
9809
10073
|
return this.dataFilters.length > 0
|
|
9810
10074
|
? // TODO simplify array flatten if possible
|
|
9811
|
-
this.data.filter(function (m) { return _this.dataMainFilter(
|
|
10075
|
+
this.data.filter(function (m) { return _this.dataMainFilter(___default.flatten([m])[0]); })
|
|
9812
10076
|
: this.data;
|
|
9813
10077
|
},
|
|
9814
10078
|
enumerable: false,
|
|
@@ -9834,7 +10098,7 @@ var DefaultMutationMapperDataStore = /** @class */ (function () {
|
|
|
9834
10098
|
return this.selectionFilters.length > 0
|
|
9835
10099
|
? // TODO simplify array flatten if possible
|
|
9836
10100
|
this.sortedFilteredData.filter(function (m) {
|
|
9837
|
-
return _this.dataSelectFilter(
|
|
10101
|
+
return _this.dataSelectFilter(___default.flatten([m])[0]);
|
|
9838
10102
|
})
|
|
9839
10103
|
: [];
|
|
9840
10104
|
},
|
|
@@ -10178,7 +10442,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
|
|
|
10178
10442
|
return __generator(this, function (_a) {
|
|
10179
10443
|
return [2 /*return*/, this.fetchCanonicalTranscript(hugoSymbol, isoformOverrideSource, client).catch(function () {
|
|
10180
10444
|
// get transcript with max protein length in given list of all transcripts
|
|
10181
|
-
var transcript =
|
|
10445
|
+
var transcript = ___default.maxBy(allTranscripts, function (t) { return t.proteinLength; });
|
|
10182
10446
|
return transcript ? transcript : undefined;
|
|
10183
10447
|
})];
|
|
10184
10448
|
});
|
|
@@ -10249,7 +10513,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
|
|
|
10249
10513
|
enumerable: false,
|
|
10250
10514
|
configurable: true,
|
|
10251
10515
|
writable: true,
|
|
10252
|
-
value: function (swissProtId, client) {
|
|
10516
|
+
value: function (swissProtId, category, client) {
|
|
10253
10517
|
if (client === void 0) { client = this.genomeNexusClient; }
|
|
10254
10518
|
return __awaiter(this, void 0, void 0, function () {
|
|
10255
10519
|
var uniprotData, featureList;
|
|
@@ -10257,7 +10521,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
|
|
|
10257
10521
|
switch (_a.label) {
|
|
10258
10522
|
case 0:
|
|
10259
10523
|
if (!swissProtId) return [3 /*break*/, 2];
|
|
10260
|
-
return [4 /*yield*/, request.get(getUrl("https://www.ebi.ac.uk/proteins/api/features/<%= uniprotAccession %>?categories=
|
|
10524
|
+
return [4 /*yield*/, request.get(getUrl("https://www.ebi.ac.uk/proteins/api/features/<%= uniprotAccession %>?categories=" + category.join(','), { uniprotAccession: swissProtId }))];
|
|
10261
10525
|
case 1:
|
|
10262
10526
|
uniprotData = _a.sent();
|
|
10263
10527
|
featureList = JSON.parse(uniprotData.text);
|
|
@@ -10333,7 +10597,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
|
|
|
10333
10597
|
else if (mutations.length === 0) {
|
|
10334
10598
|
return [2 /*return*/, ONCOKB_DEFAULT_DATA];
|
|
10335
10599
|
}
|
|
10336
|
-
mutationsToQuery =
|
|
10600
|
+
mutationsToQuery = ___default.filter(mutations, function (m) {
|
|
10337
10601
|
return (m.mutationType &&
|
|
10338
10602
|
m.mutationType.toLowerCase() ===
|
|
10339
10603
|
CanonicalMutationType.FUSION) ||
|
|
@@ -10355,10 +10619,10 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
|
|
|
10355
10619
|
return __generator(this, function (_c) {
|
|
10356
10620
|
switch (_c.label) {
|
|
10357
10621
|
case 0:
|
|
10358
|
-
mutationQueryVariants =
|
|
10622
|
+
mutationQueryVariants = ___default.uniqBy(___default.map(queryVariants.filter(function (mutation) { return mutation.mutationType !== 'Fusion'; }), function (mutation) {
|
|
10359
10623
|
return generateProteinChangeQuery(getEntrezGeneId(mutation), getTumorType(mutation), mutation.proteinChange, mutation.mutationType, mutation.proteinPosStart, mutation.proteinPosEnd, evidenceTypes);
|
|
10360
10624
|
}), 'id');
|
|
10361
|
-
structuralQueryVariants =
|
|
10625
|
+
structuralQueryVariants = ___default.uniqBy(___default.map(queryVariants.filter(function (mutation) {
|
|
10362
10626
|
var _a;
|
|
10363
10627
|
return ((_a = mutation.mutationType) === null || _a === void 0 ? void 0 : _a.toUpperCase()) ===
|
|
10364
10628
|
StructuralVariantType.FUSION;
|
|
@@ -10389,7 +10653,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
|
|
|
10389
10653
|
structuralVariantQueryResult = _b;
|
|
10390
10654
|
return [2 /*return*/, {
|
|
10391
10655
|
// generateIdToIndicatorMap(oncokbSearch)
|
|
10392
|
-
indicatorMap:
|
|
10656
|
+
indicatorMap: ___default.keyBy(mutationQueryResult.concat(structuralVariantQueryResult), function (indicator) { return indicator.query.id; }),
|
|
10393
10657
|
}];
|
|
10394
10658
|
}
|
|
10395
10659
|
});
|
|
@@ -10674,7 +10938,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
10674
10938
|
return [4 /*yield*/, this.dataFetcher.fetchSwissProtAccession(this.gene.entrezGeneId)];
|
|
10675
10939
|
case 1:
|
|
10676
10940
|
accession = _a.sent();
|
|
10677
|
-
if (
|
|
10941
|
+
if (___default.isArray(accession)) {
|
|
10678
10942
|
return [2 /*return*/, accession[0]];
|
|
10679
10943
|
}
|
|
10680
10944
|
else {
|
|
@@ -10731,7 +10995,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
10731
10995
|
this.transcriptsWithProteinLength.result &&
|
|
10732
10996
|
this.transcriptsWithProteinLength.result.length > 0) {
|
|
10733
10997
|
// add domain ranges for all transcripts to this call
|
|
10734
|
-
domainRanges = [].concat.apply([domainRanges],
|
|
10998
|
+
domainRanges = [].concat.apply([domainRanges], ___default.compact(this.transcriptsWithProteinLength.result.map(function (transcriptId) {
|
|
10735
10999
|
return _this.transcriptsByTranscriptId[transcriptId].pfamDomains;
|
|
10736
11000
|
})));
|
|
10737
11001
|
}
|
|
@@ -10776,7 +11040,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
10776
11040
|
]; },
|
|
10777
11041
|
invoke: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
10778
11042
|
return __generator(this, function (_a) {
|
|
10779
|
-
return [2 /*return*/,
|
|
11043
|
+
return [2 /*return*/, ___default.compact(___default.unionBy(this.transcriptsByHugoSymbol.result, [this.canonicalTranscript.result], function (t) { return t && t.transcriptId; }))];
|
|
10780
11044
|
});
|
|
10781
11045
|
}); },
|
|
10782
11046
|
onError: function () {
|
|
@@ -10816,7 +11080,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
10816
11080
|
this.canonicalTranscript.result) {
|
|
10817
11081
|
// ignore transcripts without protein length
|
|
10818
11082
|
// TODO: better solution is to hide lollipop plot for those transcripts
|
|
10819
|
-
return [2 /*return*/,
|
|
11083
|
+
return [2 /*return*/, ___default.compact(this.allTranscripts.result.map(function (et) {
|
|
10820
11084
|
return et.proteinLength && et.transcriptId;
|
|
10821
11085
|
}))];
|
|
10822
11086
|
}
|
|
@@ -10849,13 +11113,13 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
10849
11113
|
this.allTranscripts.result &&
|
|
10850
11114
|
this.transcriptsWithProteinLength.result &&
|
|
10851
11115
|
this.transcriptsWithProteinLength.result.length > 0) {
|
|
10852
|
-
transcripts =
|
|
11116
|
+
transcripts = ___default.uniq([].concat.apply([], uniqueGenomicLocations(this.getMutations()).map(function (gl) {
|
|
10853
11117
|
var variantAnnotation = _this
|
|
10854
11118
|
.indexedVariantAnnotations.result
|
|
10855
11119
|
? _this.indexedVariantAnnotations.result[genomicLocationString(gl)]
|
|
10856
11120
|
: undefined;
|
|
10857
11121
|
if (variantAnnotation &&
|
|
10858
|
-
!
|
|
11122
|
+
!___default.isEmpty(variantAnnotation.transcript_consequences)) {
|
|
10859
11123
|
return variantAnnotation.transcript_consequences
|
|
10860
11124
|
.map(function (tc) { return tc.transcript_id; })
|
|
10861
11125
|
.filter(function (transcriptId) {
|
|
@@ -10934,7 +11198,9 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
10934
11198
|
// return this.dataFetcher.fetchPtmData(
|
|
10935
11199
|
// this.activeTranscript.result
|
|
10936
11200
|
// );
|
|
10937
|
-
return [2 /*return*/, this.dataFetcher.fetchUniprotFeatures(uniprotId
|
|
11201
|
+
return [2 /*return*/, this.dataFetcher.fetchUniprotFeatures(uniprotId, [
|
|
11202
|
+
UniprotCategory.PTM,
|
|
11203
|
+
])];
|
|
10938
11204
|
}
|
|
10939
11205
|
else {
|
|
10940
11206
|
return [2 /*return*/, []];
|
|
@@ -10946,6 +11212,46 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
10946
11212
|
},
|
|
10947
11213
|
}, [])
|
|
10948
11214
|
});
|
|
11215
|
+
Object.defineProperty(this, "uniprotTopologyData", {
|
|
11216
|
+
enumerable: true,
|
|
11217
|
+
configurable: true,
|
|
11218
|
+
writable: true,
|
|
11219
|
+
value: remoteData({
|
|
11220
|
+
await: function () { return [
|
|
11221
|
+
_this.mutationData,
|
|
11222
|
+
_this.activeTranscript,
|
|
11223
|
+
_this.allTranscripts,
|
|
11224
|
+
]; },
|
|
11225
|
+
invoke: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
11226
|
+
var uniprotId, data, transcript, uniprotFeatures;
|
|
11227
|
+
return __generator(this, function (_a) {
|
|
11228
|
+
switch (_a.label) {
|
|
11229
|
+
case 0:
|
|
11230
|
+
data = [];
|
|
11231
|
+
if (this.activeTranscript.result) {
|
|
11232
|
+
transcript = this.transcriptsByTranscriptId[this.activeTranscript.result];
|
|
11233
|
+
uniprotId = transcript === null || transcript === void 0 ? void 0 : transcript.uniprotId;
|
|
11234
|
+
}
|
|
11235
|
+
if (!uniprotId) return [3 /*break*/, 2];
|
|
11236
|
+
return [4 /*yield*/, this.dataFetcher.fetchUniprotFeatures(uniprotId, [UniprotCategory.TOPOLOGY])];
|
|
11237
|
+
case 1:
|
|
11238
|
+
uniprotFeatures = _a.sent();
|
|
11239
|
+
uniprotFeatures.forEach(function (uniprotFeature) {
|
|
11240
|
+
var uniprotTopology = convertUniprotFeatureToUniprotTopology(uniprotFeature);
|
|
11241
|
+
if (uniprotTopology) {
|
|
11242
|
+
data.push(uniprotTopology);
|
|
11243
|
+
}
|
|
11244
|
+
});
|
|
11245
|
+
return [2 /*return*/, data];
|
|
11246
|
+
case 2: return [2 /*return*/, []];
|
|
11247
|
+
}
|
|
11248
|
+
});
|
|
11249
|
+
}); },
|
|
11250
|
+
onError: function () {
|
|
11251
|
+
// fail silently
|
|
11252
|
+
},
|
|
11253
|
+
}, [])
|
|
11254
|
+
});
|
|
10949
11255
|
Object.defineProperty(this, "dbPtmData", {
|
|
10950
11256
|
enumerable: true,
|
|
10951
11257
|
configurable: true,
|
|
@@ -11079,7 +11385,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11079
11385
|
value: remoteData({
|
|
11080
11386
|
await: function () { return [_this.oncoKbCancerGenes]; },
|
|
11081
11387
|
invoke: function () {
|
|
11082
|
-
return Promise.resolve(
|
|
11388
|
+
return Promise.resolve(___default.reduce(_this.oncoKbCancerGenes.result, function (map, next) {
|
|
11083
11389
|
if (next.oncokbAnnotated) {
|
|
11084
11390
|
map[next.entrezGeneId] = true;
|
|
11085
11391
|
}
|
|
@@ -11153,7 +11459,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11153
11459
|
return __generator(this, function (_b) {
|
|
11154
11460
|
switch (_b.label) {
|
|
11155
11461
|
case 0:
|
|
11156
|
-
if (!!
|
|
11462
|
+
if (!!___default.isEmpty(this.getMutations())) return [3 /*break*/, 2];
|
|
11157
11463
|
return [4 /*yield*/, this.dataFetcher.fetchVariantAnnotationsIndexedByGenomicLocation(this.getMutations(), this.annotationFields, this.isoformOverrideSource)];
|
|
11158
11464
|
case 1:
|
|
11159
11465
|
_a = _b.sent();
|
|
@@ -11181,7 +11487,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11181
11487
|
return __generator(this, function (_b) {
|
|
11182
11488
|
switch (_b.label) {
|
|
11183
11489
|
case 0:
|
|
11184
|
-
if (!!
|
|
11490
|
+
if (!!___default.isEmpty(this.getMutations())) return [3 /*break*/, 2];
|
|
11185
11491
|
return [4 /*yield*/, this.dataFetcher.fetchMyVariantInfoAnnotationsIndexedByGenomicLocation(this.getMutations(), this.isoformOverrideSource)];
|
|
11186
11492
|
case 1:
|
|
11187
11493
|
_a = _b.sent();
|
|
@@ -11240,7 +11546,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11240
11546
|
});
|
|
11241
11547
|
Object.defineProperty(DefaultMutationMapperStore.prototype, "annotationFields", {
|
|
11242
11548
|
get: function () {
|
|
11243
|
-
return
|
|
11549
|
+
return ___default.uniq(['annotation_summary', 'hotspots'].concat(this.config.annotationFields || []));
|
|
11244
11550
|
},
|
|
11245
11551
|
enumerable: false,
|
|
11246
11552
|
configurable: true
|
|
@@ -11267,7 +11573,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11267
11573
|
else if (this.config.filterMutationsBySelectedTranscript &&
|
|
11268
11574
|
this.activeTranscript.result &&
|
|
11269
11575
|
this.indexedVariantAnnotations.result &&
|
|
11270
|
-
!
|
|
11576
|
+
!___default.isEmpty(this.indexedVariantAnnotations.result)) {
|
|
11271
11577
|
return this.getAnnotatedMutations(this.activeTranscript.result);
|
|
11272
11578
|
}
|
|
11273
11579
|
else {
|
|
@@ -11327,7 +11633,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11327
11633
|
});
|
|
11328
11634
|
Object.defineProperty(DefaultMutationMapperStore.prototype, "mutationsByPosition", {
|
|
11329
11635
|
get: function () {
|
|
11330
|
-
return groupMutationsByProteinStartPos(
|
|
11636
|
+
return groupMutationsByProteinStartPos(___default.flatten(this.dataStore.sortedFilteredData));
|
|
11331
11637
|
},
|
|
11332
11638
|
enumerable: false,
|
|
11333
11639
|
configurable: true
|
|
@@ -11336,7 +11642,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11336
11642
|
get: function () {
|
|
11337
11643
|
return this.dataStore.sortedFilteredGroupedData.map(function (groupedData) { return ({
|
|
11338
11644
|
group: groupedData.group,
|
|
11339
|
-
mutations: groupMutationsByProteinStartPos(
|
|
11645
|
+
mutations: groupMutationsByProteinStartPos(___default.flatten(groupedData.data)),
|
|
11340
11646
|
}); });
|
|
11341
11647
|
},
|
|
11342
11648
|
enumerable: false,
|
|
@@ -11389,7 +11695,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11389
11695
|
});
|
|
11390
11696
|
Object.defineProperty(DefaultMutationMapperStore.prototype, "transcriptsByTranscriptId", {
|
|
11391
11697
|
get: function () {
|
|
11392
|
-
return
|
|
11698
|
+
return ___default.keyBy(this.allTranscripts.result, function (transcript) { return transcript.transcriptId; });
|
|
11393
11699
|
},
|
|
11394
11700
|
enumerable: false,
|
|
11395
11701
|
configurable: true
|
|
@@ -11474,7 +11780,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
|
|
|
11474
11780
|
if (this.indexedVariantAnnotations.result &&
|
|
11475
11781
|
this.transcriptsWithAnnotations.result &&
|
|
11476
11782
|
this.canonicalTranscript.isComplete) {
|
|
11477
|
-
return
|
|
11783
|
+
return ___default.fromPairs(this.transcriptsWithAnnotations.result.map(function (t) { return [
|
|
11478
11784
|
t,
|
|
11479
11785
|
_this.getAnnotatedMutations(t),
|
|
11480
11786
|
]; }));
|
|
@@ -11708,7 +12014,7 @@ var TranscriptDropdown = /** @class */ (function (_super) {
|
|
|
11708
12014
|
// then ones with refseq id
|
|
11709
12015
|
// then protein length
|
|
11710
12016
|
// lastly the ensembl id
|
|
11711
|
-
transcripts =
|
|
12017
|
+
transcripts = ___default.orderBy(transcripts, [
|
|
11712
12018
|
function (t) {
|
|
11713
12019
|
return canonicalTranscript.result &&
|
|
11714
12020
|
t === canonicalTranscript.result.transcriptId;
|
|
@@ -12056,7 +12362,7 @@ var MutationMapper = /** @class */ (function (_super) {
|
|
|
12056
12362
|
this.isFiltered &&
|
|
12057
12363
|
this.filterResetPanel
|
|
12058
12364
|
? this.filterResetPanel
|
|
12059
|
-
: undefined, trackDataStatus: this.trackDataStatus, showTrackSelector: this.props.showTrackSelector, onXAxisOffset: this.onXAxisOffset, onTrackVisibilityChange: this.props.onTrackVisibilityChange, getMutationCount: this.props.getMutationCount, getLollipopColor: this.props.getLollipopColor, yMaxLabelPostfix: this.plotYMaxLabelPostfix, yMaxFractionDigits: this.props.plotYMaxFractionDigits, yAxisLabelPadding: this.props.plotYAxisLabelPadding, showYAxis: this.props.showPlotYAxis, topYAxisSymbol: this.plotTopYAxisSymbol, bottomYAxisSymbol: this.plotBottomYAxisSymbol, topYAxisDefaultMax: this.plotTopYAxisDefaultMax, topYAxisDefaultMin: this.plotBottomYAxisDefaultMin, bottomYAxisDefaultMax: this.plotBottomYAxisDefaultMax, bottomYAxisDefaultMin: this.plotBottomYAxisDefaultMin, lollipopTooltipCountInfo: this.props.plotLollipopTooltipCountInfo, collapsePtmTrack: this.props.collapsePtmTrack }));
|
|
12365
|
+
: undefined, trackDataStatus: this.trackDataStatus, showTrackSelector: this.props.showTrackSelector, onXAxisOffset: this.onXAxisOffset, onTrackVisibilityChange: this.props.onTrackVisibilityChange, getMutationCount: this.props.getMutationCount, getLollipopColor: this.props.getLollipopColor, yMaxLabelPostfix: this.plotYMaxLabelPostfix, yMaxFractionDigits: this.props.plotYMaxFractionDigits, yAxisLabelPadding: this.props.plotYAxisLabelPadding, showYAxis: this.props.showPlotYAxis, topYAxisSymbol: this.plotTopYAxisSymbol, bottomYAxisSymbol: this.plotBottomYAxisSymbol, topYAxisDefaultMax: this.plotTopYAxisDefaultMax, topYAxisDefaultMin: this.plotBottomYAxisDefaultMin, bottomYAxisDefaultMax: this.plotBottomYAxisDefaultMax, bottomYAxisDefaultMin: this.plotBottomYAxisDefaultMin, lollipopTooltipCountInfo: this.props.plotLollipopTooltipCountInfo, collapsePtmTrack: this.props.collapsePtmTrack, collapseUniprotTopologyTrack: this.props.collapseUniprotTopologyTrack }));
|
|
12060
12366
|
},
|
|
12061
12367
|
enumerable: false,
|
|
12062
12368
|
configurable: true
|