@sjcrh/proteinpaint-shared 2.176.1-0 → 2.177.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-shared",
3
- "version": "2.176.1-0",
3
+ "version": "2.177.0",
4
4
  "description": "ProteinPaint code that is shared between server and client-side workspaces",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/common.js CHANGED
@@ -17,21 +17,22 @@ import { getWrappedTvslst } from './filter.js'
17
17
  // part of 'common' argument to exported dataset js function, at server runtime
18
18
  export const TermTypeGroups = {
19
19
  DICTIONARY_VARIABLES: 'Dictionary Variables',
20
- MUTATION_CNV_FUSION: 'Mutation/CNV/Fusion',
21
- VARIANT_GENOTYPE: 'Variant Genotype',
22
20
  DNA_METHYLATION: 'DNA Methylation',
23
21
  GENE_DEPENDENCY: 'Gene Dependency',
24
22
  GENE_EXPRESSION: 'Gene Expression',
25
- PROTEIN_EXPRESSION: 'Protein Expression',
26
- SPLICE_JUNCTION: 'Splice Junction',
27
- METABOLITE_INTENSITY: 'Metabolite Intensity',
28
23
  GSEA: 'GSEA',
24
+ METABOLITE_INTENSITY: 'Metabolite Intensity',
25
+ MUTATION_CNV_FUSION: 'Mutation/CNV/Fusion',
29
26
  MUTATION_SIGNATURE: 'Mutation Signature',
27
+ PROTEIN_EXPRESSION: 'Protein Expression',
28
+ SINGLECELL_CELLTYPE: 'Single-cell Cell Type',
30
29
  SNP: 'SNP Genotype',
31
30
  SNP_LIST: 'SNP List',
32
31
  SNP_LOCUS: 'SNP Locus',
32
+ SPLICE_JUNCTION: 'Splice Junction',
33
33
  SSGSEA: 'Geneset Expression',
34
- TERM_COLLECTION: 'Term Collection'
34
+ TERM_COLLECTION: 'Term Collection',
35
+ VARIANT_GENOTYPE: 'Variant Genotype'
35
36
  }
36
37
 
37
38
  export const defaultcolor = rgb('#8AB1D4').darker()
@@ -113,23 +113,7 @@ export function isUsableTerm(term, _usecase, termdbConfig, ds) {
113
113
  }
114
114
  return uses
115
115
  case 'runChart2':
116
- if (usecase.detail == 'date') {
117
- if (term.type == 'date') {
118
- uses.add('plot')
119
- }
120
- if (child_types.includes('date')) uses.add('branch')
121
- } else if (usecase.detail == 'numeric') {
122
- if (isNumericTerm(term) && term.type != 'date') {
123
- uses.add('plot')
124
- }
125
- if (hasNumericChild(child_types)) uses.add('branch')
126
- } else {
127
- if (graphableTypes.has(term.type)) uses.add('plot')
128
- if (!term.isleaf) uses.add('branch')
129
- }
130
- return uses
131
- case 'frequencyChart':
132
- if (usecase.detail == 'term') {
116
+ if (usecase.detail == 'date' || usecase.detail == 'xtw') {
133
117
  if (term.type == 'date') {
134
118
  uses.add('plot')
135
119
  }
package/src/terms.js CHANGED
@@ -70,7 +70,8 @@ export const typeGroup = {
70
70
  [TermTypes.GENE_EXPRESSION]: TermTypeGroups.GENE_EXPRESSION,
71
71
  [TermTypes.SSGSEA]: TermTypeGroups.SSGSEA,
72
72
  [TermTypes.METABOLITE_INTENSITY]: TermTypeGroups.METABOLITE_INTENSITY,
73
- [TermTypes.TERM_COLLECTION]: TermTypeGroups.TERM_COLLECTION
73
+ [TermTypes.TERM_COLLECTION]: TermTypeGroups.TERM_COLLECTION,
74
+ [TermTypes.SINGLECELL_CELLTYPE]: TermTypeGroups.SINGLECELL_CELLTYPE
74
75
  }
75
76
 
76
77
  const nonDictTypes = new Set([
@@ -196,6 +197,7 @@ export function getParentType(types, ds) {
196
197
  if (!ids || ids.length == 0) return null
197
198
  for (const id of ids) {
198
199
  const typeObj = ds.cohort.termdb.sampleTypes[id]
200
+ if (!typeObj) continue
199
201
  if (typeObj.parent_id == null) return id //this is the root type
200
202
  //if my parent is in the list, then I am not the parent
201
203
  if (ids.includes(typeObj.parent_id)) continue