react-mutation-mapper 0.8.81 → 0.8.83

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/index.js CHANGED
@@ -52,6 +52,7 @@ function _interopNamespace(e) {
52
52
  var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
53
53
  var ___namespace = /*#__PURE__*/_interopNamespace(_);
54
54
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
55
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
55
56
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
56
57
  var autobind__default = /*#__PURE__*/_interopDefaultLegacy(autobind);
57
58
  var ReactTable__default = /*#__PURE__*/_interopDefaultLegacy(ReactTable);
@@ -187,7 +188,7 @@ function hideArrow(tooltipEl) {
187
188
  var arrowEl = tooltipEl.querySelector('.rc-tooltip-arrow');
188
189
  arrowEl.style.display = 'none';
189
190
  }
190
- function sortValue$7(civicEntry) {
191
+ function sortValue$8(civicEntry) {
191
192
  var score = 0;
192
193
  if (civicEntry) {
193
194
  score = 1;
@@ -308,7 +309,7 @@ function placeArrow$1(tooltipEl) {
308
309
  var arrowEl = tooltipEl.querySelector('.rc-tooltip-arrow');
309
310
  arrowEl.style.left = '10px';
310
311
  }
311
- function sortValue$6(links) {
312
+ function sortValue$7(links) {
312
313
  return links.length > 0 ? 1 : 0;
313
314
  }
314
315
  function download$5(links) {
@@ -432,7 +433,7 @@ var img$1 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3
432
433
 
433
434
  var img = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3c!-- Generator: Adobe Illustrator 16.0.4%2c SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='24.263px' height='36.366px' viewBox='0 0 24.263 36.366' enable-background='new 0 0 24.263 36.366' xml:space='preserve'%3e%3cg%3e %3cpath fill='%23FF9900' d='M6.828%2c27.947c-1.859-3.872-0.869-6.094%2c0.564-8.184c1.565-2.296%2c1.968-4.558%2c1.968-4.558 s1.231%2c1.6%2c0.742%2c4.104c2.181-2.423%2c2.591-6.286%2c2.256-7.764c4.921%2c3.436%2c7.027%2c10.889%2c4.19%2c16.401 C31.627%2c19.419%2c20.3%2c6.66%2c18.326%2c5.221c0.656%2c1.439%2c0.783%2c3.873-0.546%2c5.053C15.536%2c1.75%2c9.98%2c0%2c9.98%2c0 c0.657%2c4.397-2.388%2c9.208-5.316%2c12.8C4.56%2c11.046%2c4.451%2c9.831%2c3.53%2c8.155c-0.201%2c3.183-2.636%2c5.785-3.298%2c8.974 C-0.659%2c21.445%2c0.9%2c24.61%2c6.828%2c27.947L6.828%2c27.947z'/%3e %3ctext transform='matrix(0.583 0 0 0.583 3.7324 36.1963)' fill='black' font-family='Arial-BoldItalicMT' font-size='20.6802'%3e3D%3c/text%3e%3c/g%3e%3c/svg%3e";
434
435
 
435
- function sortValue$5(isHotspot, is3dHotspot) {
436
+ function sortValue$6(isHotspot, is3dHotspot) {
436
437
  var score = 0;
437
438
  if (isHotspot) {
438
439
  score += 1;
@@ -593,6 +594,42 @@ function initOncoKbClient(oncoKbUrl, cachePostMethods, apiCacheLimit) {
593
594
  return client;
594
595
  }
595
596
 
597
+ var RevueTooltipContent = function (props) {
598
+ return (React__default["default"].createElement("div", null,
599
+ props.vue.comment,
600
+ ' ',
601
+ React__default["default"].createElement("a", { href: "https://pubmed.ncbi.nlm.nih.gov/" + props.vue.pubmedIds[0] + "/", rel: "noopener noreferrer", target: "_blank" },
602
+ "(",
603
+ props.vue.referenceText,
604
+ ")"),
605
+ React__default["default"].createElement("ul", null,
606
+ React__default["default"].createElement("li", null,
607
+ "Predicted Effect: ",
608
+ React__default["default"].createElement("strong", null, props.vue.defaultEffect)),
609
+ React__default["default"].createElement("li", null,
610
+ "Experimentally Validated Effect:",
611
+ ' ',
612
+ React__default["default"].createElement("strong", null, props.vue.variantClassification)),
613
+ React__default["default"].createElement("li", null,
614
+ "Revised Protein Effect:",
615
+ ' ',
616
+ React__default["default"].createElement("strong", null, props.vue.revisedProteinEffect))),
617
+ React__default["default"].createElement("div", null,
618
+ "Source:",
619
+ ' ',
620
+ React__default["default"].createElement("a", { href: "https://cancerrevue.org", target: "_blank", rel: "noopener noreferrer" },
621
+ "reVUE ",
622
+ React__default["default"].createElement("i", { className: "fa fa-external-link" })))));
623
+ };
624
+ function sortValue$5(vue) {
625
+ return vue ? 1 : 0;
626
+ }
627
+ var RevueCell = function (props) {
628
+ return (React__default["default"].createElement(cbioportalFrontendCommons.DefaultTooltip, { placement: "bottom", overlay: React__default["default"].createElement(RevueTooltipContent, { vue: props.vue }) },
629
+ React__default["default"].createElement("span", { className: "" + annotationStyles['annotation-item'], style: { display: 'inline-flex' } },
630
+ React__default["default"].createElement("img", { src: '../../images/vue_logo.png', alt: "reVUE logo", width: 14, height: 14 }))));
631
+ };
632
+
596
633
  var DEFAULT_ANNOTATION_DATA = {
597
634
  oncoKbStatus: 'complete',
598
635
  oncoKbGeneExist: false,
@@ -614,18 +651,15 @@ function getDefaultTumorType() {
614
651
  return '';
615
652
  }
616
653
  var memoized = new Map();
617
- function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGenomeData, oncoKbData, usingPublicOncoKbInstance, civicGenes, civicVariants, resolveTumorType, resolveEntrezGeneId) {
654
+ function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGenomeData, oncoKbData, usingPublicOncoKbInstance, civicGenes, civicVariants, indexedVariantAnnotations, resolveTumorType, resolveEntrezGeneId) {
655
+ var _a, _b;
618
656
  if (resolveTumorType === void 0) { resolveTumorType = getDefaultTumorType; }
619
657
  if (resolveEntrezGeneId === void 0) { resolveEntrezGeneId = getDefaultEntrezGeneId; }
620
658
  var value;
621
659
  if (mutation) {
622
660
  var key = '';
623
- var memoize = !!oncoKbCancerGenes && (oncoKbCancerGenes === null || oncoKbCancerGenes === void 0 ? void 0 : oncoKbCancerGenes.isComplete) &&
624
- !!hotspotData && (hotspotData === null || hotspotData === void 0 ? void 0 : hotspotData.isComplete) &&
625
- !!myCancerGenomeData &&
626
- !!oncoKbData && (oncoKbData === null || oncoKbData === void 0 ? void 0 : oncoKbData.isComplete) &&
627
- !!civicGenes && (civicGenes === null || civicGenes === void 0 ? void 0 : civicGenes.isComplete) &&
628
- !!civicVariants && (civicVariants === null || civicVariants === void 0 ? void 0 : civicVariants.isComplete);
661
+ var memoize = (oncoKbCancerGenes === null || oncoKbCancerGenes === void 0 ? void 0 : oncoKbCancerGenes.isComplete) && (hotspotData === null || hotspotData === void 0 ? void 0 : hotspotData.isComplete) &&
662
+ !!myCancerGenomeData && (oncoKbData === null || oncoKbData === void 0 ? void 0 : oncoKbData.isComplete) && (civicGenes === null || civicGenes === void 0 ? void 0 : civicGenes.isComplete) && (civicVariants === null || civicVariants === void 0 ? void 0 : civicVariants.isComplete) && (indexedVariantAnnotations === null || indexedVariantAnnotations === void 0 ? void 0 : indexedVariantAnnotations.isComplete);
629
663
  if (memoize) {
630
664
  key = JSON.stringify(mutation) + !!usingPublicOncoKbInstance;
631
665
  var val = memoized.get(key);
@@ -675,17 +709,16 @@ function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGen
675
709
  myCancerGenomeLinks: myCancerGenomeData
676
710
  ? cbioportalUtils.getMyCancerGenomeLinks(mutation, myCancerGenomeData)
677
711
  : [],
678
- isHotspot: hotspotData &&
679
- hotspotData.result &&
680
- hotspotData.status === 'complete'
712
+ isHotspot: (hotspotData === null || hotspotData === void 0 ? void 0 : hotspotData.isComplete) && hotspotData.result
681
713
  ? cbioportalUtils.isLinearClusterHotspot(mutation, hotspotData.result)
682
714
  : false,
683
- is3dHotspot: hotspotData &&
684
- hotspotData.result &&
685
- hotspotData.status === 'complete'
715
+ is3dHotspot: (hotspotData === null || hotspotData === void 0 ? void 0 : hotspotData.isComplete) && hotspotData.result
686
716
  ? cbioportalUtils.is3dHotspot(mutation, hotspotData.result)
687
717
  : false,
688
718
  hotspotStatus: hotspotData ? hotspotData.status : 'pending',
719
+ vue: (indexedVariantAnnotations === null || indexedVariantAnnotations === void 0 ? void 0 : indexedVariantAnnotations.isComplete) &&
720
+ indexedVariantAnnotations.result
721
+ ? (_b = (_a = cbioportalUtils.getVariantAnnotation(mutation, indexedVariantAnnotations.result)) === null || _a === void 0 ? void 0 : _a.annotation_summary) === null || _b === void 0 ? void 0 : _b.vues : undefined,
689
722
  };
690
723
  // oncoKbData may exist but it might be an instance of Error, in that case we flag the status as error
691
724
  if (oncoKbData && oncoKbData.result instanceof Error) {
@@ -730,16 +763,18 @@ function annotationSortMethod(a, b) {
730
763
  function sortValue$4(annotation) {
731
764
  return ___default["default"].flatten([
732
765
  oncokbFrontendCommons.oncoKbAnnotationSortValue(annotation.oncoKbIndicator),
733
- sortValue$7(annotation.civicEntry),
734
- sortValue$6(annotation.myCancerGenomeLinks),
735
- sortValue$5(annotation.isHotspot, annotation.is3dHotspot),
766
+ sortValue$8(annotation.civicEntry),
767
+ sortValue$7(annotation.myCancerGenomeLinks),
768
+ sortValue$6(annotation.isHotspot, annotation.is3dHotspot),
769
+ sortValue$5(annotation.vue),
736
770
  annotation.isOncoKbCancerGene ? 1 : 0,
737
771
  ]);
738
772
  }
739
773
  function GenericAnnotation(props) {
740
- var annotation = props.annotation, enableCivic = props.enableCivic, enableHotspot = props.enableHotspot, enableMyCancerGenome = props.enableMyCancerGenome, enableOncoKb = props.enableOncoKb; props.pubMedCache; var userDisplayName = props.userDisplayName, mergeOncoKbIcons = props.mergeOncoKbIcons, oncoKbContentPadding = props.oncoKbContentPadding;
774
+ var annotation = props.annotation, enableCivic = props.enableCivic, enableHotspot = props.enableHotspot, enableMyCancerGenome = props.enableMyCancerGenome, enableOncoKb = props.enableOncoKb, enableRevue = props.enableRevue; props.pubMedCache; var userDisplayName = props.userDisplayName, mergeOncoKbIcons = props.mergeOncoKbIcons, oncoKbContentPadding = props.oncoKbContentPadding;
741
775
  return (React__namespace.createElement("span", { style: { display: 'flex', minWidth: 100 } },
742
776
  enableOncoKb && (React__namespace.createElement(oncokbFrontendCommons.OncoKB, { usingPublicOncoKbInstance: annotation.usingPublicOncoKbInstance, hugoGeneSymbol: annotation.hugoGeneSymbol, geneNotExist: !annotation.oncoKbGeneExist, isCancerGene: annotation.isOncoKbCancerGene, status: annotation.oncoKbStatus, indicator: annotation.oncoKbIndicator, availableDataTypes: annotation.oncoKbAvailableDataTypes, mergeAnnotationIcons: mergeOncoKbIcons, userDisplayName: userDisplayName, contentPadding: oncoKbContentPadding })),
777
+ enableRevue && annotation.vue ? (React__namespace.createElement(RevueCell, { vue: annotation.vue })) : (React__namespace.createElement("span", { className: "" + annotationStyles['annotation-item'] })),
743
778
  enableCivic && (React__namespace.createElement(Civic, { civicEntry: annotation.civicEntry, civicStatus: annotation.civicStatus, hasCivicVariants: annotation.hasCivicVariants })),
744
779
  enableMyCancerGenome && (React__namespace.createElement(MyCancerGenome, { linksHTML: annotation.myCancerGenomeLinks })),
745
780
  enableHotspot && (React__namespace.createElement(HotspotAnnotation, { isHotspot: annotation.isHotspot, is3dHotspot: annotation.is3dHotspot, status: annotation.hotspotStatus }))));
@@ -763,8 +798,8 @@ var Annotation = /** @class */ (function (_super) {
763
798
  configurable: true,
764
799
  writable: true,
765
800
  value: function (props) {
766
- var mutation = props.mutation, oncoKbCancerGenes = props.oncoKbCancerGenes, hotspotData = props.hotspotData, myCancerGenomeData = props.myCancerGenomeData, oncoKbData = props.oncoKbData, usingPublicOncoKbInstance = props.usingPublicOncoKbInstance, resolveEntrezGeneId = props.resolveEntrezGeneId, resolveTumorType = props.resolveTumorType, civicGenes = props.civicGenes, civicVariants = props.civicVariants;
767
- return getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGenomeData, oncoKbData, usingPublicOncoKbInstance, civicGenes, civicVariants, resolveTumorType, resolveEntrezGeneId);
801
+ var mutation = props.mutation, oncoKbCancerGenes = props.oncoKbCancerGenes, hotspotData = props.hotspotData, myCancerGenomeData = props.myCancerGenomeData, oncoKbData = props.oncoKbData, usingPublicOncoKbInstance = props.usingPublicOncoKbInstance, resolveEntrezGeneId = props.resolveEntrezGeneId, resolveTumorType = props.resolveTumorType, civicGenes = props.civicGenes, civicVariants = props.civicVariants, indexedVariantAnnotations = props.indexedVariantAnnotations;
802
+ return getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGenomeData, oncoKbData, usingPublicOncoKbInstance, civicGenes, civicVariants, indexedVariantAnnotations, resolveTumorType, resolveEntrezGeneId);
768
803
  }
769
804
  });
770
805
  Annotation = tslib.__decorate([
@@ -3658,7 +3693,7 @@ var DefaultMutationTable = /** @class */ (function (_super) {
3658
3693
  return this.annotationColumnDataStatus === 'pending'
3659
3694
  ? function () { return undefined; }
3660
3695
  : function (mutation) {
3661
- return getAnnotationData(mutation, _this.props.oncoKbCancerGenes, _this.props.hotspotData, _this.props.myCancerGenomeData, _this.props.oncoKbData, _this.props.usingPublicOncoKbInstance, _this.props.civicGenes, _this.props.civicVariants);
3696
+ return getAnnotationData(mutation, _this.props.oncoKbCancerGenes, _this.props.hotspotData, _this.props.myCancerGenomeData, _this.props.oncoKbData, _this.props.usingPublicOncoKbInstance, _this.props.civicGenes, _this.props.civicVariants, _this.props.indexedVariantAnnotations);
3662
3697
  };
3663
3698
  },
3664
3699
  enumerable: false,
@@ -3761,7 +3796,7 @@ var DefaultMutationTable = /** @class */ (function (_super) {
3761
3796
  var _this = this;
3762
3797
  switch (columnKey) {
3763
3798
  case exports.MutationColumn.ANNOTATION:
3764
- return function (column) { return (React__namespace.createElement(Annotation, { mutation: column.original, enableOncoKb: true, enableHotspot: true, enableCivic: _this.props.enableCivic || false, enableMyCancerGenome: true, hotspotData: _this.props.hotspotData, oncoKbData: _this.props.oncoKbData, oncoKbCancerGenes: _this.props.oncoKbCancerGenes, usingPublicOncoKbInstance: _this.props.usingPublicOncoKbInstance, pubMedCache: _this.props.pubMedCache, civicGenes: _this.props.civicGenes, civicVariants: _this.props.civicVariants })); };
3799
+ return function (column) { return (React__namespace.createElement(Annotation, { mutation: column.original, enableOncoKb: true, enableHotspot: true, enableCivic: _this.props.enableCivic || false, enableMyCancerGenome: true, enableRevue: true, hotspotData: _this.props.hotspotData, oncoKbData: _this.props.oncoKbData, oncoKbCancerGenes: _this.props.oncoKbCancerGenes, usingPublicOncoKbInstance: _this.props.usingPublicOncoKbInstance, pubMedCache: _this.props.pubMedCache, civicGenes: _this.props.civicGenes, civicVariants: _this.props.civicVariants, indexedVariantAnnotations: _this.props.indexedVariantAnnotations })); };
3765
3800
  case exports.MutationColumn.HGVSG:
3766
3801
  return function (column) { return React__namespace.createElement(Hgvsg, { mutation: column.original }); };
3767
3802
  case exports.MutationColumn.HGVSC:
@@ -11016,6 +11051,7 @@ function initDefaultMutationMapperStore(props) {
11016
11051
  oncoKbUrl: props.oncoKbUrl,
11017
11052
  enableCivic: props.enableCivic,
11018
11053
  enableOncoKb: props.enableOncoKb,
11054
+ enableRevue: props.enableRevue,
11019
11055
  cachePostMethodsOnClients: props.cachePostMethodsOnClients,
11020
11056
  apiCacheLimit: props.apiCacheLimit,
11021
11057
  getMutationCount: props.getMutationCount,
@@ -11223,7 +11259,7 @@ var MutationMapper = /** @class */ (function (_super) {
11223
11259
  if (this.props.mutationTableColumns) {
11224
11260
  columns = this.props.mutationTableColumns;
11225
11261
  }
11226
- return (React__namespace.createElement(DefaultMutationTable, { dataStore: this.store.dataStore, columns: columns, initialSort: this.props.mutationTableInitialSort, initialSortRemoteData: this.props.mutationTableInitialSortRemoteData, reactTableProps: this.props.customMutationTableProps, hotspotData: this.store.indexedHotspotData, oncoKbData: this.store.oncoKbData, usingPublicOncoKbInstance: this.store.usingPublicOncoKbInstance, oncoKbCancerGenes: this.store.oncoKbCancerGenes, myCancerGenomeData: this.store.myCancerGenomeData, enableCivic: this.props.enableCivic, civicGenes: this.store.civicGenes, civicVariants: this.store.civicVariants, indexedMyVariantInfoAnnotations: this.store.indexedMyVariantInfoAnnotations, indexedVariantAnnotations: this.store.indexedVariantAnnotations, selectedTranscriptId: this.store.selectedTranscript, pubMedCache: this.pubMedCache, info: this.mutationTableInfo }));
11262
+ return (React__namespace.createElement(DefaultMutationTable, { dataStore: this.store.dataStore, columns: columns, initialSort: this.props.mutationTableInitialSort, initialSortRemoteData: this.props.mutationTableInitialSortRemoteData, reactTableProps: this.props.customMutationTableProps, hotspotData: this.store.indexedHotspotData, oncoKbData: this.store.oncoKbData, usingPublicOncoKbInstance: this.store.usingPublicOncoKbInstance, oncoKbCancerGenes: this.store.oncoKbCancerGenes, myCancerGenomeData: this.store.myCancerGenomeData, enableCivic: this.props.enableCivic, enableRevue: this.props.enableRevue, civicGenes: this.store.civicGenes, civicVariants: this.store.civicVariants, indexedMyVariantInfoAnnotations: this.store.indexedMyVariantInfoAnnotations, indexedVariantAnnotations: this.store.indexedVariantAnnotations, selectedTranscriptId: this.store.selectedTranscript, pubMedCache: this.pubMedCache, info: this.mutationTableInfo }));
11227
11263
  }
11228
11264
  },
11229
11265
  enumerable: false,
@@ -11425,6 +11461,7 @@ var MutationMapper = /** @class */ (function (_super) {
11425
11461
  showTranscriptDropDown: false,
11426
11462
  enableCivic: true,
11427
11463
  enableOncoKb: true,
11464
+ enableRevue: true,
11428
11465
  filterMutationsBySelectedTranscript: false,
11429
11466
  cachePostMethodsOnClients: true,
11430
11467
  }
@@ -11520,6 +11557,8 @@ exports.PercentToggle = PercentToggle;
11520
11557
  exports.ProteinChange = ProteinChange;
11521
11558
  exports.ProteinImpactTypeBadgeSelector = ProteinImpactTypeBadgeSelector;
11522
11559
  exports.ProteinImpactTypeDropdownSelector = ProteinImpactTypeDropdownSelector;
11560
+ exports.RevueCell = RevueCell;
11561
+ exports.RevueTooltipContent = RevueTooltipContent;
11523
11562
  exports.Sequence = LollipopPlot;
11524
11563
  exports.Signal = Signal;
11525
11564
  exports.SignalTable = SignalTable;
@@ -11535,7 +11574,7 @@ exports.applyDefaultPositionFilter = applyDefaultPositionFilter;
11535
11574
  exports.applyDefaultProteinImpactTypeFilter = applyDefaultProteinImpactTypeFilter;
11536
11575
  exports.calculateGnomadAlleleFrequency = calculateGnomadAlleleFrequency;
11537
11576
  exports.civicDownload = download$6;
11538
- exports.civicSortValue = sortValue$7;
11577
+ exports.civicSortValue = sortValue$8;
11539
11578
  exports.clinvarDownload = download$4;
11540
11579
  exports.clinvarSortValue = sortValue$3;
11541
11580
  exports.dbsnpDownload = download$3;
@@ -11566,7 +11605,7 @@ exports.groupDataByProteinImpactType = groupDataByProteinImpactType;
11566
11605
  exports.handleOptionSelect = handleOptionSelect;
11567
11606
  exports.hgvscDownload = download$1;
11568
11607
  exports.hgvscSortValue = sortValue;
11569
- exports.hotspotAnnotationSortValue = sortValue$5;
11608
+ exports.hotspotAnnotationSortValue = sortValue$6;
11570
11609
  exports.includesSearchTextIgnoreCase = includesSearchTextIgnoreCase;
11571
11610
  exports.indexPositions = indexPositions;
11572
11611
  exports.initDefaultMutationMapperStore = initDefaultMutationMapperStore;
@@ -11577,7 +11616,7 @@ exports.initOncoKbClient = initOncoKbClient;
11577
11616
  exports.mergeColumns = mergeColumns;
11578
11617
  exports.mutationTypeSort = mutationTypeSort;
11579
11618
  exports.myCancerGenomeDownload = download$5;
11580
- exports.myCancerGenomeSortValue = sortValue$6;
11619
+ exports.myCancerGenomeSortValue = sortValue$7;
11581
11620
  exports.onFilterOptionSelect = onFilterOptionSelect;
11582
11621
  exports.proteinChangeSortMethod = proteinChangeSortMethod;
11583
11622
  exports.rightAlignedCell = rightAlignedCell;