@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 +1 -1
- package/src/filter.js +1 -1
- package/src/terms.js +19 -19
- package/src/violin.bins.js +1 -1
package/package.json
CHANGED
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
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
206
|
+
export function termType2label(type) {
|
|
207
|
+
return typeMap[type] || 'Unknown term type'
|
|
208
208
|
}
|
package/src/violin.bins.js
CHANGED
|
@@ -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
|