react-mutation-mapper 0.8.32 → 0.8.33
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/column/Signal.d.ts +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +54 -24
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +53 -23
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3160,8 +3160,9 @@ var ProteinChange = /** @class */ (function (_super) {
|
|
|
3160
3160
|
return ProteinChange;
|
|
3161
3161
|
}(React.Component));
|
|
3162
3162
|
|
|
3163
|
-
function getSignalData(mutation, indexedVariantAnnotations
|
|
3164
|
-
|
|
3163
|
+
function getSignalData(mutation, indexedVariantAnnotations, mutationType // mutationType could be "germline", "somatic", or "undefined" which means both
|
|
3164
|
+
) {
|
|
3165
|
+
var signalData = [];
|
|
3165
3166
|
var variantAnnotation = indexedVariantAnnotations
|
|
3166
3167
|
? cbioportalUtils.getVariantAnnotation(mutation, indexedVariantAnnotations.result)
|
|
3167
3168
|
: undefined;
|
|
@@ -3169,12 +3170,37 @@ function getSignalData(mutation, indexedVariantAnnotations) {
|
|
|
3169
3170
|
variantAnnotation.signalAnnotation &&
|
|
3170
3171
|
variantAnnotation.signalAnnotation.annotation &&
|
|
3171
3172
|
variantAnnotation.signalAnnotation.annotation.length > 0) {
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
if (
|
|
3175
|
-
|
|
3173
|
+
// if mutation is somatic OR germline, get annotation depending on mutationType
|
|
3174
|
+
if (variantAnnotation.signalAnnotation.annotation.length === 1) {
|
|
3175
|
+
if ((mutationType === cbioportalUtils.Pathogenicity.GERMLINE &&
|
|
3176
|
+
variantAnnotation.signalAnnotation.annotation[0].mutationStatus.includes('germline')) ||
|
|
3177
|
+
(mutationType === cbioportalUtils.Pathogenicity.SOMATIC &&
|
|
3178
|
+
variantAnnotation.signalAnnotation.annotation[0].mutationStatus.includes('somatic'))) {
|
|
3179
|
+
signalData = cbioportalUtils.extendMutations([
|
|
3180
|
+
variantAnnotation.signalAnnotation.annotation[0],
|
|
3181
|
+
]);
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
// if mutation is both somatic AND germline, get annotation for both or get one of them depending on mutationType
|
|
3185
|
+
else {
|
|
3186
|
+
// if mutationType is undefined, get annotation for both somatic and germline
|
|
3187
|
+
if (mutationType === undefined) {
|
|
3188
|
+
signalData = cbioportalUtils.extendMutations(variantAnnotation.signalAnnotation.annotation);
|
|
3176
3189
|
}
|
|
3177
|
-
|
|
3190
|
+
// if mutationType is defined, get annotation depending on mutationType
|
|
3191
|
+
else {
|
|
3192
|
+
variantAnnotation.signalAnnotation.annotation.forEach(function (annotation) {
|
|
3193
|
+
if (mutationType === cbioportalUtils.Pathogenicity.GERMLINE &&
|
|
3194
|
+
annotation.mutationStatus.includes('germline')) {
|
|
3195
|
+
signalData = cbioportalUtils.extendMutations([annotation]);
|
|
3196
|
+
}
|
|
3197
|
+
else if (mutationType === cbioportalUtils.Pathogenicity.SOMATIC &&
|
|
3198
|
+
annotation.mutationStatus.includes('somatic')) {
|
|
3199
|
+
signalData = cbioportalUtils.extendMutations([annotation]);
|
|
3200
|
+
}
|
|
3201
|
+
});
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3178
3204
|
}
|
|
3179
3205
|
return signalData;
|
|
3180
3206
|
}
|
|
@@ -3182,25 +3208,29 @@ function signalSortMethod(a, b) {
|
|
|
3182
3208
|
return cbioportalUtils.defaultSortMethod(getSortValue(a), getSortValue(b));
|
|
3183
3209
|
}
|
|
3184
3210
|
function getSortValue(signalData) {
|
|
3185
|
-
return signalData.germlineFrequency || null;
|
|
3211
|
+
return signalData ? signalData.germlineFrequency || null : null;
|
|
3186
3212
|
}
|
|
3187
|
-
function download$7(signalData) {
|
|
3188
|
-
return signalData.germlineFrequency
|
|
3213
|
+
function download$7(signalData, mutationType) {
|
|
3214
|
+
return signalData && signalData.germlineFrequency !== null
|
|
3189
3215
|
? "" + cbioportalUtils.formatNumberValueInSignificantDigits(signalData.germlineFrequency, 2)
|
|
3190
3216
|
: '';
|
|
3191
3217
|
}
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3218
|
+
// Get germline OR somatic frequency value
|
|
3219
|
+
function getSingleSignalValue(mutation, mutationType, indexedVariantAnnotations, significantDigits) {
|
|
3220
|
+
var signalData = getSignalData(mutation, indexedVariantAnnotations, mutationType);
|
|
3221
|
+
if (signalData &&
|
|
3222
|
+
signalData.length === 1 &&
|
|
3223
|
+
signalData[0].tumorTypeDecomposition) {
|
|
3224
|
+
return cbioportalUtils.formatNumberValueInSignificantDigits(signalData[0].germlineFrequency || signalData[0].somaticFrequency, significantDigits || 2);
|
|
3196
3225
|
}
|
|
3197
3226
|
else {
|
|
3198
3227
|
return null;
|
|
3199
3228
|
}
|
|
3200
3229
|
}
|
|
3201
3230
|
var SignalTable = function (props) {
|
|
3202
|
-
|
|
3203
|
-
|
|
3231
|
+
// signal data should be either germline or somatic, so should be only one element
|
|
3232
|
+
var signalData = getSignalData(props.mutation, props.indexedVariantAnnotations, props.mutationType)[0];
|
|
3233
|
+
if (getSingleSignalValue(props.mutation, props.mutationType || cbioportalUtils.Pathogenicity.GERMLINE, props.indexedVariantAnnotations) !== null) {
|
|
3204
3234
|
return (React.createElement(cbioportalFrontendCommons.MutationTumorTypeFrequencyTable, { data: cbioportalUtils.generateTumorTypeDecomposition(signalData, signalData.countsByTumorType, signalData.biallelicCountsByTumorType, signalData.qcPassCountsByTumorType, signalData.statsByTumorType), columns: [
|
|
3205
3235
|
cbioportalFrontendCommons.FREQUENCY_COLUMNS_DEFINITION[cbioportalFrontendCommons.FrequencyTableColumnEnum.TUMOR_TYPE],
|
|
3206
3236
|
cbioportalFrontendCommons.FREQUENCY_COLUMNS_DEFINITION[cbioportalFrontendCommons.FrequencyTableColumnEnum.MUTATION_STATUS],
|
|
@@ -3241,11 +3271,11 @@ var Signal = /** @class */ (function (_super) {
|
|
|
3241
3271
|
}
|
|
3242
3272
|
else {
|
|
3243
3273
|
content = React.createElement("div", null);
|
|
3244
|
-
var signalValue =
|
|
3274
|
+
var signalValue = getSingleSignalValue(this.props.mutation, this.props.mutationType || cbioportalUtils.Pathogenicity.GERMLINE, this.props.indexedVariantAnnotations);
|
|
3245
3275
|
if (signalValue !== null) {
|
|
3246
3276
|
content = (React.createElement(cbioportalFrontendCommons.DefaultTooltip, { placement: "top", overlayStyle: {
|
|
3247
3277
|
width: 800,
|
|
3248
|
-
}, overlay: React.createElement(SignalTable, { mutation: this.props.mutation, indexedVariantAnnotations: this.props.indexedVariantAnnotations }) },
|
|
3278
|
+
}, overlay: React.createElement(SignalTable, { mutation: this.props.mutation, indexedVariantAnnotations: this.props.indexedVariantAnnotations, mutationType: this.props.mutationType }) },
|
|
3249
3279
|
React.createElement("span", null, signalValue)));
|
|
3250
3280
|
}
|
|
3251
3281
|
}
|
|
@@ -5189,7 +5219,7 @@ var DefaultMutationTable = /** @class */ (function (_super) {
|
|
|
5189
5219
|
return this.indexedVariantAnnotationDataStatus === 'pending'
|
|
5190
5220
|
? function () { return undefined; }
|
|
5191
5221
|
: function (mutation) {
|
|
5192
|
-
return getSignalData(mutation, _this.props.indexedVariantAnnotations);
|
|
5222
|
+
return getSignalData(mutation, _this.props.indexedVariantAnnotations, cbioportalUtils.Pathogenicity.GERMLINE)[0];
|
|
5193
5223
|
};
|
|
5194
5224
|
},
|
|
5195
5225
|
enumerable: false,
|
|
@@ -5259,7 +5289,7 @@ var DefaultMutationTable = /** @class */ (function (_super) {
|
|
|
5259
5289
|
case exports.MutationColumn.DBSNP:
|
|
5260
5290
|
return function (column) { return (React.createElement(Dbsnp, { mutation: column.original, indexedMyVariantInfoAnnotations: _this.props.indexedMyVariantInfoAnnotations })); };
|
|
5261
5291
|
case exports.MutationColumn.SIGNAL:
|
|
5262
|
-
return function (column) { return (React.createElement(Signal, { mutation: column.original, indexedVariantAnnotations: _this.props.indexedVariantAnnotations })); };
|
|
5292
|
+
return function (column) { return (React.createElement(Signal, { mutation: column.original, indexedVariantAnnotations: _this.props.indexedVariantAnnotations, mutationType: cbioportalUtils.Pathogenicity.GERMLINE })); };
|
|
5263
5293
|
default:
|
|
5264
5294
|
return undefined;
|
|
5265
5295
|
}
|
|
@@ -8456,9 +8486,9 @@ var ExonTrack = /** @class */ (function (_super) {
|
|
|
8456
8486
|
var startCodon = exon.start;
|
|
8457
8487
|
var endCodon = exon.start + exon.length;
|
|
8458
8488
|
var exonLength = exon.length;
|
|
8459
|
-
var stringStart = cbioportalUtils.formatExonLocation(startCodon);
|
|
8489
|
+
var stringStart = cbioportalUtils.formatExonLocation(startCodon, index);
|
|
8460
8490
|
var stringEnd = cbioportalUtils.formatExonLocation(endCodon);
|
|
8461
|
-
var stringLength = cbioportalUtils.
|
|
8491
|
+
var stringLength = cbioportalUtils.formatExonLength(exonLength);
|
|
8462
8492
|
return {
|
|
8463
8493
|
color: altColors[index % 2],
|
|
8464
8494
|
startCodon: startCodon,
|
|
@@ -12889,7 +12919,7 @@ exports.getProteinImpactTypeBadgeLabel = getProteinImpactTypeBadgeLabel;
|
|
|
12889
12919
|
exports.getProteinImpactTypeOptionLabel = getProteinImpactTypeOptionLabel;
|
|
12890
12920
|
exports.getSelectedOptionValues = getSelectedOptionValues;
|
|
12891
12921
|
exports.getSignalData = getSignalData;
|
|
12892
|
-
exports.
|
|
12922
|
+
exports.getSingleSignalValue = getSingleSignalValue;
|
|
12893
12923
|
exports.getUrl = getUrl;
|
|
12894
12924
|
exports.gnomadDownload = download$5;
|
|
12895
12925
|
exports.gnomadSortValue = sortValue$7;
|