@sjcrh/proteinpaint-shared 2.98.0 → 2.99.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.98.0",
3
+ "version": "2.99.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
@@ -307,7 +307,7 @@ mclass[mclasscnvloss] = {
307
307
  export const mclasscnvAmp = 'CNV_amplification'
308
308
  mclass[mclasscnvAmp] = {
309
309
  label: 'Copy number amplification',
310
- color: '#900000',
310
+ color: '#ff0000',
311
311
  dt: dtcnv,
312
312
  desc: 'Copy number amplification',
313
313
  key: mclasscnvAmp
@@ -316,7 +316,7 @@ mclass[mclasscnvAmp] = {
316
316
  export const mclasscnvHomozygousDel = 'CNV_homozygous_deletion'
317
317
  mclass[mclasscnvHomozygousDel] = {
318
318
  label: 'Copy number homozygous deletion',
319
- color: '#00457C',
319
+ color: '#0000ff',
320
320
  dt: dtcnv,
321
321
  desc: 'Copy number homozygous deletion',
322
322
  key: mclasscnvHomozygousDel
@@ -181,6 +181,18 @@ export function isUsableTerm(term, _usecase, termdbConfig, ds) {
181
181
  }
182
182
  // no specific rule for filter. pass and use default rules
183
183
 
184
+ case 'correlationVolcano':
185
+ if (usecase.detail == 'numeric') {
186
+ if (isNumericTerm(term)) {
187
+ uses.add('plot')
188
+ }
189
+ if (hasNumericChild(child_types)) uses.add('branch')
190
+ } else {
191
+ if (graphableTypes.has(term.type)) uses.add('plot')
192
+ if (!term.isleaf) uses.add('branch')
193
+ }
194
+ return uses
195
+
184
196
  default:
185
197
  if (graphableTypes.has(term.type)) uses.add('plot')
186
198
  if (!term.isleaf) uses.add('branch')
package/src/terms.js CHANGED
@@ -184,3 +184,25 @@ export function getParentType(types, ds) {
184
184
  }
185
185
  return null //no parent found
186
186
  }
187
+
188
+ //Returns human readable type (nice label) for the given type
189
+ export function getReadableType(type) {
190
+ const typeMap = {
191
+ categorical: 'Categorical',
192
+ condition: 'Condition',
193
+ float: 'Numeric',
194
+ integer: 'Numeric',
195
+ geneExpression: 'Gene Expression',
196
+ geneVariant: 'Gene Variant',
197
+ metaboliteIntensity: 'Metabolite Intensity',
198
+ multiValue: 'Multi Value',
199
+ samplelst: 'Sample List',
200
+ singleCellGeneExpression: 'Single Cell, Gene Expression',
201
+ singleCellCellType: 'Single Cell, Cell Type',
202
+ snplocus: 'SNP Locus',
203
+ snp: 'SNP',
204
+ snplst: 'SNP List'
205
+ }
206
+
207
+ return typeMap[type] || 'Unknown type [shared/utils/src/terms.js getReadableType()]'
208
+ }