@sjcrh/proteinpaint-shared 2.106.0 → 2.108.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.106.0",
3
+ "version": "2.108.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/filter.js CHANGED
@@ -145,7 +145,7 @@ export function sample_match_termvaluesetting(row, filter, _term = null, sample
145
145
  ) && true //; console.log(114, t.values[0].dt, samplevalue.dt, thistermmatch)
146
146
  }
147
147
  } else {
148
- throw 'unknown term type'
148
+ throw 'unknown term type [sample_match_termvaluesetting() shared/utils/src/filter.js]'
149
149
  }
150
150
 
151
151
  if (t.isnot) {
package/src/terms.js CHANGED
@@ -185,24 +185,24 @@ export function getParentType(types, ds) {
185
185
  return null //no parent found
186
186
  }
187
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
- }
188
+ //Returns human readable label for each term type; label is just for printing and not computing
189
+ const typeMap = {
190
+ categorical: 'Categorical',
191
+ condition: 'Condition',
192
+ float: 'Numerical',
193
+ integer: 'Numerical',
194
+ geneExpression: 'Gene Expression',
195
+ geneVariant: 'Gene Variant',
196
+ metaboliteIntensity: 'Metabolite Intensity',
197
+ multiValue: 'Multi Value',
198
+ singleCellGeneExpression: 'Single Cell, Gene Expression',
199
+ singleCellCellType: 'Single Cell, Cell Type',
200
+ snplocus: 'SNP Locus',
201
+ snp: 'SNP',
202
+ snplst: 'SNP List',
203
+ numericDictTerm: 'Numeric Dictionary Term'
204
+ }
206
205
 
207
- return typeMap[type] || 'Unknown type [shared/utils/src/terms.js getReadableType()]'
206
+ export function termType2label(type) {
207
+ return typeMap[type] || 'Unknown term type'
208
208
  }
@@ -117,7 +117,7 @@ function mean(data) {
117
117
  return data.reduce((sum, value) => sum + value, 0) / data.length
118
118
  }
119
119
 
120
- function stdDev(data) {
120
+ export function stdDev(data) {
121
121
  const meanValue = mean(data)
122
122
  const squaredDifferences = data.map(value => Math.pow(value - meanValue, 2))
123
123
  const variance = squaredDifferences.reduce((sum, value) => sum + value, 0) / data.length