@sjcrh/proteinpaint-server 2.30.5 → 2.31.0

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/shared/common.js CHANGED
@@ -13,9 +13,7 @@ const d3scale = require('d3-scale')
13
13
  const d3 = require('d3')
14
14
 
15
15
  export const defaultcolor = rgb('#8AB1D4').darker()
16
- export const default_text_color = rgb('#aaa')
17
- .darker()
18
- .darker()
16
+ export const default_text_color = rgb('#aaa').darker().darker()
19
17
 
20
18
  export const exoncolor = '#4F8053'
21
19
 
@@ -81,8 +79,7 @@ export const mclass = {
81
79
  label: 'PROTEINDEL',
82
80
  color: '#7f7f7f',
83
81
  dt: dtsnvindel,
84
- desc:
85
- 'A deletion resulting in a loss of one or more codons from the product, but not altering the protein coding frame.',
82
+ desc: 'A deletion resulting in a loss of one or more codons from the product, but not altering the protein coding frame.',
86
83
  key: 'D'
87
84
  },
88
85
  I: {
@@ -317,7 +314,7 @@ export function applyOverrides(overrides = {}) {
317
314
  }
318
315
  }
319
316
 
320
- export const vepinfo = function(s) {
317
+ export const vepinfo = function (s) {
321
318
  const l = s.toLowerCase().split(',')
322
319
  let rank = 1
323
320
  if (l.indexOf('transcript_ablation') != -1) {
@@ -424,8 +421,7 @@ morigin[moriginsomatic] = {
424
421
  export const morigingermline = 'G'
425
422
  morigin[morigingermline] = {
426
423
  label: 'Germline',
427
- desc:
428
- 'A constitutional variant found in a normal sample. The proportion is indicated by the span of the solid arc within the whole circle.',
424
+ desc: 'A constitutional variant found in a normal sample. The proportion is indicated by the span of the solid arc within the whole circle.',
429
425
  legend: germlinelegend
430
426
  }
431
427
 
@@ -435,8 +431,7 @@ morigin.somatic = morigin[moriginsomatic]
435
431
  export const moriginrelapse = 'R'
436
432
  morigin[moriginrelapse] = {
437
433
  label: 'Relapse',
438
- desc:
439
- 'A somatic variant found only in a relapse sample. The proportion is indicated by the span of the hollow arc within the whole circle.',
434
+ desc: 'A somatic variant found only in a relapse sample. The proportion is indicated by the span of the hollow arc within the whole circle.',
440
435
  legend:
441
436
  '<circle cx="7" cy="12" r="7" fill="#b1b1b1"></circle><path d="M6.735557395310443e-16,-11A11,11 0 0,1 11,0L9,0A9,9 0 0,0 5.51091059616309e-16,-9Z" transform="translate(7,12)" fill="none" stroke="#858585"></path>'
442
437
  }
@@ -1022,7 +1017,7 @@ export const not_annotated = 'Unannotated'
1022
1017
  // kernal density estimator as from https://www.d3-graph-gallery.com/graph/density_basic.html
1023
1018
 
1024
1019
  export function kernelDensityEstimator(kernel, X) {
1025
- return function(V) {
1020
+ return function (V) {
1026
1021
  return X.map(x => {
1027
1022
  return [x, V.map(v => kernel(x - v)).reduce((i, j) => i + j, 0) / V.length]
1028
1023
  })
@@ -1030,7 +1025,7 @@ export function kernelDensityEstimator(kernel, X) {
1030
1025
  }
1031
1026
 
1032
1027
  export function kernelEpanechnikov(k) {
1033
- return function(v) {
1028
+ return function (v) {
1034
1029
  return Math.abs((v /= k)) <= 1 ? (0.75 * (1 - v * v)) / k : 0
1035
1030
  }
1036
1031
  }
@@ -1068,3 +1063,6 @@ export function getColorScheme(number) {
1068
1063
  export function getColors(number) {
1069
1064
  return d3scale.scaleOrdinal(getColorScheme(number))
1070
1065
  }
1066
+
1067
+ export const truncatingMutations = ['F', 'N', 'D', 'I', 'L']
1068
+ export const proteinChangingMutations = ['F', 'N', 'D', 'I', 'L', 'M', 'P']