@sjcrh/proteinpaint-shared 2.187.0 → 2.188.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.
Files changed (117) hide show
  1. package/README.md +10 -2
  2. package/constants/AiHisto.ts +27 -0
  3. package/constants/README.md +11 -0
  4. package/devTs.ts +3 -0
  5. package/dist/constants/AiHisto.d.ts +23 -0
  6. package/dist/constants/AiHisto.js +31 -0
  7. package/dist/constants/AiHisto.js.map +7 -0
  8. package/dist/src/aiHisto.d.ts +5 -0
  9. package/dist/src/aiHisto.js +15 -0
  10. package/dist/src/aiHisto.js.map +7 -0
  11. package/dist/src/bulk.cnv.js +83 -0
  12. package/dist/src/bulk.cnv.js.map +7 -0
  13. package/dist/src/bulk.del.js +119 -0
  14. package/dist/src/bulk.del.js.map +7 -0
  15. package/dist/src/bulk.itd.js +119 -0
  16. package/dist/src/bulk.itd.js.map +7 -0
  17. package/dist/src/bulk.js +183 -0
  18. package/dist/src/bulk.js.map +7 -0
  19. package/dist/src/bulk.snv.js +175 -0
  20. package/dist/src/bulk.snv.js.map +7 -0
  21. package/dist/src/bulk.sv.js +266 -0
  22. package/dist/src/bulk.sv.js.map +7 -0
  23. package/dist/src/bulk.svjson.js +151 -0
  24. package/dist/src/bulk.svjson.js.map +7 -0
  25. package/dist/src/bulk.trunc.js +122 -0
  26. package/dist/src/bulk.trunc.js.map +7 -0
  27. package/dist/src/clustering.js +71 -0
  28. package/dist/src/clustering.js.map +7 -0
  29. package/dist/src/common.js +1302 -0
  30. package/dist/src/common.js.map +7 -0
  31. package/dist/src/compute.percentile.js +10 -0
  32. package/dist/src/compute.percentile.js.map +7 -0
  33. package/dist/src/doc.d.ts +7 -0
  34. package/dist/src/doc.js +10 -0
  35. package/dist/src/doc.js.map +7 -0
  36. package/dist/src/fetch-helpers.js +177 -0
  37. package/dist/src/fetch-helpers.js.map +7 -0
  38. package/dist/src/fileSize.js +10 -0
  39. package/dist/src/fileSize.js.map +7 -0
  40. package/dist/src/filter.d.ts +62 -0
  41. package/dist/src/filter.js +194 -0
  42. package/dist/src/filter.js.map +7 -0
  43. package/dist/src/hash.js +20 -0
  44. package/dist/src/hash.js.map +7 -0
  45. package/dist/src/helpers.js +66 -0
  46. package/dist/src/helpers.js.map +7 -0
  47. package/dist/src/index.d.ts +26 -0
  48. package/dist/src/index.js +27 -0
  49. package/dist/src/index.js.map +7 -0
  50. package/dist/src/joinUrl.d.ts +1 -0
  51. package/dist/src/joinUrl.js +17 -0
  52. package/dist/src/joinUrl.js.map +7 -0
  53. package/dist/src/mds3tk.js +64 -0
  54. package/dist/src/mds3tk.js.map +7 -0
  55. package/dist/src/roundValue.js +57 -0
  56. package/dist/src/roundValue.js.map +7 -0
  57. package/dist/src/termdb.bins.js +272 -0
  58. package/dist/src/termdb.bins.js.map +7 -0
  59. package/dist/src/termdb.initbinconfig.js +79 -0
  60. package/dist/src/termdb.initbinconfig.js.map +7 -0
  61. package/dist/src/termdb.usecase.js +239 -0
  62. package/dist/src/termdb.usecase.js.map +7 -0
  63. package/dist/src/terms.d.ts +83 -0
  64. package/dist/src/terms.js +327 -0
  65. package/dist/src/terms.js.map +7 -0
  66. package/dist/src/time.d.ts +9 -0
  67. package/dist/src/time.js +23 -0
  68. package/dist/src/time.js.map +7 -0
  69. package/dist/src/tree.js +82 -0
  70. package/dist/src/tree.js.map +7 -0
  71. package/dist/src/urljson.d.ts +8 -0
  72. package/dist/src/urljson.js +31 -0
  73. package/dist/src/urljson.js.map +7 -0
  74. package/dist/src/vcf.ann.js +56 -0
  75. package/dist/src/vcf.ann.js.map +7 -0
  76. package/dist/src/vcf.csq.js +82 -0
  77. package/dist/src/vcf.csq.js.map +7 -0
  78. package/dist/src/vcf.info.js +40 -0
  79. package/dist/src/vcf.info.js.map +7 -0
  80. package/dist/src/vcf.js +439 -0
  81. package/dist/src/vcf.js.map +7 -0
  82. package/dist/src/vcf.type.js +17 -0
  83. package/dist/src/vcf.type.js.map +7 -0
  84. package/package.json +20 -11
  85. package/src/bulk.cnv.js +0 -86
  86. package/src/bulk.del.js +0 -124
  87. package/src/bulk.itd.js +0 -123
  88. package/src/bulk.js +0 -197
  89. package/src/bulk.snv.js +0 -271
  90. package/src/bulk.sv.js +0 -276
  91. package/src/bulk.svjson.js +0 -164
  92. package/src/bulk.trunc.js +0 -132
  93. package/src/clustering.js +0 -66
  94. package/src/common.js +0 -1608
  95. package/src/compute.percentile.js +0 -11
  96. package/src/doc.js +0 -6
  97. package/src/fetch-helpers.js +0 -323
  98. package/src/fileSize.js +0 -6
  99. package/src/filter.js +0 -221
  100. package/src/hash.js +0 -21
  101. package/src/helpers.js +0 -88
  102. package/src/index.js +0 -26
  103. package/src/joinUrl.js +0 -14
  104. package/src/mds3tk.js +0 -100
  105. package/src/roundValue.js +0 -94
  106. package/src/termdb.bins.js +0 -456
  107. package/src/termdb.initbinconfig.js +0 -130
  108. package/src/termdb.usecase.js +0 -344
  109. package/src/terms.js +0 -341
  110. package/src/time.js +0 -22
  111. package/src/tree.js +0 -138
  112. package/src/urljson.js +0 -41
  113. package/src/vcf.ann.js +0 -62
  114. package/src/vcf.csq.js +0 -153
  115. package/src/vcf.info.js +0 -50
  116. package/src/vcf.js +0 -654
  117. package/src/vcf.type.js +0 -24
package/src/bulk.sv.js DELETED
@@ -1,276 +0,0 @@
1
- import * as bulk from "./bulk.js"
2
- import * as common from "./common.js"
3
-
4
- /////////////////////////////////
5
- //
6
- // client/server shared
7
- //
8
- /////////////////////////////////
9
-
10
- // work for both sv/fusion
11
- // must tell if the data is fusion or sv
12
-
13
- export function parseheader(line, flag, issv) {
14
- const header = line.toLowerCase().split("\t")
15
- if (header.length <= 1) return "invalid file header for fusions"
16
- const htry = (...lst) => {
17
- for (const a of lst) {
18
- const j = header.indexOf(a)
19
- if (j != -1) return j
20
- }
21
- return -1
22
- }
23
- let i = htry("gene_a", "gene1", "genea")
24
- if (i == -1) return "gene_a missing from header"
25
- header[i] = "gene1"
26
- i = htry("gene_b", "gene2", "geneb")
27
- if (i == -1) return "gene_b missing from header"
28
- header[i] = "gene2"
29
- i = htry("chr_a", "chr1", "chra")
30
- if (i == -1) return "chr_a missing from header"
31
- header[i] = "chr1"
32
- i = htry("chr_b", "chr2", "chrb")
33
- if (i == -1) return "chr_b missing from header"
34
- header[i] = "chr2"
35
- i = htry("pos_a", "position_a", "position1", "posa")
36
- if (i == -1) return "pos_a missing from header"
37
- header[i] = "position1"
38
- i = htry("pos_b", "position_b", "position2", "posb")
39
- if (i == -1) return "pos_b missing from header"
40
- header[i] = "position2"
41
- i = htry("isoform_a", "refseq_a", "refseq1", "isoform1", "sv_refseqa")
42
- if (i == -1) return "isoform_a missing from header"
43
- header[i] = "isoform1"
44
- i = htry("isoform_b", "refseq_b", "refseq2", "isoform2", "sv_refseqb")
45
- if (i == -1) return "isoform_b missing from header"
46
- header[i] = "isoform2"
47
- i = htry("strand_a", "orta")
48
- if (i == -1) return "strand_a missing from header"
49
- header[i] = "strand1"
50
- i = htry("strand_b", "ortb")
51
- if (i == -1) return "strand_b missing from header"
52
- header[i] = "strand2"
53
- // optional
54
- i = htry("sample", "sample_name", "tumor_sample_barcode")
55
- if (i != -1) header[i] = "sample"
56
- i = htry("patient", "donor", "target_case_id")
57
- if (i != -1) header[i] = "patient"
58
- i = htry("sampletype", "sample type", "sample_type")
59
- if (i != -1) header[i] = "sampletype"
60
- i = htry("disease")
61
- if (i != -1) header[i] = "disease"
62
- i = htry("origin")
63
- if (i != -1) header[i] = "origin"
64
- if (issv) {
65
- flag.sv.loaded = true
66
- flag.sv.header = header
67
- } else {
68
- flag.fusion.loaded = true
69
- flag.fusion.header = header
70
- }
71
- return false
72
- }
73
-
74
- export function parseline(i, line, flag, issv) {
75
- if (line == "" || line[0] == "#") return
76
- const lst = line.split("\t")
77
- const m = {}
78
- const header = issv ? flag.sv.header : flag.fusion.header
79
- const badlines = issv ? flag.sv.badlines : flag.fusion.badlines
80
-
81
- for (let j = 0; j < header.length; j++) {
82
- m[header[j]] = lst[j]
83
- }
84
- if (!m.chr1) {
85
- badlines.push([i, "missing chr1", lst])
86
- return
87
- }
88
- if (m.chr1.toLowerCase().indexOf("chr") != 0) {
89
- m.chr1 = "chr" + m.chr1
90
- }
91
- if (!m.chr2) {
92
- badlines.push([i, "missing chr2", lst])
93
- return
94
- }
95
- if (m.chr2.toLowerCase().indexOf("chr") != 0) {
96
- m.chr2 = "chr" + m.chr2
97
- }
98
- let v = m.position1
99
- if (!v) {
100
- badlines.push([i, "missing position1", lst])
101
- return
102
- }
103
- let v2 = Number.parseInt(v)
104
- if (Number.isNaN(v2) || v2 <= 0) {
105
- badlines.push([i, "invalid value for position1", lst])
106
- return
107
- }
108
- m.position1 = v2
109
- v = m.position2
110
- if (!v) {
111
- badlines.push([i, "missing position2", lst])
112
- return
113
- }
114
- v2 = Number.parseInt(v)
115
- if (Number.isNaN(v2) || v2 <= 0) {
116
- badlines.push([i, "invalid value for position2", lst])
117
- return
118
- }
119
- m.position2 = v2
120
- if (bulk.parsesample(m, flag, i, lst, badlines)) {
121
- return
122
- }
123
- if (m.isoform1 && m.isoform1.indexOf(",") != -1) {
124
- const lst2 = m.isoform1.split(",")
125
- m.isoform1 = undefined
126
- for (const t of lst2) {
127
- if (t != "") m.isoform1 = t
128
- }
129
- }
130
- if (m.isoform2 && m.isoform2.indexOf(",") != -1) {
131
- const lst2 = m.isoform2.split(",")
132
- m.isoform2 = undefined
133
- for (const t of lst2) {
134
- if (t != "") m.isoform2 = t
135
- }
136
- }
137
- if (!m.gene1) {
138
- m.isoform1 = undefined
139
- }
140
- if (!m.gene2) {
141
- m.isoform2 = undefined
142
- }
143
- if (m.gene1) {
144
- // put data under gene1
145
- flag.good++
146
- const m2 = {
147
- dt: issv ? common.dtsv : common.dtfusionrna,
148
- class: issv ? common.mclasssv : common.mclassfusionrna,
149
- isoform: m.isoform1,
150
- mname: m.gene2 || m.chr2,
151
- sample: m.sample,
152
- patient: m.patient,
153
- sampletype: m.sampletype,
154
- origin: m.origin,
155
- disease: m.disease,
156
- pairlst: [
157
- {
158
- a: {
159
- name: m.gene1,
160
- isoform: m.isoform1,
161
- strand: m.strand1,
162
- chr: m.chr1,
163
- position: m.position1,
164
- },
165
- b: {
166
- name: m.gene2,
167
- isoform: m.isoform2,
168
- strand: m.strand2,
169
- chr: m.chr2,
170
- position: m.position2,
171
- },
172
- },
173
- ],
174
- }
175
- const n = flag.geneToUpper ? m.gene1.toUpperCase() : m.gene1
176
- if (!flag.data[n]) {
177
- flag.data[n] = []
178
- }
179
- flag.data[n].push(m2)
180
- }
181
- if (m.gene2 && m.gene2 != m.gene1) {
182
- // put data under gene2
183
- flag.good++
184
- const m2 = {
185
- dt: issv ? common.dtsv : common.dtfusionrna,
186
- class: issv ? common.mclasssv : common.mclassfusionrna,
187
- isoform: m.isoform2,
188
- mname: m.gene1 || m.chr1,
189
- sample: m.sample,
190
- patient: m.patient,
191
- sampletype: m.sampletype,
192
- origin: m.origin,
193
- disease: m.disease,
194
- pairlst: [
195
- {
196
- a: {
197
- name: m.gene1,
198
- isoform: m.isoform1,
199
- strand: m.strand1,
200
- chr: m.chr1,
201
- position: m.position1,
202
- },
203
- b: {
204
- name: m.gene2,
205
- isoform: m.isoform2,
206
- strand: m.strand2,
207
- chr: m.chr2,
208
- position: m.position2,
209
- },
210
- },
211
- ],
212
- }
213
- const n = flag.geneToUpper ? m.gene2.toUpperCase() : m.gene2
214
- if (!flag.data[n]) {
215
- flag.data[n] = []
216
- }
217
- flag.data[n].push(m2)
218
- }
219
- }
220
-
221
- export function duplicate(m) {
222
- const n = {}
223
- for (const k in m) {
224
- if (k == "pairlst") continue
225
- const v = m[k]
226
- const type = typeof v
227
- if (type == "object") {
228
- continue
229
- }
230
- n[k] = v
231
- }
232
- if (m.pairlst) {
233
- n.pairlst = []
234
- for (const pair of m.pairlst) {
235
- const p = {}
236
- for (const k in pair) {
237
- if (k == "a" || k == "b" || k == "interstitial") {
238
- continue
239
- }
240
- p[k] = pair[k]
241
- }
242
- if (pair.a) {
243
- p.a = {}
244
- for (const k in pair.a) {
245
- const v = pair.a[k]
246
- if (typeof v == "object") {
247
- continue
248
- }
249
- p.a[k] = v
250
- }
251
- }
252
- if (pair.b) {
253
- p.b = {}
254
- for (const k in pair.b) {
255
- const v = pair.b[k]
256
- if (typeof v == "object") {
257
- continue
258
- }
259
- p.b[k] = v
260
- }
261
- }
262
- if (pair.interstitial) {
263
- p.interstitial = {}
264
- for (const k in pair.interstitial) {
265
- const v = pair.interstitial[k]
266
- if (typeof v == "object") {
267
- continue
268
- }
269
- p.interstitial[k] = v
270
- }
271
- }
272
- n.pairlst.push(p)
273
- }
274
- }
275
- return n
276
- }
@@ -1,164 +0,0 @@
1
- /////////////////////////////////
2
- //
3
- // client/server shared
4
- //
5
- /////////////////////////////////
6
-
7
- import * as common from "./common.js"
8
- import * as bulk from "./bulk.js"
9
-
10
- // work for both sv/fusion
11
- // must tell if the data is fusion or sv
12
-
13
- export function parseheader(line, flag) {
14
- const header = line.toLowerCase().split("\t")
15
- if (header.length <= 1) return "invalid file header for svjson"
16
- const htry = (...lst) => {
17
- for (const a of lst) {
18
- const j = header.indexOf(a)
19
- if (j != -1) return j
20
- }
21
- return -1
22
- }
23
- let i = htry("sample")
24
- if (i != -1) header[i] = "sample"
25
- i = htry("sampletype")
26
- if (i != -1) header[i] = "sampletype"
27
- i = htry("patient")
28
- if (i != -1) header[i] = "patient"
29
- i = htry("json", "jsontext")
30
- if (i == -1) return ["json missing from header"]
31
- header[i] = "jsontext"
32
- return [null, header]
33
- }
34
-
35
- export function parseline(i, line, flag, header) {
36
- if (line == "" || line[0] == "#") return
37
- const lst = line.split("\t")
38
- const m = {}
39
- const badlines = flag.svjson.badlines
40
-
41
- for (let j = 0; j < header.length; j++) {
42
- m[header[j]] = lst[j]
43
- }
44
- if (!m.jsontext) {
45
- badlines.push([i, "missing jsontext", lst])
46
- return
47
- }
48
- if (bulk.parsesample(m, flag, i, lst, badlines)) {
49
- return
50
- }
51
- let json
52
- try {
53
- json = JSON.parse(m.jsontext)
54
- } catch (e) {
55
- badlines.push([i, "invalid JSON text", lst])
56
- return
57
- }
58
- // duplicating logic in pediatric.js
59
- if (Array.isArray(json)) {
60
- // json is pairlst
61
- for (const pair of json) {
62
- if (pair.a && pair.a.name && pair.a.isoform) {
63
- flag.good++
64
- const m2 = {
65
- dt: common.dtfusionrna,
66
- class: common.mclassfusionrna,
67
- isoform: pair.a.isoform,
68
- mname: pair.b.name,
69
- }
70
- for (const k in m) {
71
- if (k != "jsontext") m2[k] = m[k]
72
- }
73
- m2.pairlst = duplicate(json)
74
- const n = pair.a.name.toUpperCase()
75
- if (!flag.data[n]) {
76
- flag.data[n] = []
77
- }
78
- flag.data[n].push(m2)
79
- }
80
- if (pair.b && pair.b.name && pair.b.isoform) {
81
- flag.good++
82
- const m2 = {
83
- dt: common.dtfusionrna,
84
- class: common.mclassfusionrna,
85
- isoform: pair.b.isoform,
86
- mname: pair.a.name,
87
- }
88
- for (const k in m) {
89
- if (k != "jsontext") m2[k] = m[k]
90
- }
91
- m2.pairlst = duplicate(json)
92
- const n = pair.b.name.toUpperCase()
93
- if (!flag.data[n]) {
94
- flag.data[n] = []
95
- }
96
- flag.data[n].push(m2)
97
- }
98
- }
99
- } else {
100
- json.dt = json.typecode
101
- delete json.typecode
102
- switch (json.dt) {
103
- case common.dtitd:
104
- json.class = common.mclassitd
105
- json.mname = "ITD"
106
- break
107
- case common.dtnloss:
108
- json.class = common.mclassnloss
109
- json.mname = "N-loss"
110
- break
111
- case common.dtcloss:
112
- json.class = common.mclasscloss
113
- json.mname = "C-loss"
114
- break
115
- case common.dtdel:
116
- json.class = common.mclassdel
117
- json.mname = "Del"
118
- break
119
- case common.dtsv:
120
- json.class = common.mclasssv
121
- json.mname = "SV"
122
- break
123
- default:
124
- badlines.push([i, "unknown datatype", lst])
125
- return
126
- }
127
- // record only about a single gene
128
- if (!json.gene) {
129
- badlines.push([i, "json.gene missing", lst])
130
- return
131
- }
132
- flag.good++
133
- for (const k in m) {
134
- if (k != "jsontext") {
135
- json[k] = m[k]
136
- }
137
- }
138
- const n = flag.geneToUpper
139
- ? json.gene.toUpperCase()
140
- : json.gene.toUpperCase()
141
- if (!flag.data[n]) {
142
- flag.data[n] = []
143
- }
144
- flag.data[n].push(json)
145
- }
146
- }
147
-
148
- function duplicate(lst) {
149
- const d = []
150
- for (const pair of lst) {
151
- const p = { a: {}, b: {} }
152
- for (const k in pair) {
153
- if (k != "a" && k != "b") p[k] = pair[k]
154
- }
155
- for (const k in pair.a) {
156
- p.a[k] = pair.a[k]
157
- }
158
- for (const k in pair.b) {
159
- p.b[k] = pair.b[k]
160
- }
161
- d.push(p)
162
- }
163
- return d
164
- }
package/src/bulk.trunc.js DELETED
@@ -1,132 +0,0 @@
1
- ////////////////////////////////////
2
- //
3
- // shared between client and server
4
- //
5
- ////////////////////////////////////
6
-
7
- import * as common from "./common.js"
8
- import * as bulk from "./bulk.js"
9
-
10
- export function parseheader(line, flag) {
11
- const header = line.toLowerCase().split("\t")
12
- if (header.length <= 1) return "invalid header line for truncation"
13
- const htry = (...lst) => {
14
- for (const e of lst) {
15
- const j = header.indexOf(e)
16
- if (j != -1) return j
17
- }
18
- return -1
19
- }
20
- let i = htry("gene")
21
- if (i == -1) return "gene missing from header"
22
- header[i] = "gene"
23
- i = htry(
24
- "annovar_isoform",
25
- "mrna_accession",
26
- "mrna accession",
27
- "refseq_mrna_id",
28
- "annovar_sj_filter_isoform",
29
- "refseq",
30
- "isoform"
31
- )
32
- if (i == -1) return "isoform missing from header"
33
- header[i] = "isoform"
34
- let hasrnapos = false
35
- i = htry("rnaposition")
36
- if (i != -1) {
37
- header[i] = "rnaposition"
38
- hasrnapos = true
39
- }
40
- i = htry("losstype")
41
- if (i == -1) return "lossType missing from header"
42
- header[i] = "losstype"
43
- let hasgenomic = false
44
- i = htry("chromosome", "chr")
45
- if (i != -1) {
46
- header[i] = "chr"
47
- i = htry(
48
- "start",
49
- "start_position",
50
- "wu_hg19_pos",
51
- "chr_position",
52
- "position"
53
- )
54
- if (i == -1) {
55
- return "genomic position missing from header"
56
- }
57
- header[i] = "pos"
58
- hasgenomic = true
59
- }
60
- if (!hasrnapos && !hasgenomic) {
61
- return "neither rnaposition nor genomic position is given"
62
- }
63
-
64
- i = htry("sample", "sample_name", "tumor_sample_barcode")
65
- if (i != -1) header[i] = "sample"
66
- i = htry("patient", "donor", "target_case_id")
67
- if (i != -1) header[i] = "patient"
68
- i = htry("disease")
69
- if (i != -1) header[i] = "disease"
70
- i = htry("origin")
71
- if (i != -1) header[i] = "origin"
72
- i = htry("sampletype", "sample type", "sample_type")
73
- if (i != -1) header[i] = "sampletype"
74
- flag.truncation.header = header
75
- flag.truncation.loaded = true
76
- return false
77
- }
78
-
79
- export function parseline(i, line, flag) {
80
- if (line == "" || line[0] == "#") return
81
- const lst = line.split("\t")
82
- const m = {}
83
- for (let j = 0; j < flag.truncation.header.length; j++) {
84
- m[flag.truncation.header[j]] = lst[j]
85
- }
86
- if (!m.gene) {
87
- flag.truncation.badlines.push([i, "missing gene", lst])
88
- return
89
- }
90
- if (m.rnaposition) {
91
- const v = Number.parseInt(m.rnaposition)
92
- if (Number.isNaN(v) || v < 0) {
93
- flag.truncation.badlines.push([i, "invalid rnaPosition value", lst])
94
- return
95
- }
96
- m.rnaposition = v
97
- }
98
- if (m.pos) {
99
- const v = Number.parseInt(m.pos)
100
- if (Number.isNaN(v) || v < 0) {
101
- flag.truncation.badlines.push([i, "invalid genomic position", lst])
102
- return
103
- }
104
- m.pos = v
105
- }
106
- if (!m.losstype) {
107
- flag.truncation.badlines.push([i, "missing lossType value", lst])
108
- return
109
- }
110
- if (m.losstype != "n" && m.losstype != "c") {
111
- flag.truncation.badlines.push([i, 'lossType value not "n" or "c"', lst])
112
- return
113
- }
114
- if (bulk.parsesample(m, flag, i, lst, flag.truncation.badlines)) {
115
- return
116
- }
117
- if (m.losstype == "n") {
118
- m.dt = common.dtnloss
119
- m.class = common.mclassnloss
120
- m.mname = "N-loss"
121
- } else {
122
- m.dt = common.dtcloss
123
- m.class = common.mclasscloss
124
- m.mname = "C-loss"
125
- }
126
- flag.good++
127
- const n = flag.geneToUpper ? m.gene.toUpperCase() : m.gene
128
- if (!(n in flag.data)) {
129
- flag.data[n] = []
130
- }
131
- flag.data[n].push(m)
132
- }
package/src/clustering.js DELETED
@@ -1,66 +0,0 @@
1
- export const clusterMethodLst = [
2
- {
3
- label: "Average",
4
- value: "average",
5
- title: `Cluster by average value`,
6
- },
7
- {
8
- label: `Complete`,
9
- value: "complete",
10
- title: `Use the complete clustering method`,
11
- },
12
- {
13
- label: `Single`,
14
- value: "single",
15
- title: `Use the single clustering method`,
16
- },
17
- {
18
- label: `Ward.D`,
19
- value: "ward.D",
20
- title: `Use the ward.D clustering method`,
21
- },
22
- {
23
- label: `Ward.D2`,
24
- value: "ward.D2",
25
- title: `Use the ward.D2 clustering method`,
26
- },
27
- {
28
- label: `Mcquitty`,
29
- value: "mcquitty",
30
- title: `Use the Mcquity clustering method`,
31
- },
32
- /* These methods are currently disabled because the dendrogram lines tend to cross one another.
33
- {
34
- label: `Centroid`,
35
- value: 'centroid',
36
- title: `Use the centroid clustering method`
37
- },
38
- {
39
- label: `Median`,
40
- value: 'median',
41
- title: `Use the median clustering method`
42
- }
43
- */
44
- ]
45
- export const distanceMethodLst = [
46
- {
47
- label: "Euclidean",
48
- value: "euclidean",
49
- title: `Calculate distance using euclidean method`,
50
- },
51
- {
52
- label: "Maximum",
53
- value: "maximum",
54
- title: `Maximum distance between two components of x and y`,
55
- },
56
- {
57
- label: "Manhattan",
58
- value: "manhattan",
59
- title: `Calculate distance using the absolute distance between the two vectors`,
60
- },
61
- {
62
- label: "Canberra",
63
- value: "canberra",
64
- title: `Calculate distance using Canberra method`,
65
- },
66
- ]