@sjcrh/proteinpaint-shared 2.180.0 → 2.180.1

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/src/terms.js CHANGED
@@ -1,309 +1,324 @@
1
1
  import {
2
- dtgeneexpression,
3
- dtssgsea,
4
- dtdnamethylation,
5
- dtmetaboliteintensity,
6
- dtwholeproteomeabundance,
7
- TermTypeGroups,
8
- dtTerms
9
- } from "./common.js";
10
- import { TermTypeGroups as TermTypeGroups2 } from "./common.js";
11
- const ROOT_SAMPLE_TYPE = 1;
12
- const DEFAULT_SAMPLE_TYPE = 2;
2
+ dtgeneexpression,
3
+ dtssgsea,
4
+ dtdnamethylation,
5
+ dtmetaboliteintensity,
6
+ dtproteomeabundance,
7
+ TermTypeGroups,
8
+ dtTerms,
9
+ } from "./common.js"
10
+ import { TermTypeGroups as TermTypeGroups2 } from "./common.js"
11
+ const ROOT_SAMPLE_TYPE = 1
12
+ const DEFAULT_SAMPLE_TYPE = 2
13
13
  const NumericModes = {
14
- continuous: "continuous",
15
- discrete: "discrete"
16
- };
17
- const CATEGORICAL = "categorical";
18
- const CONDITION = "condition";
19
- const DATE = "date";
20
- const DNA_METHYLATION = "dnaMethylation";
21
- const FLOAT = "float";
22
- const GENE_VARIANT = "geneVariant";
23
- const GENE_EXPRESSION = "geneExpression";
24
- const INTEGER = "integer";
25
- const METABOLITE_INTENSITY = "metaboliteIntensity";
26
- const MULTIVALUE = "multivalue";
27
- const SAMPLELST = "samplelst";
28
- const SINGLECELL_CELLTYPE = "singleCellCellType";
29
- const SINGLECELL_GENE_EXPRESSION = "singleCellGeneExpression";
30
- const SNP = "snp";
31
- const SNP_LIST = "snplst";
32
- const SNP_LOCUS = "snplocus";
33
- const SSGSEA = "ssGSEA";
34
- const SURVIVAL = "survival";
35
- const TERM_COLLECTION = "termCollection";
36
- const WHOLE_PROTEOME_ABUNDANCE = "wholeProteomeAbundance";
14
+ continuous: "continuous",
15
+ discrete: "discrete",
16
+ }
17
+ const CATEGORICAL = "categorical"
18
+ const CONDITION = "condition"
19
+ const DATE = "date"
20
+ const DNA_METHYLATION = "dnaMethylation"
21
+ const FLOAT = "float"
22
+ const GENE_VARIANT = "geneVariant"
23
+ const GENE_EXPRESSION = "geneExpression"
24
+ const INTEGER = "integer"
25
+ const METABOLITE_INTENSITY = "metaboliteIntensity"
26
+ const MULTIVALUE = "multivalue"
27
+ const SAMPLELST = "samplelst"
28
+ const SINGLECELL_CELLTYPE = "singleCellCellType"
29
+ const SINGLECELL_GENE_EXPRESSION = "singleCellGeneExpression"
30
+ const SNP = "snp"
31
+ const SNP_LIST = "snplst"
32
+ const SNP_LOCUS = "snplocus"
33
+ const SSGSEA = "ssGSEA"
34
+ const SURVIVAL = "survival"
35
+ const TERM_COLLECTION = "termCollection"
36
+ const PROTEOME_ABUNDANCE = "proteomeAbundance"
37
37
  const TermTypes = {
38
- GENE_VARIANT,
39
- GENE_EXPRESSION,
40
- SSGSEA,
41
- DNA_METHYLATION,
42
- CATEGORICAL,
43
- INTEGER,
44
- FLOAT,
45
- SNP,
46
- SNP_LIST,
47
- SNP_LOCUS,
48
- CONDITION,
49
- SURVIVAL,
50
- SAMPLELST,
51
- METABOLITE_INTENSITY,
52
- WHOLE_PROTEOME_ABUNDANCE,
53
- SINGLECELL_CELLTYPE,
54
- SINGLECELL_GENE_EXPRESSION,
55
- MULTIVALUE,
56
- DATE,
57
- TERM_COLLECTION
58
- };
59
- const dtTermTypes = new Set(dtTerms.map((t) => t.type));
38
+ GENE_VARIANT,
39
+ GENE_EXPRESSION,
40
+ SSGSEA,
41
+ DNA_METHYLATION,
42
+ CATEGORICAL,
43
+ INTEGER,
44
+ FLOAT,
45
+ SNP,
46
+ SNP_LIST,
47
+ SNP_LOCUS,
48
+ CONDITION,
49
+ SURVIVAL,
50
+ SAMPLELST,
51
+ METABOLITE_INTENSITY,
52
+ PROTEOME_ABUNDANCE,
53
+ SINGLECELL_CELLTYPE,
54
+ SINGLECELL_GENE_EXPRESSION,
55
+ MULTIVALUE,
56
+ DATE,
57
+ TERM_COLLECTION,
58
+ }
59
+ const dtTermTypes = new Set(dtTerms.map((t) => t.type))
60
60
  for (const dtTermType of dtTermTypes) {
61
- TermTypes[dtTermType.toUpperCase()] = dtTermType;
61
+ TermTypes[dtTermType.toUpperCase()] = dtTermType
62
62
  }
63
- const NUMERIC_DICTIONARY_TERM = "numericDictTerm";
64
63
  const TermTypes2Dt = {
65
- [GENE_EXPRESSION]: dtgeneexpression,
66
- [SSGSEA]: dtssgsea,
67
- [DNA_METHYLATION]: dtdnamethylation,
68
- [METABOLITE_INTENSITY]: dtmetaboliteintensity,
69
- [WHOLE_PROTEOME_ABUNDANCE]: dtwholeproteomeabundance
70
- };
64
+ [GENE_EXPRESSION]: dtgeneexpression,
65
+ [SSGSEA]: dtssgsea,
66
+ [DNA_METHYLATION]: dtdnamethylation,
67
+ [METABOLITE_INTENSITY]: dtmetaboliteintensity,
68
+ [PROTEOME_ABUNDANCE]: dtproteomeabundance,
69
+ }
71
70
  const typeGroup = {
72
- [CATEGORICAL]: TermTypeGroups.DICTIONARY_VARIABLES,
73
- [CONDITION]: TermTypeGroups.DICTIONARY_VARIABLES,
74
- [FLOAT]: TermTypeGroups.DICTIONARY_VARIABLES,
75
- [INTEGER]: TermTypeGroups.DICTIONARY_VARIABLES,
76
- [SAMPLELST]: TermTypeGroups.DICTIONARY_VARIABLES,
77
- [SURVIVAL]: TermTypeGroups.DICTIONARY_VARIABLES,
78
- [DATE]: TermTypeGroups.DICTIONARY_VARIABLES,
79
- [MULTIVALUE]: TermTypeGroups.DICTIONARY_VARIABLES,
80
- [GENE_VARIANT]: TermTypeGroups.MUTATION_CNV_FUSION,
81
- [SNP]: TermTypeGroups.SNP,
82
- [SNP_LIST]: TermTypeGroups.SNP_LIST,
83
- [SNP_LOCUS]: TermTypeGroups.SNP_LOCUS,
84
- [GENE_EXPRESSION]: TermTypeGroups.GENE_EXPRESSION,
85
- [SSGSEA]: TermTypeGroups.SSGSEA,
86
- [DNA_METHYLATION]: TermTypeGroups.DNA_METHYLATION,
87
- [METABOLITE_INTENSITY]: TermTypeGroups.METABOLITE_INTENSITY,
88
- [WHOLE_PROTEOME_ABUNDANCE]: TermTypeGroups.WHOLE_PROTEOME_ABUNDANCE,
89
- [TERM_COLLECTION]: TermTypeGroups.TERM_COLLECTION,
90
- [SINGLECELL_CELLTYPE]: TermTypeGroups.SINGLECELL_CELLTYPE,
91
- [SINGLECELL_GENE_EXPRESSION]: TermTypeGroups.SINGLECELL_GENE_EXPRESSION
92
- };
71
+ [CATEGORICAL]: TermTypeGroups.DICTIONARY_VARIABLES,
72
+ [CONDITION]: TermTypeGroups.DICTIONARY_VARIABLES,
73
+ [FLOAT]: TermTypeGroups.DICTIONARY_VARIABLES,
74
+ [INTEGER]: TermTypeGroups.DICTIONARY_VARIABLES,
75
+ [SAMPLELST]: TermTypeGroups.DICTIONARY_VARIABLES,
76
+ [SURVIVAL]: TermTypeGroups.DICTIONARY_VARIABLES,
77
+ [DATE]: TermTypeGroups.DICTIONARY_VARIABLES,
78
+ [MULTIVALUE]: TermTypeGroups.DICTIONARY_VARIABLES,
79
+ [GENE_VARIANT]: TermTypeGroups.MUTATION_CNV_FUSION,
80
+ [SNP]: TermTypeGroups.SNP,
81
+ [SNP_LIST]: TermTypeGroups.SNP_LIST,
82
+ [SNP_LOCUS]: TermTypeGroups.SNP_LOCUS,
83
+ [GENE_EXPRESSION]: TermTypeGroups.GENE_EXPRESSION,
84
+ [SSGSEA]: TermTypeGroups.SSGSEA,
85
+ [DNA_METHYLATION]: TermTypeGroups.DNA_METHYLATION,
86
+ [METABOLITE_INTENSITY]: TermTypeGroups.METABOLITE_INTENSITY,
87
+ [PROTEOME_ABUNDANCE]: TermTypeGroups.PROTEOME_ABUNDANCE,
88
+ [TERM_COLLECTION]: TermTypeGroups.TERM_COLLECTION,
89
+ [SINGLECELL_CELLTYPE]: TermTypeGroups.SINGLECELL_CELLTYPE,
90
+ [SINGLECELL_GENE_EXPRESSION]: TermTypeGroups.SINGLECELL_GENE_EXPRESSION,
91
+ }
93
92
  const nonDictTypes = /* @__PURE__ */ new Set([
94
- SNP,
95
- SNP_LIST,
96
- SNP_LOCUS,
97
- GENE_EXPRESSION,
98
- SSGSEA,
99
- DNA_METHYLATION,
100
- GENE_VARIANT,
101
- METABOLITE_INTENSITY,
102
- WHOLE_PROTEOME_ABUNDANCE,
103
- SINGLECELL_CELLTYPE,
104
- SINGLECELL_GENE_EXPRESSION
105
- ]);
93
+ SNP,
94
+ SNP_LIST,
95
+ SNP_LOCUS,
96
+ GENE_EXPRESSION,
97
+ SSGSEA,
98
+ DNA_METHYLATION,
99
+ GENE_VARIANT,
100
+ METABOLITE_INTENSITY,
101
+ PROTEOME_ABUNDANCE,
102
+ SINGLECELL_CELLTYPE,
103
+ SINGLECELL_GENE_EXPRESSION,
104
+ ])
106
105
  for (const dtTermType of dtTermTypes) {
107
- nonDictTypes.add(TermTypes[dtTermType.toUpperCase()]);
106
+ nonDictTypes.add(TermTypes[dtTermType.toUpperCase()])
108
107
  }
109
108
  const numericTypes = /* @__PURE__ */ new Set([
110
- INTEGER,
111
- FLOAT,
112
- GENE_EXPRESSION,
113
- SSGSEA,
114
- DNA_METHYLATION,
115
- METABOLITE_INTENSITY,
116
- WHOLE_PROTEOME_ABUNDANCE,
117
- SINGLECELL_GENE_EXPRESSION,
118
- DATE
119
- ]);
120
- const annoNumericTypes = /* @__PURE__ */ new Set([INTEGER, FLOAT, DATE]);
121
- const categoricalTypes = /* @__PURE__ */ new Set([CATEGORICAL, SNP]);
122
- const singleCellTerms = /* @__PURE__ */ new Set([SINGLECELL_CELLTYPE, SINGLECELL_GENE_EXPRESSION]);
109
+ INTEGER,
110
+ FLOAT,
111
+ GENE_EXPRESSION,
112
+ SSGSEA,
113
+ DNA_METHYLATION,
114
+ METABOLITE_INTENSITY,
115
+ PROTEOME_ABUNDANCE,
116
+ SINGLECELL_GENE_EXPRESSION,
117
+ DATE,
118
+ ])
119
+ const annoNumericTypes = /* @__PURE__ */ new Set([INTEGER, FLOAT, DATE])
120
+ const categoricalTypes = /* @__PURE__ */ new Set([CATEGORICAL, SNP])
121
+ const singleCellTerms = /* @__PURE__ */ new Set([
122
+ SINGLECELL_CELLTYPE,
123
+ SINGLECELL_GENE_EXPRESSION,
124
+ ])
123
125
  function isSingleCellTerm(term) {
124
- if (!term) return false;
125
- return singleCellTerms.has(term.type);
126
+ if (!term) return false
127
+ return singleCellTerms.has(term.type)
126
128
  }
127
129
  function isNumericTerm(term) {
128
- if (!term) return false;
129
- return numericTypes.has(term.type);
130
+ if (!term) return false
131
+ return numericTypes.has(term.type)
130
132
  }
131
133
  function isCategoricalTerm(term) {
132
- if (!term) return false;
133
- return categoricalTypes.has(term.type);
134
+ if (!term) return false
135
+ return categoricalTypes.has(term.type)
134
136
  }
135
137
  function isDictionaryType(type) {
136
- return !isNonDictionaryType(type);
138
+ return !isNonDictionaryType(type)
137
139
  }
138
140
  function isNonDictionaryType(type) {
139
- if (!type) throw new Error("Type is not defined");
140
- return nonDictTypes.has(type);
141
+ if (!type) throw new Error("Type is not defined")
142
+ return nonDictTypes.has(type)
141
143
  }
142
144
  function equals(t1, t2) {
143
- if (!t1) throw new Error("First term is not defined ");
144
- if (!t2) throw new Error("Second term is not defined ");
145
- if (t1.type !== t2.type) return false;
146
- if (isDictionaryType(t1.type) && isDictionaryType(t2.type) && t1.type != SAMPLELST) return t1.id === t2.id;
147
- switch (t1.type) {
148
- case GENE_EXPRESSION:
149
- return t1.gene == t2.gene;
150
- case SSGSEA:
151
- return t1.id == t2.id;
152
- case DNA_METHYLATION:
153
- return t1.chr == t2.chr && t1.start == t2.start && t1.stop == t2.stop;
154
- case METABOLITE_INTENSITY:
155
- case WHOLE_PROTEOME_ABUNDANCE:
156
- return t1.name == t2.name;
157
- case GENE_VARIANT:
158
- return t1.gene == t2.gene || t1.chr == t2.chr && t1.start == t2.start && t1.stop == t2.stop;
159
- // TO DO: Add more cases
160
- // case SNP_LIST:
161
- // case SNP_LOCUS:
162
- // case SAMPLELST:
163
- default:
164
- return false;
165
- }
145
+ if (!t1) throw new Error("First term is not defined ")
146
+ if (!t2) throw new Error("Second term is not defined ")
147
+ if (t1.type !== t2.type) return false
148
+ if (
149
+ isDictionaryType(t1.type) &&
150
+ isDictionaryType(t2.type) &&
151
+ t1.type != SAMPLELST
152
+ )
153
+ return t1.id === t2.id
154
+ switch (t1.type) {
155
+ case GENE_EXPRESSION:
156
+ return t1.gene == t2.gene
157
+ case SSGSEA:
158
+ return t1.id == t2.id
159
+ case DNA_METHYLATION:
160
+ return t1.chr == t2.chr && t1.start == t2.start && t1.stop == t2.stop
161
+ case METABOLITE_INTENSITY:
162
+ case PROTEOME_ABUNDANCE:
163
+ return t1.name == t2.name
164
+ case GENE_VARIANT:
165
+ return (
166
+ t1.gene == t2.gene ||
167
+ (t1.chr == t2.chr && t1.start == t2.start && t1.stop == t2.stop)
168
+ )
169
+ // TO DO: Add more cases
170
+ // case SNP_LIST:
171
+ // case SNP_LOCUS:
172
+ // case SAMPLELST:
173
+ default:
174
+ return false
175
+ }
166
176
  }
167
177
  function getBin(lst, value) {
168
- let bin = lst.findIndex(
169
- (b) => b.startunbounded && value < b.stop || b.startunbounded && b.stopinclusive && value == b.stop
170
- );
171
- if (bin == -1)
172
- bin = lst.findIndex(
173
- (b) => b.stopunbounded && value > b.start || b.stopunbounded && b.startinclusive && value == b.start
174
- );
175
- if (bin == -1)
176
- bin = lst.findIndex(
177
- (b) => value > b.start && value < b.stop || b.startinclusive && value == b.start || b.stopinclusive && value == b.stop
178
- );
179
- return bin;
178
+ let bin = lst.findIndex(
179
+ (b) =>
180
+ (b.startunbounded && value < b.stop) ||
181
+ (b.startunbounded && b.stopinclusive && value == b.stop)
182
+ )
183
+ if (bin == -1)
184
+ bin = lst.findIndex(
185
+ (b) =>
186
+ (b.stopunbounded && value > b.start) ||
187
+ (b.stopunbounded && b.startinclusive && value == b.start)
188
+ )
189
+ if (bin == -1)
190
+ bin = lst.findIndex(
191
+ (b) =>
192
+ (value > b.start && value < b.stop) ||
193
+ (b.startinclusive && value == b.start) ||
194
+ (b.stopinclusive && value == b.stop)
195
+ )
196
+ return bin
180
197
  }
181
198
  function getSampleType(term, ds) {
182
- if (!term) return null;
183
- if (term.type && isNonDictionaryType(term.type)) return DEFAULT_SAMPLE_TYPE;
184
- if (term.id) return ds.cohort.termdb.term2SampleType.get(term.id);
185
- if (term.type == "samplelst") {
186
- const key = Object.keys(term.values)[0];
187
- const sampleId = term.values[key].list[0]?.sampleId;
188
- if (sampleId) return ds.sampleId2Type.get(Number(sampleId) || sampleId);
189
- else return DEFAULT_SAMPLE_TYPE;
190
- }
191
- return DEFAULT_SAMPLE_TYPE;
199
+ if (!term) return null
200
+ if (term.type && isNonDictionaryType(term.type)) return DEFAULT_SAMPLE_TYPE
201
+ if (term.id) return ds.cohort.termdb.term2SampleType.get(term.id)
202
+ if (term.type == "samplelst") {
203
+ const key = Object.keys(term.values)[0]
204
+ const sampleId = term.values[key].list[0]?.sampleId
205
+ if (sampleId) return ds.sampleId2Type.get(Number(sampleId) || sampleId)
206
+ else return DEFAULT_SAMPLE_TYPE
207
+ }
208
+ return DEFAULT_SAMPLE_TYPE
192
209
  }
193
210
  function getParentType(types, ds) {
194
- if (Object.keys(ds.cohort.termdb.sampleTypes).length == 0) return null;
195
- const ids = Array.from(types);
196
- if (!ids || ids.length == 0) return null;
197
- for (const id of ids) {
198
- const typeObj = ds.cohort.termdb.sampleTypes[id];
199
- if (!typeObj) continue;
200
- if (typeObj.parent_id == null) return id;
201
- if (ids.includes(typeObj.parent_id)) continue;
202
- else return typeObj.parent_id;
203
- }
204
- return null;
211
+ if (Object.keys(ds.cohort.termdb.sampleTypes).length == 0) return null
212
+ const ids = Array.from(types)
213
+ if (!ids || ids.length == 0) return null
214
+ for (const id of ids) {
215
+ const typeObj = ds.cohort.termdb.sampleTypes[id]
216
+ if (!typeObj) continue
217
+ if (typeObj.parent_id == null) return id
218
+ if (ids.includes(typeObj.parent_id)) continue
219
+ else return typeObj.parent_id
220
+ }
221
+ return null
205
222
  }
206
223
  const typeMap = {
207
- categorical: "Categorical",
208
- condition: "Condition",
209
- float: "Numerical",
210
- integer: "Numerical",
211
- geneExpression: "Gene Expression",
212
- ssGSEA: "Geneset Expression",
213
- dnaMethylation: "DNA Methylation",
214
- geneVariant: "Gene Variant",
215
- metaboliteIntensity: "Metabolite Intensity",
216
- wholeProteomeAbundance: "Whole Proteome Abundance",
217
- multivalue: "Multi Value",
218
- singleCellGeneExpression: "Single Cell, Gene Expression",
219
- singleCellCellType: "Single Cell, Cell Type",
220
- snplocus: "SNP Locus",
221
- snp: "SNP",
222
- snplst: "SNP List",
223
- numericDictTerm: "Numeric Dictionary Term",
224
- termCollection: "Term Collection"
225
- };
224
+ categorical: "Categorical",
225
+ condition: "Condition",
226
+ float: "Numerical",
227
+ integer: "Numerical",
228
+ geneExpression: "Gene Expression",
229
+ ssGSEA: "Geneset Expression",
230
+ dnaMethylation: "DNA Methylation",
231
+ geneVariant: "Gene Variant",
232
+ metaboliteIntensity: "Metabolite Intensity",
233
+ proteomeAbundance: "Whole Proteome Abundance",
234
+ multivalue: "Multi Value",
235
+ singleCellGeneExpression: "Single Cell, Gene Expression",
236
+ singleCellCellType: "Single Cell, Cell Type",
237
+ snplocus: "SNP Locus",
238
+ snp: "SNP",
239
+ snplst: "SNP List",
240
+ termCollection: "Term Collection",
241
+ }
226
242
  function termType2label(type) {
227
- return typeMap[type] || "Unknown term type";
243
+ return typeMap[type] || "Unknown term type"
228
244
  }
229
245
  function getDateFromNumber(value) {
230
- const year = Math.floor(value);
231
- const january1st = new Date(year, 0, 1);
232
- const totalDays = getDaysInYear(year);
233
- const time = Math.round((value - year) * totalDays) * oneDayTime;
234
- const date = new Date(january1st.getTime() + time);
235
- return date;
246
+ const year = Math.floor(value)
247
+ const january1st = new Date(year, 0, 1)
248
+ const totalDays = getDaysInYear(year)
249
+ const time = Math.round((value - year) * totalDays) * oneDayTime
250
+ const date = new Date(january1st.getTime() + time)
251
+ return date
236
252
  }
237
- const oneDayTime = 24 * 60 * 60 * 1e3;
253
+ const oneDayTime = 24 * 60 * 60 * 1e3
238
254
  function getDateStrFromNumber(value) {
239
- const date = getDateFromNumber(value);
240
- return date.toLocaleDateString("en-US", {
241
- year: "numeric",
242
- month: "long"
243
- });
255
+ const date = getDateFromNumber(value)
256
+ return date.toLocaleDateString("en-US", {
257
+ year: "numeric",
258
+ month: "long",
259
+ })
244
260
  }
245
261
  function getNumberFromDateStr(str) {
246
- const date = new Date(str);
247
- return getNumberFromDate(date);
262
+ const date = new Date(str)
263
+ return getNumberFromDate(date)
248
264
  }
249
265
  function getNumberFromDate(date) {
250
- const year = date.getFullYear();
251
- const january1st = new Date(year, 0, 1);
252
- const diffDays = (date.getTime() - january1st.getTime()) / oneDayTime;
253
- const daysTotal = getDaysInYear(year);
254
- const decimal = diffDays / daysTotal;
255
- return year + decimal;
266
+ const year = date.getFullYear()
267
+ const january1st = new Date(year, 0, 1)
268
+ const diffDays = (date.getTime() - january1st.getTime()) / oneDayTime
269
+ const daysTotal = getDaysInYear(year)
270
+ const decimal = diffDays / daysTotal
271
+ return year + decimal
256
272
  }
257
273
  function getDaysInYear(year) {
258
- const isLeap = new Date(year, 1, 29).getMonth() === 1;
259
- const days = isLeap ? 366 : 365;
260
- return days;
274
+ const isLeap = new Date(year, 1, 29).getMonth() === 1
275
+ const days = isLeap ? 366 : 365
276
+ return days
261
277
  }
262
278
  export {
263
- CATEGORICAL,
264
- CONDITION,
265
- DATE,
266
- DEFAULT_SAMPLE_TYPE,
267
- DNA_METHYLATION,
268
- FLOAT,
269
- GENE_EXPRESSION,
270
- GENE_VARIANT,
271
- INTEGER,
272
- METABOLITE_INTENSITY,
273
- MULTIVALUE,
274
- NUMERIC_DICTIONARY_TERM,
275
- NumericModes,
276
- ROOT_SAMPLE_TYPE,
277
- SAMPLELST,
278
- SINGLECELL_CELLTYPE,
279
- SINGLECELL_GENE_EXPRESSION,
280
- SNP,
281
- SNP_LIST,
282
- SNP_LOCUS,
283
- SSGSEA,
284
- SURVIVAL,
285
- TERM_COLLECTION,
286
- TermTypeGroups2 as TermTypeGroups,
287
- TermTypes,
288
- TermTypes2Dt,
289
- WHOLE_PROTEOME_ABUNDANCE,
290
- annoNumericTypes,
291
- dtTermTypes,
292
- equals,
293
- getBin,
294
- getDateFromNumber,
295
- getDateStrFromNumber,
296
- getDaysInYear,
297
- getNumberFromDate,
298
- getNumberFromDateStr,
299
- getParentType,
300
- getSampleType,
301
- isCategoricalTerm,
302
- isDictionaryType,
303
- isNonDictionaryType,
304
- isNumericTerm,
305
- isSingleCellTerm,
306
- numericTypes,
307
- termType2label,
308
- typeGroup
309
- };
279
+ CATEGORICAL,
280
+ CONDITION,
281
+ DATE,
282
+ DEFAULT_SAMPLE_TYPE,
283
+ DNA_METHYLATION,
284
+ FLOAT,
285
+ GENE_EXPRESSION,
286
+ GENE_VARIANT,
287
+ INTEGER,
288
+ METABOLITE_INTENSITY,
289
+ MULTIVALUE,
290
+ NumericModes,
291
+ PROTEOME_ABUNDANCE,
292
+ ROOT_SAMPLE_TYPE,
293
+ SAMPLELST,
294
+ SINGLECELL_CELLTYPE,
295
+ SINGLECELL_GENE_EXPRESSION,
296
+ SNP,
297
+ SNP_LIST,
298
+ SNP_LOCUS,
299
+ SSGSEA,
300
+ SURVIVAL,
301
+ TERM_COLLECTION,
302
+ TermTypeGroups2 as TermTypeGroups,
303
+ TermTypes,
304
+ TermTypes2Dt,
305
+ annoNumericTypes,
306
+ dtTermTypes,
307
+ equals,
308
+ getBin,
309
+ getDateFromNumber,
310
+ getDateStrFromNumber,
311
+ getDaysInYear,
312
+ getNumberFromDate,
313
+ getNumberFromDateStr,
314
+ getParentType,
315
+ getSampleType,
316
+ isCategoricalTerm,
317
+ isDictionaryType,
318
+ isNonDictionaryType,
319
+ isNumericTerm,
320
+ isSingleCellTerm,
321
+ numericTypes,
322
+ termType2label,
323
+ typeGroup,
324
+ }
package/src/tree.js CHANGED
@@ -29,8 +29,8 @@ using Map for lp, nodes etc will cause memory issue, thus the use of simple obje
29
29
  to-do: verify this works after a reorg
30
30
  */
31
31
 
32
- const hardcode_root = 'root'
33
- const hierarchy_spacer = '...'
32
+ const hardcode_root = "root"
33
+ const hierarchy_spacer = "..."
34
34
 
35
35
  export function stratinput(lst, levels) {
36
36
  const lp = Object.create(null)
@@ -75,7 +75,7 @@ export function stratinput(lst, levels) {
75
75
  }
76
76
  if (!(thisv in nodes)) {
77
77
  const n = {
78
- lst: []
78
+ lst: [],
79
79
  }
80
80
  if (lev.full) {
81
81
  n.full = m[lev.full]
@@ -119,7 +119,7 @@ export function stratinput(lst, levels) {
119
119
  id1: n.id1,
120
120
  v1: n.v1,
121
121
  id2: n.id2,
122
- v2: n.v2
122
+ v2: n.v2,
123
123
  })
124
124
  }
125
125
  return nlst
package/src/vcf.ann.js CHANGED
@@ -1,12 +1,12 @@
1
- import { vepinfo } from './common.js'
1
+ import { vepinfo } from "./common.js"
2
2
 
3
3
  export function parse_ANN(str, header, m) {
4
4
  // snpEff
5
5
  if (!header) {
6
6
  return null
7
7
  }
8
- for (const thisannotation of str.split(',')) {
9
- const lst = thisannotation.replace(/&/g, ',').split('|')
8
+ for (const thisannotation of str.split(",")) {
9
+ const lst = thisannotation.replace(/&/g, ",").split("|")
10
10
 
11
11
  const o = {}
12
12
 
@@ -35,8 +35,8 @@ export function parse_ANN(str, header, m) {
35
35
  allele.ann.push(o)
36
36
  o._gene = o.Gene_Name
37
37
  // isoform
38
- if (o.Feature_Type && o.Feature_Type == 'transcript' && o.Feature_ID) {
39
- o._isoform = o.Feature_ID.split('.')[0]
38
+ if (o.Feature_Type && o.Feature_Type == "transcript" && o.Feature_ID) {
39
+ o._isoform = o.Feature_ID.split(".")[0]
40
40
  }
41
41
  // class
42
42
  if (o.Annotation) {
@@ -50,11 +50,11 @@ export function parse_ANN(str, header, m) {
50
50
  o._class = mclassnonstandard
51
51
  }
52
52
  // mname
53
- if (o['HGVS.p']) {
53
+ if (o["HGVS.p"]) {
54
54
  //o._mname=decodeURIComponent(o.HGVSp.substr(o.HGVSp.indexOf(':')+1))
55
- o._mname = o['HGVS.p']
56
- } else if (o['HGVS.c']) {
57
- o._mname = o['HGVS.c']
55
+ o._mname = o["HGVS.p"]
56
+ } else if (o["HGVS.c"]) {
57
+ o._mname = o["HGVS.c"]
58
58
  } else {
59
59
  }
60
60
  }