react-mutation-mapper 0.8.50 → 0.8.53

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
@@ -488,6 +488,15 @@ function getTumorTypeName(tumorType) {
488
488
  return '';
489
489
  }
490
490
  }
491
+ function getTumorTypeNameWithExclusionInfo(tumorType, excludedTumorTypes) {
492
+ var name = getTumorTypeName(tumorType);
493
+ if (!___default["default"].isEmpty(excludedTumorTypes)) {
494
+ name = name + " (excluding " + excludedTumorTypes
495
+ .map(function (ett) { return getTumorTypeName(ett); })
496
+ .join(', ') + ")";
497
+ }
498
+ return name;
499
+ }
491
500
  function groupOncoKbIndicatorDataByMutations(mutationsByPosition, oncoKbData, getTumorType, getEntrezGeneId, filter) {
492
501
  var indicatorMap = {};
493
502
  ___default["default"].keys(mutationsByPosition).forEach(function (key) {
@@ -843,6 +852,14 @@ var OncoKBSuggestAnnotationLinkout = /** @class */ (function (_super) {
843
852
  return OncoKBSuggestAnnotationLinkout;
844
853
  }(React__namespace.Component));
845
854
 
855
+ var levelTooltipContent = function (level) {
856
+ return (React__namespace.createElement("div", { style: { maxWidth: '200px' } }, OncoKbHelper.LEVEL_DESC[level]));
857
+ };
858
+ var LevelIcon = function (props) {
859
+ return (React__namespace.createElement(cbioportalFrontendCommons.DefaultTooltip, { overlay: levelTooltipContent(props.level), placement: "left", disabled: !props.showDescription, trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
860
+ React__namespace.createElement("i", { className: levelIconClassNames(props.level) })));
861
+ };
862
+
846
863
  var OncoKbHelper = /** @class */ (function () {
847
864
  function OncoKbHelper() {
848
865
  }
@@ -981,7 +998,6 @@ var OncoKbHelper = /** @class */ (function () {
981
998
  configurable: true,
982
999
  writable: true,
983
1000
  value: function (columnKey) {
984
- var _this = this;
985
1001
  switch (columnKey) {
986
1002
  case 'level':
987
1003
  return {
@@ -994,8 +1010,7 @@ var OncoKbHelper = /** @class */ (function () {
994
1010
  },
995
1011
  Cell: function (props) {
996
1012
  var normalizedLevel = normalizeLevel(props.value) || '';
997
- return (React__namespace.createElement(cbioportalFrontendCommons.DefaultTooltip, { overlay: _this.levelTooltipContent(normalizedLevel), placement: "left", trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
998
- React__namespace.createElement("i", { className: levelIconClassNames(normalizedLevel), style: { margin: 'auto' } })));
1013
+ return (React__namespace.createElement(LevelIcon, { level: normalizedLevel, showDescription: true }));
999
1014
  },
1000
1015
  };
1001
1016
  case 'alterations':
@@ -1011,14 +1026,6 @@ var OncoKbHelper = /** @class */ (function () {
1011
1026
  }
1012
1027
  }
1013
1028
  });
1014
- Object.defineProperty(OncoKbHelper, "levelTooltipContent", {
1015
- enumerable: true,
1016
- configurable: true,
1017
- writable: true,
1018
- value: function (level) {
1019
- return (React__namespace.createElement("div", { style: { maxWidth: '200px' } }, OncoKbHelper.LEVEL_DESC[level]));
1020
- }
1021
- });
1022
1029
  Object.defineProperty(OncoKbHelper, "getAlterationsColumnCell", {
1023
1030
  enumerable: true,
1024
1031
  configurable: true,
@@ -1321,7 +1328,7 @@ var OncoKbTreatmentTable = /** @class */ (function (_super) {
1321
1328
  "cancer type(s)")),
1322
1329
  accessor: 'levelAssociatedCancerType',
1323
1330
  minWidth: 120,
1324
- Cell: function (props) { return (React__namespace.createElement("div", { style: { whiteSpace: 'normal', lineHeight: '1rem' } }, getTumorTypeName(props.original.levelAssociatedCancerType))); },
1331
+ Cell: function (props) { return (React__namespace.createElement("div", { style: { whiteSpace: 'normal', lineHeight: '1rem' } }, getTumorTypeNameWithExclusionInfo(props.original.levelAssociatedCancerType, props.original.levelExcludedCancerTypes))); },
1325
1332
  },
1326
1333
  {
1327
1334
  id: 'referenceList',
@@ -1384,6 +1391,11 @@ var ImplicationContent = function (props) {
1384
1391
 
1385
1392
  var tabsStyles = {"tabs-wrapper":"tabs-module_tabs-wrapper__XKjzo","tabs":"tabs-module_tabs__2I3mz","tab":"tabs-module_tab__3MoDA","tab-pane":"tabs-module_tab-pane__sGd85","tab-title-a":"tabs-module_tab-title-a__2WTNA","tab-title":"tabs-module_tab-title__2z9-D","tab-subtitle":"tabs-module_tab-subtitle__1P8B_"};
1386
1393
 
1394
+ var OncogenicIcon = function (props) {
1395
+ return (React__namespace.createElement(cbioportalFrontendCommons.DefaultTooltip, { overlay: React__namespace.createElement("span", null, props.oncogenicity), placement: "left", trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
1396
+ React__namespace.createElement("i", { className: oncogenicityIconClassNames(props.oncogenicity) })));
1397
+ };
1398
+
1387
1399
  var _a$3;
1388
1400
  var OncoKbMedicalDisclaimer = (React__default["default"].createElement("p", { className: mainStyles.disclaimer }, "The information above is intended for research purposes only and should not be used as a substitute for professional diagnosis and treatment."));
1389
1401
  var ONCOKB_DATA_ACCESS_PAGE_LINK = 'https://docs.cbioportal.org/2.4-integration-with-other-webservices/oncokb-data-access';
@@ -1405,8 +1417,9 @@ var TabContentWrapper = function (props) {
1405
1417
  return React__default["default"].createElement("div", { className: mainStyles['tab-content'] }, props.children);
1406
1418
  };
1407
1419
  var TabTitle = function (props) {
1420
+ var _a;
1408
1421
  var title = DATA_TYPE_TO_TITLE[props.type];
1409
- var icon = props.displayHighestLevelInTabTitle ? (React__default["default"].createElement("i", { className: annotationIconClassNames(props.type, calcHighestIndicatorLevel(props.type, props.indicator), props.indicator) })) : null;
1422
+ var icon = props.displayHighestLevelInTabTitle ? (props.type === cbioportalUtils.OncoKbCardDataType.BIOLOGICAL ? (React__default["default"].createElement(OncogenicIcon, { oncogenicity: ((_a = props.indicator) === null || _a === void 0 ? void 0 : _a.oncogenic) || '', showDescription: true })) : (React__default["default"].createElement(LevelIcon, { level: normalizeLevel(calcHighestIndicatorLevel(props.type, props.indicator)) || '', showDescription: true }))) : null;
1410
1423
  return icon ? (React__default["default"].createElement("span", { style: { display: 'flex' } },
1411
1424
  icon,
1412
1425
  " ",
@@ -2137,7 +2150,7 @@ function getDefaultEntrezGeneId(mutation) {
2137
2150
  return (mutation.gene && mutation.gene.entrezGeneId) || 0;
2138
2151
  }
2139
2152
  function getDefaultTumorType() {
2140
- return 'Unknown';
2153
+ return '';
2141
2154
  }
2142
2155
  var memoized = new Map();
2143
2156
  function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGenomeData, oncoKbData, usingPublicOncoKbInstance, civicGenes, civicVariants, resolveTumorType, resolveEntrezGeneId) {
@@ -8213,9 +8226,7 @@ var OncoKbSummaryTable = /** @class */ (function (_super) {
8213
8226
  overflow: 'hidden',
8214
8227
  textOverflow: 'ellipsis',
8215
8228
  } },
8216
- React__namespace.createElement("i", { className: levelIconClassNames(level.level), style: {
8217
- verticalAlign: 'text-bottom',
8218
- } }),
8229
+ React__namespace.createElement(LevelIcon, { level: level.level, showDescription: true }),
8219
8230
  React__namespace.createElement("span", { style: {
8220
8231
  paddingRight: 3,
8221
8232
  } }, ":"),
@@ -8335,7 +8346,7 @@ function generateLevelData(indicatorData) {
8335
8346
  var parts = treatment.level.split('_');
8336
8347
  var level = parts.length === 2 ? parts[1] : treatment.level;
8337
8348
  levels[level] = levels[level] || [];
8338
- levels[level].push(indicator.query.tumorType);
8349
+ levels[level].push(getTumorTypeNameWithExclusionInfo(treatment.levelAssociatedCancerType, treatment.levelExcludedCancerTypes));
8339
8350
  });
8340
8351
  });
8341
8352
  return ___default["default"].keys(levels)
@@ -10643,7 +10654,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
10643
10654
  writable: true,
10644
10655
  value: function (mutations, fields, isoformOverrideSource, client) {
10645
10656
  if (fields === void 0) { fields = ['annotation_summary']; }
10646
- if (isoformOverrideSource === void 0) { isoformOverrideSource = 'uniprot'; }
10657
+ if (isoformOverrideSource === void 0) { isoformOverrideSource = 'mskcc'; }
10647
10658
  if (client === void 0) { client = this.genomeNexusClient; }
10648
10659
  return tslib.__awaiter(this, void 0, void 0, function () {
10649
10660
  return tslib.__generator(this, function (_a) {
@@ -12069,7 +12080,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
12069
12080
  value: function (mutation) {
12070
12081
  return this.config.getTumorType
12071
12082
  ? this.config.getTumorType(mutation)
12072
- : 'Unknown';
12083
+ : '';
12073
12084
  }
12074
12085
  });
12075
12086
  Object.defineProperty(DefaultMutationMapperStore.prototype, "getDefaultEntrezGeneId", {
@@ -12977,6 +12988,7 @@ exports.getProteinImpactTypeOptionLabel = getProteinImpactTypeOptionLabel;
12977
12988
  exports.getSelectedOptionValues = getSelectedOptionValues;
12978
12989
  exports.getSignalData = getSignalData;
12979
12990
  exports.getSingleSignalValue = getSingleSignalValue;
12991
+ exports.getTumorTypeNameWithExclusionInfo = getTumorTypeNameWithExclusionInfo;
12980
12992
  exports.getUrl = getUrl;
12981
12993
  exports.gnomadDownload = download$2;
12982
12994
  exports.gnomadSortValue = sortValue$1;