react-mutation-mapper 0.8.33 → 0.8.36

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.
@@ -11,6 +11,8 @@ export default class ExonTrack extends React.Component<ExonTrackProps, {}> {
11
11
  constructor(props: any);
12
12
  get transcriptId(): string | undefined;
13
13
  get transcript(): EnsemblTranscript | undefined;
14
+ get chromosome(): string;
15
+ get genomeBuild(): string;
14
16
  get exonSpecs(): TrackItemSpec[];
15
17
  get trackTitle(): JSX.Element;
16
18
  render(): JSX.Element;
package/dist/index.es.js CHANGED
@@ -15,7 +15,7 @@ import { OncoKbAPI } from 'oncokb-ts-api-client';
15
15
  import Select, { components } from 'react-select';
16
16
  import $ from 'jquery';
17
17
  import Slider from 'react-rangeslider';
18
- import request from 'superagent';
18
+ import request, { get } from 'superagent';
19
19
  import memoize from 'memoize-weak-decorator';
20
20
  import { cached } from 'mobxpromise';
21
21
 
@@ -8467,8 +8467,24 @@ var ExonTrack = /** @class */ (function (_super) {
8467
8467
  enumerable: false,
8468
8468
  configurable: true
8469
8469
  });
8470
+ Object.defineProperty(ExonTrack.prototype, "chromosome", {
8471
+ get: function () {
8472
+ var _a, _b;
8473
+ return (_b = (_a = this.props.store.ensemblTranscriptLookUp.result) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.seq_region_name;
8474
+ },
8475
+ enumerable: false,
8476
+ configurable: true
8477
+ });
8478
+ Object.defineProperty(ExonTrack.prototype, "genomeBuild", {
8479
+ get: function () {
8480
+ return this.props.store.genomeBuild;
8481
+ },
8482
+ enumerable: false,
8483
+ configurable: true
8484
+ });
8470
8485
  Object.defineProperty(ExonTrack.prototype, "exonSpecs", {
8471
8486
  get: function () {
8487
+ var _this = this;
8472
8488
  if (!this.transcriptId || !this.transcript) {
8473
8489
  return [];
8474
8490
  }
@@ -8482,10 +8498,15 @@ var ExonTrack = /** @class */ (function (_super) {
8482
8498
  ? exonInfo.map(function (exon, index) {
8483
8499
  var startCodon = exon.start;
8484
8500
  var endCodon = exon.start + exon.length;
8485
- var exonLength = exon.length;
8486
- var stringStart = formatExonLocation(startCodon, index);
8487
- var stringEnd = formatExonLocation(endCodon);
8488
- var stringLength = formatExonLength(exonLength);
8501
+ var exonStartLocation = formatExonLocation(startCodon, index);
8502
+ var exonEndLocation = formatExonLocation(endCodon);
8503
+ var exonLength = formatExonLength(exon.length);
8504
+ var link = _this.chromosome
8505
+ ? "https://igv.org/app/?locus=chr" + _this.chromosome + ":" + exon.genomicLocationStart + "-" + exon.genomicLocationEnd + "&genome=" + _this.genomeBuild
8506
+ : 'https://igv.org';
8507
+ var linkText = _this.chromosome
8508
+ ? _this.genomeBuild + ":chr" + _this.chromosome + ":" + exon.genomicLocationStart + " - " + exon.genomicLocationEnd
8509
+ : exon.genomicLocationStart + " - " + exon.genomicLocationEnd;
8489
8510
  return {
8490
8511
  color: altColors[index % 2],
8491
8512
  startCodon: startCodon,
@@ -8497,14 +8518,41 @@ var ExonTrack = /** @class */ (function (_super) {
8497
8518
  " Exon ",
8498
8519
  exon.rank,
8499
8520
  " "),
8500
- "Start: ",
8501
- stringStart,
8521
+ "Start: Nucleotide",
8522
+ ' ',
8523
+ createElement("strong", null, exonStartLocation.nucleotideLocation),
8524
+ ' ',
8525
+ "of amino acid",
8526
+ ' ',
8527
+ createElement("strong", null, exonStartLocation.aminoAcidLocation),
8528
+ createElement("br", null),
8529
+ "End: Nucleotide",
8530
+ ' ',
8531
+ createElement("strong", null, exonEndLocation.nucleotideLocation),
8532
+ ' ',
8533
+ "of amino acid",
8534
+ ' ',
8535
+ createElement("strong", null, exonEndLocation.aminoAcidLocation),
8502
8536
  createElement("br", null),
8503
- "End: ",
8504
- stringEnd,
8537
+ "Length:",
8538
+ ' ',
8539
+ createElement("strong", null, exonLength.aminoAcidLength),
8540
+ ' ',
8541
+ "amino acids",
8542
+ ' ',
8543
+ exonLength.nucleotideLength && (createElement(Fragment, null,
8544
+ ' ',
8545
+ "and",
8546
+ ' ',
8547
+ createElement("strong", null, exonLength.nucleotideLength),
8548
+ ' ',
8549
+ "nucleotides")),
8505
8550
  createElement("br", null),
8506
- "Length: ",
8507
- stringLength)),
8551
+ "Genomic location:", " ",
8552
+ createElement("a", { target: "_blank", href: link, rel: "noopener noreferrer" },
8553
+ createElement(Fragment, null,
8554
+ linkText, " ",
8555
+ createElement("i", { className: "fa fa-external-link" }))))),
8508
8556
  };
8509
8557
  })
8510
8558
  : [];
@@ -8535,6 +8583,12 @@ var ExonTrack = /** @class */ (function (_super) {
8535
8583
  __decorate([
8536
8584
  computed
8537
8585
  ], ExonTrack.prototype, "transcript", null);
8586
+ __decorate([
8587
+ computed
8588
+ ], ExonTrack.prototype, "chromosome", null);
8589
+ __decorate([
8590
+ computed
8591
+ ], ExonTrack.prototype, "genomeBuild", null);
8538
8592
  __decorate([
8539
8593
  computed
8540
8594
  ], ExonTrack.prototype, "exonSpecs", null);
@@ -11724,6 +11778,28 @@ var DefaultMutationMapperStore = /** @class */ (function () {
11724
11778
  },
11725
11779
  })
11726
11780
  });
11781
+ Object.defineProperty(this, "ensemblTranscriptLookUp", {
11782
+ enumerable: true,
11783
+ configurable: true,
11784
+ writable: true,
11785
+ value: remoteData({
11786
+ await: function () { return [_this.activeTranscript]; },
11787
+ invoke: function () { return __awaiter(_this, void 0, void 0, function () {
11788
+ var ensemblTranscriptLookUpLink;
11789
+ return __generator(this, function (_a) {
11790
+ ensemblTranscriptLookUpLink = this.genomeBuild === 'hg19'
11791
+ ? "https://grch37.rest.ensembl.org/lookup/id/" + this.activeTranscript.result + "?content-type=application/json"
11792
+ : "https://rest.ensembl.org/lookup/id/" + this.activeTranscript.result + "?content-type=application/json";
11793
+ return [2 /*return*/, this.activeTranscript.result
11794
+ ? get(ensemblTranscriptLookUpLink)
11795
+ : undefined];
11796
+ });
11797
+ }); },
11798
+ onError: function () {
11799
+ // fail silently, leave the error handling responsibility to the data consumer
11800
+ },
11801
+ })
11802
+ });
11727
11803
  makeObservable(this);
11728
11804
  }
11729
11805
  Object.defineProperty(DefaultMutationMapperStore.prototype, "selectedTranscript", {
@@ -12033,6 +12109,13 @@ var DefaultMutationMapperStore = /** @class */ (function () {
12033
12109
  0);
12034
12110
  }
12035
12111
  });
12112
+ Object.defineProperty(DefaultMutationMapperStore.prototype, "genomeBuild", {
12113
+ get: function () {
12114
+ return this.config.genomeBuild || 'hg19';
12115
+ },
12116
+ enumerable: false,
12117
+ configurable: true
12118
+ });
12036
12119
  __decorate([
12037
12120
  observable
12038
12121
  ], DefaultMutationMapperStore.prototype, "_selectedTranscript", void 0);
@@ -12103,6 +12186,9 @@ var DefaultMutationMapperStore = /** @class */ (function () {
12103
12186
  __decorate([
12104
12187
  autobind
12105
12188
  ], DefaultMutationMapperStore.prototype, "getDefaultEntrezGeneId", null);
12189
+ __decorate([
12190
+ computed
12191
+ ], DefaultMutationMapperStore.prototype, "genomeBuild", null);
12106
12192
  return DefaultMutationMapperStore;
12107
12193
  }());
12108
12194