@vitessce/sets-utils 4.0.3 → 4.0.5
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/dist/index.js +986 -5396
- package/dist-tsc/CellSetsZarrLoader.d.ts +23 -0
- package/dist-tsc/CellSetsZarrLoader.d.ts.map +1 -1
- package/dist-tsc/CellSetsZarrLoader.js +90 -6
- package/dist-tsc/CellSetsZarrLoader.js.map +1 -1
- package/dist-tsc/CellSetsZarrLoader.test.js +76 -1
- package/dist-tsc/CellSetsZarrLoader.test.js.map +1 -1
- package/dist-tsc/cell-set-utils.d.ts +78 -1
- package/dist-tsc/cell-set-utils.d.ts.map +1 -1
- package/dist-tsc/cell-set-utils.js +308 -66
- package/dist-tsc/cell-set-utils.js.map +1 -1
- package/dist-tsc/cell-set-utils.test.fixtures.d.ts +14 -0
- package/dist-tsc/cell-set-utils.test.fixtures.js +18 -0
- package/dist-tsc/cell-set-utils.test.fixtures.js.map +1 -1
- package/dist-tsc/cell-set-utils.test.js +319 -2
- package/dist-tsc/cell-set-utils.test.js.map +1 -1
- package/dist-tsc/expr-utils.d.ts +51 -46
- package/dist-tsc/expr-utils.d.ts.map +1 -1
- package/dist-tsc/expr-utils.js +297 -222
- package/dist-tsc/expr-utils.js.map +1 -1
- package/dist-tsc/expr-utils.test.js +77 -5
- package/dist-tsc/expr-utils.test.js.map +1 -1
- package/dist-tsc/index.d.ts +3 -2
- package/dist-tsc/index.js +3 -2
- package/dist-tsc/index.js.map +1 -1
- package/dist-tsc/io.d.ts.map +1 -1
- package/dist-tsc/io.js +1 -3
- package/dist-tsc/io.js.map +1 -1
- package/dist-tsc/membership.d.ts +43 -0
- package/dist-tsc/membership.d.ts.map +1 -0
- package/dist-tsc/membership.js +212 -0
- package/dist-tsc/membership.js.map +1 -0
- package/dist-tsc/membership.test.d.ts +2 -0
- package/dist-tsc/membership.test.d.ts.map +1 -0
- package/dist-tsc/membership.test.js +128 -0
- package/dist-tsc/membership.test.js.map +1 -0
- package/package.json +6 -5
- package/src/CellSetsZarrLoader.js +99 -6
- package/src/CellSetsZarrLoader.test.js +88 -1
- package/src/cell-set-utils.js +322 -57
- package/src/cell-set-utils.test.fixtures.js +19 -0
- package/src/cell-set-utils.test.js +392 -0
- package/src/expr-utils.js +315 -248
- package/src/expr-utils.test.js +121 -5
- package/src/index.js +11 -0
- package/src/io.js +1 -3
- package/src/membership.js +217 -0
- package/src/membership.test.js +136 -0
package/dist-tsc/expr-utils.js
CHANGED
|
@@ -1,252 +1,327 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
2
|
import { InternMap } from 'internmap';
|
|
3
3
|
import { getValueTransformFunction } from '@vitessce/utils';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { treeToSelectedSetMap, treeToObsIdsBySetNames, } from './cell-set-utils.js';
|
|
4
|
+
import { treeToSelectedSetMap, treeToSetIndicesArray, setIndicesFromCodes, } from './cell-set-utils.js';
|
|
5
|
+
const hasSelection = selection => Array.isArray(selection) && selection.length > 0;
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* {
|
|
12
|
-
* "selectedCellSet1": {
|
|
13
|
-
* "selectedSampleSet1": [],
|
|
14
|
-
* }
|
|
15
|
-
* },
|
|
16
|
-
* exprMax
|
|
17
|
-
* ]
|
|
18
|
-
* @param {*} sampleEdges
|
|
19
|
-
* @param {*} sampleSets
|
|
20
|
-
* @param {*} sampleSetSelection
|
|
21
|
-
* @param {*} expressionData
|
|
22
|
-
* @param {*} obsIndex
|
|
23
|
-
* @param {*} mergedCellSets
|
|
24
|
-
* @param {*} geneSelection
|
|
25
|
-
* @param {*} cellSetSelection
|
|
26
|
-
* @param {*} cellSetColor
|
|
27
|
-
* @param {*} featureValueTransform
|
|
28
|
-
* @param {*} featureValueTransformCoefficient
|
|
29
|
-
* @returns
|
|
7
|
+
* The smallest unsigned typed array able to hold 1..count plus 0.
|
|
8
|
+
* @param {number} count The number of selected sets.
|
|
9
|
+
* @returns {Uint8ArrayConstructor|Uint16ArrayConstructor|Uint32ArrayConstructor}
|
|
30
10
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
|
|
35
|
-
const hasCellSetSelection = Array.isArray(cellSetSelection) && cellSetSelection.length > 0;
|
|
36
|
-
const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
|
|
37
|
-
const cellSetKeys = hasCellSetSelection ? cellSetSelection : [null];
|
|
38
|
-
const arrKeys = Object.keys(arraysToStratify);
|
|
39
|
-
if (arrKeys.includes('obsIndex') || arrKeys.includes('i')) {
|
|
40
|
-
throw new Error('The keys "obsIndex" and "i" are reserved for internal use.');
|
|
11
|
+
function getSlotArrayType(count) {
|
|
12
|
+
if (count + 1 <= 256) {
|
|
13
|
+
return Uint8Array;
|
|
41
14
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
15
|
+
return count + 1 <= 65536 ? Uint16Array : Uint32Array;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the selections to positional "slot" arrays, so that the per-observation
|
|
19
|
+
* work below is a typed-array read rather than a string-keyed map lookup.
|
|
20
|
+
*
|
|
21
|
+
* cellSlot[i] is 1 + the position in cellSetSelection of the selected set
|
|
22
|
+
* containing observation i (0 when in none); null when there is no cell set
|
|
23
|
+
* selection. sampleSlot[i] is the same for sampleSetSelection via sampleEdges
|
|
24
|
+
* (obsId -> sampleId); null when there is no sample set selection.
|
|
25
|
+
*
|
|
26
|
+
* When raw categorical codes are available for this same observation index
|
|
27
|
+
* (checked by reference), the cell set slots come from the codes without
|
|
28
|
+
* walking the tree; otherwise from the tree, resolving each selected set's
|
|
29
|
+
* members once rather than once per observation.
|
|
30
|
+
* @param {object} params
|
|
31
|
+
* @returns {{ cellSlot: ArrayLike<number>|null, sampleSlot: ArrayLike<number>|null }}
|
|
32
|
+
*/
|
|
33
|
+
function computeStrata({ obsIndex, mergedCellSets, cellSetSelection, obsSetsColumns, sampleEdges, sampleSets, sampleSetSelection, }) {
|
|
34
|
+
const numObs = obsIndex?.length || 0;
|
|
35
|
+
let cellSlot = null;
|
|
36
|
+
if (hasSelection(cellSetSelection)) {
|
|
37
|
+
if (obsSetsColumns && obsSetsColumns.obsIndex === obsIndex) {
|
|
38
|
+
cellSlot = setIndicesFromCodes({
|
|
39
|
+
columns: obsSetsColumns.columns,
|
|
40
|
+
obsIndex,
|
|
41
|
+
selectedNamePaths: cellSetSelection,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (cellSlot === null) {
|
|
45
|
+
cellSlot = treeToSetIndicesArray(mergedCellSets, cellSetSelection, obsIndex);
|
|
48
46
|
}
|
|
49
|
-
return arr.length !== obsIndex.length;
|
|
50
|
-
})) {
|
|
51
|
-
// throw new Error('All arrays must have the same length as the obsIndex.');
|
|
52
47
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
|
|
65
|
-
// Third level: array
|
|
66
|
-
// Handle cellSetKey and sampleSetKey being null.
|
|
67
|
-
const sampleIdsInSampleSet = (sampleSetInfo && sampleSetKey
|
|
68
|
-
? sampleSetInfo?.find(n => isEqual(n.path, sampleSetKey))
|
|
69
|
-
: null)?.ids;
|
|
70
|
-
// The sampleSets contain sampleIds. We need to get the obsIds
|
|
71
|
-
// corresponding to each sampleId.
|
|
72
|
-
const obsIdsInSampleSet = sampleIdsInSampleSet
|
|
73
|
-
? sampleIdsInSampleSet.flatMap(sampleId => sampleIdToObsIdsMap?.get(sampleId) || [])
|
|
74
|
-
: null;
|
|
75
|
-
const obsIdsInCellSet = (cellSetInfo && cellSetKey
|
|
76
|
-
? cellSetInfo?.find(n => isEqual(n.path, cellSetKey))
|
|
77
|
-
: null)?.ids;
|
|
78
|
-
// Handle cases where obsIdsInSampleSet and/or obsIdsInCellSet is null.
|
|
79
|
-
let subObsIndex = obsIndex;
|
|
80
|
-
if (obsIdsInSampleSet && obsIdsInCellSet) {
|
|
81
|
-
subObsIndex = Array.from((new Set(obsIdsInSampleSet)).intersection(new Set(obsIdsInCellSet)));
|
|
82
|
-
}
|
|
83
|
-
else if (obsIdsInSampleSet) {
|
|
84
|
-
subObsIndex = obsIdsInSampleSet;
|
|
85
|
-
}
|
|
86
|
-
else if (obsIdsInCellSet) {
|
|
87
|
-
subObsIndex = obsIdsInCellSet;
|
|
88
|
-
}
|
|
89
|
-
const arrLen = subObsIndex.length;
|
|
90
|
-
arrKeys.forEach((arrKey) => {
|
|
91
|
-
// Instantiate a new array of the appropriate size.
|
|
92
|
-
const newArr = new arraysToStratify[arrKey].constructor(arrLen);
|
|
93
|
-
result.get(cellSetKey).get(sampleSetKey).set(arrKey, newArr);
|
|
48
|
+
let sampleSlot = null;
|
|
49
|
+
if (hasSelection(sampleSetSelection)) {
|
|
50
|
+
const SlotArrayType = getSlotArrayType(sampleSetSelection.length);
|
|
51
|
+
sampleSlot = new SlotArrayType(numObs);
|
|
52
|
+
if (sampleSets && sampleEdges) {
|
|
53
|
+
// Sample sets are small: resolve sampleId -> slot once, then one map lookup
|
|
54
|
+
// per observation to find its sample.
|
|
55
|
+
const slotByPath = new InternMap(sampleSetSelection.map((path, i) => [path, i + 1]), JSON.stringify);
|
|
56
|
+
const sampleIdToSlot = new Map();
|
|
57
|
+
treeToSelectedSetMap(sampleSets, sampleSetSelection).forEach((path, sampleId) => {
|
|
58
|
+
sampleIdToSlot.set(sampleId, slotByPath.get(path) ?? 0);
|
|
94
59
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
60
|
+
for (let i = 0; i < numObs; i += 1) {
|
|
61
|
+
const sampleId = sampleEdges.get(obsIndex[i]);
|
|
62
|
+
if (sampleId !== undefined) {
|
|
63
|
+
sampleSlot[i] = sampleIdToSlot.get(sampleId) ?? 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return { cellSlot, sampleSlot };
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Assign every observation to a (cell set, sample set) group and count the
|
|
72
|
+
* members of each, so that per-group arrays can be allocated at their final size.
|
|
73
|
+
* @param {object} params
|
|
74
|
+
* @param {number} params.numObs
|
|
75
|
+
* @param {ArrayLike<number>|null} params.cellSlot From computeStrata.
|
|
76
|
+
* @param {ArrayLike<number>|null} params.sampleSlot From computeStrata.
|
|
77
|
+
* @param {number} params.numSampleGroups Number of sample set keys.
|
|
78
|
+
* @param {number} params.numCellGroups Number of cell set keys.
|
|
79
|
+
* @returns {{ groupOfObs: Int32Array, counts: Int32Array, numGroups: number }}
|
|
80
|
+
* groupOfObs[i] = cellGroup * numSampleGroups + sampleGroup, or -1 when excluded.
|
|
81
|
+
*/
|
|
82
|
+
function assignGroups({ numObs, cellSlot, sampleSlot, numSampleGroups, numCellGroups, }) {
|
|
83
|
+
const numGroups = numCellGroups * numSampleGroups;
|
|
84
|
+
const groupOfObs = new Int32Array(numObs);
|
|
85
|
+
const counts = new Int32Array(numGroups);
|
|
86
|
+
for (let i = 0; i < numObs; i += 1) {
|
|
87
|
+
const cellGroup = cellSlot ? cellSlot[i] - 1 : 0;
|
|
88
|
+
const sampleGroup = sampleSlot ? sampleSlot[i] - 1 : 0;
|
|
89
|
+
if (cellGroup < 0 || sampleGroup < 0) {
|
|
90
|
+
groupOfObs[i] = -1;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
const group = cellGroup * numSampleGroups + sampleGroup;
|
|
94
|
+
groupOfObs[i] = group;
|
|
95
|
+
counts[group] += 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return { groupOfObs, counts, numGroups };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Stratify per-observation arrays (e.g. embedding coordinates) by selected cell
|
|
102
|
+
* set and selected sample set.
|
|
103
|
+
*
|
|
104
|
+
* Output: an InternMap keyed by cell set path (or null) of InternMaps keyed by
|
|
105
|
+
* sample set path (or null), each holding one array per key of arraysToStratify
|
|
106
|
+
* (of the same constructor as the input) plus 'obsIndex', all aligned with one
|
|
107
|
+
* another and in observation-index order.
|
|
108
|
+
* @param {Map<string, string>|null} sampleEdges Mapping from obsId to sampleId.
|
|
109
|
+
* @param {object|null} sampleSets Sample sets tree.
|
|
110
|
+
* @param {array|null} sampleSetSelection Selected sample set paths.
|
|
111
|
+
* @param {string[]} obsIndex The observation index the arrays align to.
|
|
112
|
+
* @param {object|null} mergedCellSets Cell sets tree.
|
|
113
|
+
* @param {array|null} cellSetSelection Selected cell set paths.
|
|
114
|
+
* @param {object} arraysToStratify Arrays aligned with obsIndex. The key
|
|
115
|
+
* 'featureValue' holds an array of per-feature arrays, aggregated per
|
|
116
|
+
* featureAggregationStrategy.
|
|
117
|
+
* @param {string|number} featureAggregationStrategy How to combine several
|
|
118
|
+
* features: 'first', 'last', a feature index, 'sum', or 'mean'.
|
|
119
|
+
* @param {object} [options]
|
|
120
|
+
* @param {object} [options.obsSetsColumns] Raw categorical columns for the
|
|
121
|
+
* observation sets, as loaded alongside the tree, for a code-based fast path.
|
|
122
|
+
* @returns {[InternMap, number]} The stratified arrays and the number of
|
|
123
|
+
* observations placed.
|
|
124
|
+
*/
|
|
125
|
+
export function stratifyArrays(sampleEdges, sampleSets, sampleSetSelection, obsIndex, mergedCellSets, cellSetSelection, arraysToStratify, // Assumed to be sorted with respect to the obsIndex.
|
|
126
|
+
featureAggregationStrategy, options = {}) {
|
|
127
|
+
const { obsSetsColumns = null } = options;
|
|
128
|
+
const arrKeys = Object.keys(arraysToStratify);
|
|
129
|
+
if (arrKeys.includes('obsIndex') || arrKeys.includes('i')) {
|
|
130
|
+
throw new Error('The keys "obsIndex" and "i" are reserved for internal use.');
|
|
131
|
+
}
|
|
132
|
+
const hasSampleSetSelection = hasSelection(sampleSetSelection);
|
|
133
|
+
const hasCellSetSelection = hasSelection(cellSetSelection);
|
|
134
|
+
const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
|
|
135
|
+
const cellSetKeys = hasCellSetSelection ? cellSetSelection : [null];
|
|
136
|
+
const numObs = obsIndex?.length || 0;
|
|
137
|
+
const { cellSlot, sampleSlot } = computeStrata({
|
|
138
|
+
obsIndex,
|
|
139
|
+
mergedCellSets,
|
|
140
|
+
cellSetSelection,
|
|
141
|
+
obsSetsColumns,
|
|
142
|
+
sampleEdges,
|
|
143
|
+
sampleSets,
|
|
144
|
+
sampleSetSelection,
|
|
100
145
|
});
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
:
|
|
107
|
-
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const cellSet = cellIdToSetMap?.get(obsId) || null;
|
|
114
|
-
const sampleId = sampleEdges?.get(obsId);
|
|
115
|
-
const sampleSet = sampleId ? (sampleIdToSetMap?.get(sampleId) || null) : null;
|
|
116
|
-
if ((hasSampleSetSelection && !sampleSet) || (hasCellSetSelection && !cellSet)) {
|
|
117
|
-
// Skip this sample if it is not in the selected sample set.
|
|
118
|
-
// eslint-disable-next-line no-continue
|
|
119
|
-
continue;
|
|
146
|
+
const { groupOfObs, counts, numGroups } = assignGroups({
|
|
147
|
+
numObs,
|
|
148
|
+
cellSlot,
|
|
149
|
+
sampleSlot,
|
|
150
|
+
numSampleGroups: sampleSetKeys.length,
|
|
151
|
+
numCellGroups: cellSetKeys.length,
|
|
152
|
+
});
|
|
153
|
+
// One accessor per array, resolved once rather than per observation.
|
|
154
|
+
const getters = arrKeys.map((arrKey) => {
|
|
155
|
+
const arr = arraysToStratify[arrKey];
|
|
156
|
+
if (arrKey !== 'featureValue') {
|
|
157
|
+
return i => arr[i];
|
|
120
158
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
value = arraysToStratify[arrKey].reduce((a, h) => a + h[i], 0);
|
|
139
|
-
if (featureAggregationStrategy === 'mean') {
|
|
140
|
-
value /= arraysToStratify[arrKey].length;
|
|
141
|
-
}
|
|
159
|
+
if (featureAggregationStrategy === 'first') {
|
|
160
|
+
return i => arr[0][i];
|
|
161
|
+
}
|
|
162
|
+
if (featureAggregationStrategy === 'last') {
|
|
163
|
+
return i => arr[arr.length - 1][i];
|
|
164
|
+
}
|
|
165
|
+
if (typeof featureAggregationStrategy === 'number') {
|
|
166
|
+
// TODO: more checks here for array index validity.
|
|
167
|
+
const j = featureAggregationStrategy;
|
|
168
|
+
return i => arr[j][i];
|
|
169
|
+
}
|
|
170
|
+
if (featureAggregationStrategy === 'sum' || featureAggregationStrategy === 'mean') {
|
|
171
|
+
const divisor = featureAggregationStrategy === 'mean' ? arr.length : 1;
|
|
172
|
+
return (i) => {
|
|
173
|
+
let sum = 0;
|
|
174
|
+
for (let h = 0; h < arr.length; h += 1) {
|
|
175
|
+
sum += arr[h][i];
|
|
142
176
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
177
|
+
return sum / divisor;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return () => undefined;
|
|
181
|
+
});
|
|
182
|
+
// Allocate every group's arrays at their final size.
|
|
183
|
+
const groupArrays = new Array(numGroups);
|
|
184
|
+
for (let g = 0; g < numGroups; g += 1) {
|
|
185
|
+
groupArrays[g] = {
|
|
186
|
+
arrays: arrKeys.map(arrKey => new arraysToStratify[arrKey].constructor(counts[g])),
|
|
187
|
+
obsIndex: new Array(counts[g]),
|
|
188
|
+
};
|
|
154
189
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
190
|
+
const positions = new Int32Array(numGroups);
|
|
191
|
+
let cellCount = 0;
|
|
192
|
+
for (let i = 0; i < numObs; i += 1) {
|
|
193
|
+
const g = groupOfObs[i];
|
|
194
|
+
if (g >= 0) {
|
|
195
|
+
const pos = positions[g];
|
|
196
|
+
positions[g] += 1;
|
|
197
|
+
const target = groupArrays[g];
|
|
198
|
+
for (let a = 0; a < arrKeys.length; a += 1) {
|
|
199
|
+
target.arrays[a][pos] = getters[a](i);
|
|
161
200
|
}
|
|
162
|
-
|
|
201
|
+
target.obsIndex[pos] = obsIndex[i];
|
|
202
|
+
cellCount += 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const result = new InternMap([], JSON.stringify);
|
|
206
|
+
cellSetKeys.forEach((cellSetKey, c) => {
|
|
207
|
+
const sampleMap = new InternMap([], JSON.stringify);
|
|
208
|
+
result.set(cellSetKey, sampleMap);
|
|
209
|
+
sampleSetKeys.forEach((sampleSetKey, s) => {
|
|
210
|
+
const group = groupArrays[c * sampleSetKeys.length + s];
|
|
211
|
+
const arrayMap = new InternMap([], JSON.stringify);
|
|
212
|
+
arrKeys.forEach((arrKey, a) => {
|
|
213
|
+
arrayMap.set(arrKey, group.arrays[a]);
|
|
214
|
+
});
|
|
215
|
+
arrayMap.set('obsIndex', group.obsIndex);
|
|
216
|
+
sampleMap.set(sampleSetKey, arrayMap);
|
|
163
217
|
});
|
|
164
218
|
});
|
|
165
219
|
return [result, cellCount];
|
|
166
220
|
}
|
|
167
221
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* ]
|
|
178
|
-
*
|
|
179
|
-
* @param {
|
|
180
|
-
* @param {
|
|
181
|
-
* @param {
|
|
182
|
-
* @param {
|
|
183
|
-
* @param {
|
|
184
|
-
* @param {
|
|
185
|
-
* @param {
|
|
186
|
-
* @param {
|
|
187
|
-
* @param {
|
|
188
|
-
*
|
|
189
|
-
* @returns
|
|
222
|
+
* Stratify expression values by selected cell set, selected sample set, and gene.
|
|
223
|
+
*
|
|
224
|
+
* Output: an InternMap keyed by cell set path of InternMaps keyed by sample set
|
|
225
|
+
* path (or null) of InternMaps keyed by gene, each holding a plain array of
|
|
226
|
+
* transformed values in observation-index order, plus the maximum transformed
|
|
227
|
+
* value overall.
|
|
228
|
+
* @param {Map<string, string>|null} sampleEdges Mapping from obsId to sampleId.
|
|
229
|
+
* @param {object|null} sampleSets Sample sets tree.
|
|
230
|
+
* @param {array|null} sampleSetSelection Selected sample set paths.
|
|
231
|
+
* @param {ArrayLike<number>[]} expressionData One array per selected gene,
|
|
232
|
+
* aligned with obsIndex.
|
|
233
|
+
* @param {string[]} obsIndex The observation index.
|
|
234
|
+
* @param {object|null} mergedCellSets Cell sets tree.
|
|
235
|
+
* @param {string[]} geneSelection Selected genes.
|
|
236
|
+
* @param {array|null} cellSetSelection Selected cell set paths.
|
|
237
|
+
* @param {object[]} cellSetColor Unused; kept for call compatibility.
|
|
238
|
+
* @param {string|null} featureValueTransform Transform name, e.g. 'log1p'.
|
|
239
|
+
* @param {number} featureValueTransformCoefficient Transform coefficient.
|
|
240
|
+
* @param {object} [options]
|
|
241
|
+
* @param {object} [options.obsSetsColumns] Raw categorical columns for the
|
|
242
|
+
* observation sets, for a code-based fast path.
|
|
243
|
+
* @returns {[InternMap|null, number|null]} The stratified values and the maximum.
|
|
190
244
|
*/
|
|
191
245
|
export function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, mergedCellSets, geneSelection, cellSetSelection, cellSetColor, // TODO: remove this parameter
|
|
192
|
-
featureValueTransform, featureValueTransformCoefficient) {
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
246
|
+
featureValueTransform, featureValueTransformCoefficient, options = {}) {
|
|
247
|
+
const { obsSetsColumns = null } = options;
|
|
248
|
+
if (!(mergedCellSets && cellSetSelection
|
|
249
|
+
&& geneSelection && geneSelection.length >= 1
|
|
250
|
+
&& expressionData)) {
|
|
251
|
+
return [null, null];
|
|
252
|
+
}
|
|
253
|
+
const hasSampleSetSelection = hasSelection(sampleSetSelection);
|
|
254
|
+
const hasCellSetSelection = hasSelection(cellSetSelection);
|
|
197
255
|
const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
|
|
198
256
|
const cellSetKeys = hasCellSetSelection ? cellSetSelection : [null];
|
|
199
|
-
const geneKeys =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
257
|
+
const geneKeys = geneSelection;
|
|
258
|
+
const numObs = obsIndex?.length || 0;
|
|
259
|
+
let exprMax = -Infinity;
|
|
260
|
+
const numGroups = cellSetKeys.length * sampleSetKeys.length;
|
|
261
|
+
// With an empty cell set selection nothing is assigned; the groups stay empty.
|
|
262
|
+
let groupOfObs = null;
|
|
263
|
+
let counts = new Int32Array(numGroups);
|
|
264
|
+
if (hasCellSetSelection) {
|
|
265
|
+
const { cellSlot, sampleSlot } = computeStrata({
|
|
266
|
+
obsIndex,
|
|
267
|
+
mergedCellSets,
|
|
268
|
+
cellSetSelection,
|
|
269
|
+
obsSetsColumns,
|
|
270
|
+
sampleEdges,
|
|
271
|
+
sampleSets,
|
|
272
|
+
sampleSetSelection,
|
|
212
273
|
});
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
274
|
+
({ groupOfObs, counts } = assignGroups({
|
|
275
|
+
numObs,
|
|
276
|
+
cellSlot,
|
|
277
|
+
sampleSlot,
|
|
278
|
+
numSampleGroups: sampleSetKeys.length,
|
|
279
|
+
numCellGroups: cellSetKeys.length,
|
|
280
|
+
}));
|
|
281
|
+
}
|
|
282
|
+
const transform = getValueTransformFunction(featureValueTransform, featureValueTransformCoefficient);
|
|
283
|
+
// leaves[group][geneI] is the plain array of values for that group and gene,
|
|
284
|
+
// allocated at its final size (consumers rely on Array methods such as flat()).
|
|
285
|
+
const leaves = new Array(numGroups);
|
|
286
|
+
for (let g = 0; g < numGroups; g += 1) {
|
|
287
|
+
leaves[g] = geneKeys.map(() => new Array(counts[g]));
|
|
288
|
+
}
|
|
289
|
+
if (groupOfObs) {
|
|
290
|
+
const positions = new Int32Array(numGroups);
|
|
291
|
+
geneKeys.forEach((geneKey, geneI) => {
|
|
292
|
+
const column = expressionData[geneI];
|
|
293
|
+
if (!column) {
|
|
294
|
+
// Not loaded yet; leave this gene's arrays unfilled.
|
|
295
|
+
return;
|
|
233
296
|
}
|
|
234
|
-
|
|
297
|
+
positions.fill(0);
|
|
298
|
+
for (let i = 0; i < numObs; i += 1) {
|
|
299
|
+
const g = groupOfObs[i];
|
|
300
|
+
if (g >= 0) {
|
|
301
|
+
const value = transform(column[i]);
|
|
302
|
+
if (value > exprMax) {
|
|
303
|
+
exprMax = value;
|
|
304
|
+
}
|
|
305
|
+
leaves[g][geneI][positions[g]] = value;
|
|
306
|
+
positions[g] += 1;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
const result = new InternMap([], JSON.stringify);
|
|
312
|
+
cellSetKeys.forEach((cellSetKey, c) => {
|
|
313
|
+
const sampleMap = new InternMap([], JSON.stringify);
|
|
314
|
+
result.set(cellSetKey, sampleMap);
|
|
315
|
+
sampleSetKeys.forEach((sampleSetKey, s) => {
|
|
316
|
+
const geneMap = new InternMap([], JSON.stringify);
|
|
317
|
+
const group = leaves[c * sampleSetKeys.length + s];
|
|
235
318
|
geneKeys.forEach((geneKey, geneI) => {
|
|
236
|
-
|
|
237
|
-
const transformFunction = getValueTransformFunction(featureValueTransform, featureValueTransformCoefficient);
|
|
238
|
-
const transformedValue = transformFunction(value);
|
|
239
|
-
exprMax = Math.max(transformedValue, exprMax);
|
|
240
|
-
result
|
|
241
|
-
.get(cellSet)
|
|
242
|
-
?.get(sampleSet)
|
|
243
|
-
?.get(geneKey)
|
|
244
|
-
?.push(transformedValue);
|
|
319
|
+
geneMap.set(geneKey, group[geneI]);
|
|
245
320
|
});
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
return [
|
|
321
|
+
sampleMap.set(sampleSetKey, geneMap);
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
return [result, exprMax];
|
|
250
325
|
}
|
|
251
326
|
/**
|
|
252
327
|
* Supports three-level stratified input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expr-utils.js","sourceRoot":"","sources":["../src/expr-utils.js"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MA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