spatialquery.js 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/assert.d.ts +15 -0
- package/dist/assert.d.ts.map +1 -0
- package/dist/assert.js +23 -0
- package/dist/assert.js.map +1 -0
- package/dist/fpgrowth.d.ts +10 -0
- package/dist/fpgrowth.d.ts.map +1 -0
- package/dist/fpgrowth.js +35 -0
- package/dist/fpgrowth.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/multi-fov.d.ts +115 -0
- package/dist/multi-fov.d.ts.map +1 -0
- package/dist/multi-fov.js +325 -0
- package/dist/multi-fov.js.map +1 -0
- package/dist/nested.d.ts +17 -0
- package/dist/nested.d.ts.map +1 -0
- package/dist/nested.js +106 -0
- package/dist/nested.js.map +1 -0
- package/dist/single-fov.d.ts +149 -0
- package/dist/single-fov.d.ts.map +1 -0
- package/dist/single-fov.js +488 -0
- package/dist/single-fov.js.map +1 -0
- package/dist/stats.d.ts +25 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/stats.js +141 -0
- package/dist/stats.js.map +1 -0
- package/package.json +35 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-fov.d.ts","sourceRoot":"","sources":["../src/single-fov.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAIhC,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAG3E,wBAAgB,yBAAyB,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,oBAAoB,EAAE,MAAM,IAExG,OAAO,MAAM,YAOtB;AAED,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAErE,KAA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+1,488 @@
|
|
|
1
|
+
import Flatbush from 'flatbush';
|
|
2
|
+
import { extent } from 'd3-array';
|
|
3
|
+
import { assert } from './assert.js';
|
|
4
|
+
import { hypergeom, roundHalfEven, applyFdrCorrection } from './stats.js';
|
|
5
|
+
import { mineFrequentPatterns } from './fpgrowth.js';
|
|
6
|
+
import { nestedMotifDescent } from './nested.js';
|
|
7
|
+
export function generateObsIdToObsSetName(obsSetsMembership, currSelectedSetGroup) {
|
|
8
|
+
// Function that accepts an obsId and returns a single string representing the cell type name.
|
|
9
|
+
return (obsId) => {
|
|
10
|
+
const obsIdCellType = obsSetsMembership.get(obsId)
|
|
11
|
+
?.find(setPath => setPath[0] === currSelectedSetGroup)?.[1]; // Again, we take the second element of the setPath as the cell type name
|
|
12
|
+
assert(typeof obsIdCellType === 'string', "Result of obsIdToObsSetName was falsey");
|
|
13
|
+
return obsIdCellType;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// Scale spatial coordinates so that the mean nearest neighbor distance equals 1.
|
|
17
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/0570c54bd6e046466e05c6b800d6701a7ab15c4a/SpatialQuery/spatial_utils.py#L804
|
|
18
|
+
export function normalizeSpatialCoords(xCoords, yCoords) {
|
|
19
|
+
const numCells = xCoords.length;
|
|
20
|
+
assert(numCells >= 2, "At least two cells are required to normalize spatial coordinates.");
|
|
21
|
+
// Temporary spatial index over the original coordinates, used to find each cell's nearest neighbor.
|
|
22
|
+
const index = new Flatbush(numCells);
|
|
23
|
+
for (let i = 0; i < numCells; i++) {
|
|
24
|
+
index.add(xCoords[i], yCoords[i]);
|
|
25
|
+
}
|
|
26
|
+
index.finish();
|
|
27
|
+
let nnDistSum = 0;
|
|
28
|
+
for (let i = 0; i < numCells; i++) {
|
|
29
|
+
// Exclude the cell itself (equivalent to taking the second result of a k=2 KDTree query).
|
|
30
|
+
const [j] = index.neighbors(xCoords[i], yCoords[i], 1, Infinity, (j) => j !== i);
|
|
31
|
+
nnDistSum += Math.hypot(xCoords[i] - xCoords[j], yCoords[i] - yCoords[j]);
|
|
32
|
+
}
|
|
33
|
+
const nnDist = nnDistSum / numCells;
|
|
34
|
+
assert(nnDist > 0, "Mean nearest neighbor distance was zero; cannot normalize spatial coordinates.");
|
|
35
|
+
const scaleFactor = 1.0 / nnDist;
|
|
36
|
+
return {
|
|
37
|
+
xCoords: Float64Array.from(xCoords, x => x * scaleFactor),
|
|
38
|
+
yCoords: Float64Array.from(yCoords, y => y * scaleFactor),
|
|
39
|
+
scaleFactor,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Build the context object.
|
|
43
|
+
export function buildContext(params) {
|
|
44
|
+
const { obsIndex, // Array of each obs ID, as a string.
|
|
45
|
+
xCoords: rawXCoords, // TypedArray containing X coordinate of each cell (centroid)
|
|
46
|
+
yCoords: rawYCoords, // TypedArray containing Y coordinate of each cell (centroid)
|
|
47
|
+
obsIdToObsSetName, // Function mapping an obs ID to its cell type label.
|
|
48
|
+
leafSize = 10, // Leaf size parameter for KDTree construction. Larger values reduce tree depth but increase computation per query.
|
|
49
|
+
normalizeSpatialCoord = true, // If True, normalizes spatial coordinates so mean nearest neighbor distance equals 1. This makes max_dist parameter interpretable as “number of cell diameters.” Set to False if original spatial units (e.g., micrometers) are required and should be preserved for downstream analysis.
|
|
50
|
+
} = params;
|
|
51
|
+
const { xCoords, yCoords } = normalizeSpatialCoord
|
|
52
|
+
? normalizeSpatialCoords(rawXCoords, rawYCoords)
|
|
53
|
+
: { xCoords: rawXCoords, yCoords: rawYCoords };
|
|
54
|
+
const xExtent = extent(xCoords);
|
|
55
|
+
const yExtent = extent(yCoords);
|
|
56
|
+
assert(typeof xExtent[0] === 'number' && typeof xExtent[1] === 'number', "X extent min or max was undefined.");
|
|
57
|
+
assert(typeof yExtent[0] === 'number' && typeof yExtent[1] === 'number', "Y extent min or max was undefined.");
|
|
58
|
+
// Initialize Flatbush for N items
|
|
59
|
+
const flatbushIndex = new Flatbush(obsIndex.length, leafSize);
|
|
60
|
+
for (let i = 0; i < obsIndex.length; i++) {
|
|
61
|
+
flatbushIndex.add(xCoords[i], yCoords[i]);
|
|
62
|
+
}
|
|
63
|
+
// perform the indexing
|
|
64
|
+
flatbushIndex.finish();
|
|
65
|
+
return {
|
|
66
|
+
obsIndex,
|
|
67
|
+
labels: obsIndex.map(obsId => obsIdToObsSetName(obsId)),
|
|
68
|
+
xCoords,
|
|
69
|
+
yCoords,
|
|
70
|
+
xExtent,
|
|
71
|
+
yExtent,
|
|
72
|
+
flatbushIndex,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Neighborhood queries
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
// Indices of cells within maxDist (inclusive) of a point, like KDTree.query_ball_point.
|
|
79
|
+
function radiusNeighbors(context, x, y, maxDist) {
|
|
80
|
+
return context.flatbushIndex.neighbors(x, y, Infinity, maxDist);
|
|
81
|
+
}
|
|
82
|
+
// The k nearest neighbors of cell i (excluding itself) and their distances,
|
|
83
|
+
// like KDTree.query(k=k+1) with the first result (the cell itself) dropped.
|
|
84
|
+
function knnNeighbors(context, i, k) {
|
|
85
|
+
const { xCoords, yCoords, flatbushIndex } = context;
|
|
86
|
+
const x = xCoords[i];
|
|
87
|
+
const y = yCoords[i];
|
|
88
|
+
const indices = flatbushIndex.neighbors(x, y, k, Infinity, j => j !== i);
|
|
89
|
+
const dists = indices.map(j => Math.hypot(xCoords[j] - x, yCoords[j] - y));
|
|
90
|
+
return { indices, dists };
|
|
91
|
+
}
|
|
92
|
+
// Indices of the cells annotated with the cell type ct (possibly none).
|
|
93
|
+
export function findCellIndicesOfType(context, ct) {
|
|
94
|
+
const cinds = [];
|
|
95
|
+
context.labels.forEach((label, i) => {
|
|
96
|
+
if (label === ct)
|
|
97
|
+
cinds.push(i);
|
|
98
|
+
});
|
|
99
|
+
return cinds;
|
|
100
|
+
}
|
|
101
|
+
// Indices of the cells annotated with the cell type ct, throwing if there are none.
|
|
102
|
+
function getCellIndicesOfType(context, ct) {
|
|
103
|
+
const cinds = findCellIndicesOfType(context, ct);
|
|
104
|
+
if (cinds.length === 0) {
|
|
105
|
+
throw new Error(`Found no ${ct} in the cell type labels!`);
|
|
106
|
+
}
|
|
107
|
+
return cinds;
|
|
108
|
+
}
|
|
109
|
+
// Neighborhood of each cell (excluding the cell itself) used by the k-NN motif enrichment and composition:
|
|
110
|
+
// the k nearest neighbors within maxDist (inclusive).
|
|
111
|
+
export function knnNeighborhood(context, k, maxDist) {
|
|
112
|
+
return (i) => {
|
|
113
|
+
const { indices, dists } = knnNeighbors(context, i, k);
|
|
114
|
+
return indices.filter((_, n) => dists[n] <= maxDist);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
// Neighborhood of each cell (excluding the cell itself) used by the radius-based motif enrichment and composition.
|
|
118
|
+
export function radiusNeighborhood(context, maxDist) {
|
|
119
|
+
const { xCoords, yCoords } = context;
|
|
120
|
+
return (i) => radiusNeighbors(context, xCoords[i], yCoords[i], maxDist).filter(j => j !== i);
|
|
121
|
+
}
|
|
122
|
+
// Cell type transactions for the radius-based neighborhood of each query point.
|
|
123
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L393
|
|
124
|
+
export function radiusTransactions(context, points, maxDist, minSize) {
|
|
125
|
+
const transactions = [];
|
|
126
|
+
const neighborLists = [];
|
|
127
|
+
for (const { x, y, exclude } of points) {
|
|
128
|
+
const idx = radiusNeighbors(context, x, y, maxDist);
|
|
129
|
+
if (idx.length === 0)
|
|
130
|
+
continue;
|
|
131
|
+
const validIndices = idx.filter(j => j !== exclude);
|
|
132
|
+
// Python compares the number of neighbor cells (not unique cell types) against min_size.
|
|
133
|
+
if (validIndices.length > minSize) {
|
|
134
|
+
transactions.push(validIndices.map(j => context.labels[j]));
|
|
135
|
+
neighborLists.push(validIndices);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { transactions, neighborLists };
|
|
139
|
+
}
|
|
140
|
+
// Cell type transactions for the k-NN neighborhood of each center cell.
|
|
141
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L475
|
|
142
|
+
export function knnTransactions(context, cinds, k, maxDist) {
|
|
143
|
+
const transactions = [];
|
|
144
|
+
// In Python, the center cell itself (at distance 0) must pass the dist < max_dist filter,
|
|
145
|
+
// otherwise the neighborhood is skipped entirely. Neighborhoods may otherwise be empty.
|
|
146
|
+
if (!(maxDist > 0)) {
|
|
147
|
+
return transactions;
|
|
148
|
+
}
|
|
149
|
+
for (const i of cinds) {
|
|
150
|
+
const { indices, dists } = knnNeighbors(context, i, k);
|
|
151
|
+
// Note: strict inequality here, unlike in motif_enrichment_knn.
|
|
152
|
+
transactions.push(indices.filter((_, n) => dists[n] < maxDist).map(j => context.labels[j]));
|
|
153
|
+
}
|
|
154
|
+
return transactions;
|
|
155
|
+
}
|
|
156
|
+
// For each pattern, collect the cells (with cell types in the pattern) from the
|
|
157
|
+
// neighborhoods that contain the full pattern.
|
|
158
|
+
function attachNeighborIds(context, patterns, transactions, neighborLists) {
|
|
159
|
+
const transactionSets = transactions.map(t => new Set(t));
|
|
160
|
+
return patterns.map((pattern) => {
|
|
161
|
+
const motif = new Set(pattern.itemsets);
|
|
162
|
+
const ids = new Set();
|
|
163
|
+
transactionSets.forEach((transaction, t) => {
|
|
164
|
+
if (pattern.itemsets.every(ct => transaction.has(ct))) {
|
|
165
|
+
for (const j of neighborLists[t]) {
|
|
166
|
+
if (motif.has(context.labels[j]))
|
|
167
|
+
ids.add(j);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
const neighborIds = Array.from(ids).sort((a, b) => a - b).map(j => context.obsIndex[j]);
|
|
172
|
+
return { ...pattern, neighborIds };
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
async function findPatternsAtPoints(context, points, params) {
|
|
176
|
+
const { maxDist = 20, minSize = 0, minSupport = 0.5, returnCellIds = false, } = params;
|
|
177
|
+
// Note: Python (build_fptree_dist with cinds=None) also excludes the cell whose index
|
|
178
|
+
// equals the index of the query point. We do not reproduce that quirk.
|
|
179
|
+
const queryPoints = points.map(([x, y]) => ({ x, y }));
|
|
180
|
+
const { transactions, neighborLists } = radiusTransactions(context, queryPoints, maxDist, minSize);
|
|
181
|
+
const patterns = await mineFrequentPatterns(transactions, minSupport, true);
|
|
182
|
+
if (returnCellIds) {
|
|
183
|
+
return attachNeighborIds(context, patterns, transactions, neighborLists);
|
|
184
|
+
}
|
|
185
|
+
return patterns;
|
|
186
|
+
}
|
|
187
|
+
// Equivalent to np.arange(start, stop, step).
|
|
188
|
+
function arange(start, stop, step) {
|
|
189
|
+
const n = Math.max(0, Math.ceil((stop - start) / step));
|
|
190
|
+
return Array.from({ length: n }, (_, i) => start + i * step);
|
|
191
|
+
}
|
|
192
|
+
// Grid points used by findPatternsGrid, with spacing maxDist.
|
|
193
|
+
// Equivalent to the grid returned by find_patterns_grid(return_grid=True).
|
|
194
|
+
export function buildGridPoints(context, maxDist = 20) {
|
|
195
|
+
const { xExtent, yExtent } = context;
|
|
196
|
+
const xGrid = arange(xExtent[0] - maxDist, xExtent[1] + maxDist, maxDist);
|
|
197
|
+
const yGrid = arange(yExtent[0] - maxDist, yExtent[1] + maxDist, maxDist);
|
|
198
|
+
const gridPoints = [];
|
|
199
|
+
for (const x of xGrid) {
|
|
200
|
+
for (const y of yGrid) {
|
|
201
|
+
gridPoints.push([x, y]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return gridPoints;
|
|
205
|
+
}
|
|
206
|
+
// Create a grid and use it to find surrounding patterns in spatial data.
|
|
207
|
+
// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.find_patterns_grid.html
|
|
208
|
+
export async function findPatternsGrid(context, params = {}) {
|
|
209
|
+
const { maxDist = 20 } = params;
|
|
210
|
+
return findPatternsAtPoints(context, buildGridPoints(context, maxDist), params);
|
|
211
|
+
}
|
|
212
|
+
// Randomly generate points and use them to find surrounding patterns in spatial data.
|
|
213
|
+
// Uses Math.random, so results will not exactly match Python (which uses a seeded numpy RNG).
|
|
214
|
+
// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.find_patterns_rand.html
|
|
215
|
+
export async function findPatternsRand(context, params = {}) {
|
|
216
|
+
const { nPoints = 1000 } = params;
|
|
217
|
+
const { xExtent: [xMin, xMax], yExtent: [yMin, yMax] } = context;
|
|
218
|
+
// As in Python, all x coordinates are drawn before all y coordinates.
|
|
219
|
+
const xs = Array.from({ length: nPoints }, () => Math.random() * (xMax - xMin) + xMin);
|
|
220
|
+
const ys = Array.from({ length: nPoints }, () => Math.random() * (yMax - yMin) + yMin);
|
|
221
|
+
const points = xs.map((x, i) => [x, ys[i]]);
|
|
222
|
+
return findPatternsAtPoints(context, points, params);
|
|
223
|
+
}
|
|
224
|
+
// Find frequent patterns within the k-NN neighborhoods of a cell type.
|
|
225
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L155
|
|
226
|
+
export async function findFpKnn(context, params) {
|
|
227
|
+
const { ct, k = 30, minSupport = 0.5, maxDist = 20, ifMax = true } = params;
|
|
228
|
+
const cinds = getCellIndicesOfType(context, ct);
|
|
229
|
+
const transactions = knnTransactions(context, cinds, k, maxDist);
|
|
230
|
+
return mineFrequentPatterns(transactions, minSupport, ifMax);
|
|
231
|
+
}
|
|
232
|
+
// Find frequent patterns within the radius-based neighborhoods of a cell type.
|
|
233
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L202
|
|
234
|
+
export async function findFpDist(context, params) {
|
|
235
|
+
const { ct, maxDist = 20, minSize = 0, minSupport = 0.5, ifMax = true } = params;
|
|
236
|
+
const cinds = getCellIndicesOfType(context, ct);
|
|
237
|
+
const { transactions } = radiusTransactions(context, centerQueryPoints(context, cinds), maxDist, minSize);
|
|
238
|
+
return mineFrequentPatterns(transactions, minSupport, ifMax);
|
|
239
|
+
}
|
|
240
|
+
// Query points at the given cells, excluding each cell from its own neighborhood.
|
|
241
|
+
export function centerQueryPoints(context, cinds) {
|
|
242
|
+
return cinds.map(i => ({ x: context.xCoords[i], y: context.yCoords[i], exclude: i }));
|
|
243
|
+
}
|
|
244
|
+
// Compute the hypergeometric enrichment test for a single motif,
|
|
245
|
+
// given the neighborhood counts from a k-NN or radius-based query.
|
|
246
|
+
// Currently, SpatialQuery only provides p-values for cellTypeOfInterest queries.
|
|
247
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/0570c54bd6e046466e05c6b800d6701a7ab15c4a/SpatialQuery/spatial_query.py#L490C13-L492C131
|
|
248
|
+
export function computeMotifEnrichment(params) {
|
|
249
|
+
const { center, motif, numCells, numCenter, numMotif, numCenterMotif, } = params;
|
|
250
|
+
// If the center cell type appears in the motif, divide by the number of times it appears.
|
|
251
|
+
// Python's round() rounds half to even, so we match that here.
|
|
252
|
+
let nCenter = numCenter;
|
|
253
|
+
const centerCount = motif.filter(ct => ct === center).length;
|
|
254
|
+
if (centerCount > 0) {
|
|
255
|
+
nCenter = roundHalfEven(nCenter / centerCount);
|
|
256
|
+
}
|
|
257
|
+
// M = total number of cells, n = number of "successes" (center cells),
|
|
258
|
+
// N = number drawn without replacement (cells with the motif in their neighborhood).
|
|
259
|
+
const hyge = hypergeom(numCells, nCenter, numMotif);
|
|
260
|
+
return {
|
|
261
|
+
center,
|
|
262
|
+
motifs: motif.toSorted(),
|
|
263
|
+
nCenterMotif: numCenterMotif,
|
|
264
|
+
nCenter,
|
|
265
|
+
nMotif: numMotif,
|
|
266
|
+
expectation: hyge.mean(),
|
|
267
|
+
pValue: hyge.sf(numCenterMotif),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
// Turn a str / List[str] / List[List[str]] motifs argument into a list of motifs.
|
|
271
|
+
function toMotifList(motifs) {
|
|
272
|
+
if (typeof motifs === 'string') {
|
|
273
|
+
return [[motifs]];
|
|
274
|
+
}
|
|
275
|
+
if (motifs.every(m => typeof m === 'string')) {
|
|
276
|
+
return [motifs];
|
|
277
|
+
}
|
|
278
|
+
return motifs;
|
|
279
|
+
}
|
|
280
|
+
// Normalize a motifs argument into a list of motifs, dropping cell types that are not
|
|
281
|
+
// present in the data. Used by the motif enrichment functions (which keep the motif order and duplicates).
|
|
282
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L343
|
|
283
|
+
export function normalizeMotifs(motifs, labelsUnique) {
|
|
284
|
+
const filteredMotifs = [];
|
|
285
|
+
for (const motif of toMotifList(motifs)) {
|
|
286
|
+
const motifExc = motif.filter(m => !labelsUnique.has(m));
|
|
287
|
+
if (motifExc.length > 0) {
|
|
288
|
+
console.warn(`Found no ${JSON.stringify(motifExc)} in the cell type labels. Ignoring them.`);
|
|
289
|
+
}
|
|
290
|
+
const validMotif = motif.filter(m => labelsUnique.has(m));
|
|
291
|
+
if (validMotif.length > 0) {
|
|
292
|
+
filteredMotifs.push(validMotif);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return filteredMotifs;
|
|
296
|
+
}
|
|
297
|
+
// Normalize a motifs argument into sorted, de-duplicated motifs, dropping cell types that are
|
|
298
|
+
// not present in the data. Used by the motif composition functions.
|
|
299
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L300
|
|
300
|
+
export function normalizeMotifList(motifs, labelsUnique) {
|
|
301
|
+
return normalizeMotifs(motifs, labelsUnique).map(motif => Array.from(new Set(motif)).sort());
|
|
302
|
+
}
|
|
303
|
+
// Count, for each motif, the cells (and center cells) whose neighborhood contains every
|
|
304
|
+
// cell type of the motif, given a function returning the neighborhood of each cell.
|
|
305
|
+
// The center cell type may be absent (relevant for multi-FOV).
|
|
306
|
+
export function countMotifs(context, ct, motifs, neighborsOf, returnCellIds) {
|
|
307
|
+
const { labels } = context;
|
|
308
|
+
const numCells = labels.length;
|
|
309
|
+
const cinds = findCellIndicesOfType(context, ct);
|
|
310
|
+
// Encode cell type labels as integers.
|
|
311
|
+
const labelsUnique = Array.from(new Set(labels)).sort();
|
|
312
|
+
const labelToCode = new Map(labelsUnique.map((label, code) => [label, code]));
|
|
313
|
+
const numTypes = labelsUnique.length;
|
|
314
|
+
// A motif with a cell type missing from this FOV cannot be present in any neighborhood.
|
|
315
|
+
const isActive = motifs.map(motif => motif.every(m => labelToCode.has(m)));
|
|
316
|
+
const emptyCounts = () => ({
|
|
317
|
+
numCells,
|
|
318
|
+
numCenter: cinds.length,
|
|
319
|
+
numMotif: 0,
|
|
320
|
+
numCenterMotif: 0,
|
|
321
|
+
...(returnCellIds ? { centerIndices: [], neighborIndices: [] } : {}),
|
|
322
|
+
});
|
|
323
|
+
if (!isActive.some(Boolean)) {
|
|
324
|
+
return motifs.map(emptyCounts);
|
|
325
|
+
}
|
|
326
|
+
// Presence of each cell type in the neighborhood of each cell.
|
|
327
|
+
const codes = Int32Array.from(labels, label => labelToCode.get(label));
|
|
328
|
+
const presence = new Uint8Array(numCells * numTypes);
|
|
329
|
+
const centerNeighbors = new Map();
|
|
330
|
+
const isCenter = new Uint8Array(numCells);
|
|
331
|
+
for (const i of cinds)
|
|
332
|
+
isCenter[i] = 1;
|
|
333
|
+
for (let i = 0; i < numCells; i++) {
|
|
334
|
+
const neighbors = neighborsOf(i);
|
|
335
|
+
for (const j of neighbors) {
|
|
336
|
+
presence[i * numTypes + codes[j]] = 1;
|
|
337
|
+
}
|
|
338
|
+
if (returnCellIds && isCenter[i]) {
|
|
339
|
+
centerNeighbors.set(i, neighbors);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
const hasMotif = (i, motifCodes) => motifCodes.every(c => presence[i * numTypes + c] === 1);
|
|
343
|
+
return motifs.map((motif, m) => {
|
|
344
|
+
if (!isActive[m]) {
|
|
345
|
+
return emptyCounts();
|
|
346
|
+
}
|
|
347
|
+
const motifCodes = Array.from(new Set(motif), t => labelToCode.get(t));
|
|
348
|
+
let numMotif = 0;
|
|
349
|
+
for (let i = 0; i < numCells; i++) {
|
|
350
|
+
if (hasMotif(i, motifCodes))
|
|
351
|
+
numMotif++;
|
|
352
|
+
}
|
|
353
|
+
const centersWithMotif = cinds.filter(i => hasMotif(i, motifCodes));
|
|
354
|
+
const counts = {
|
|
355
|
+
numCells,
|
|
356
|
+
numCenter: cinds.length,
|
|
357
|
+
numMotif,
|
|
358
|
+
numCenterMotif: centersWithMotif.length,
|
|
359
|
+
};
|
|
360
|
+
if (returnCellIds) {
|
|
361
|
+
const motifSet = new Set(motif);
|
|
362
|
+
const neighborIndices = new Set();
|
|
363
|
+
for (const i of centersWithMotif) {
|
|
364
|
+
for (const j of centerNeighbors.get(i)) {
|
|
365
|
+
if (motifSet.has(labels[j]))
|
|
366
|
+
neighborIndices.add(j);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
counts.centerIndices = centersWithMotif;
|
|
370
|
+
counts.neighborIndices = Array.from(neighborIndices).sort((a, b) => a - b);
|
|
371
|
+
}
|
|
372
|
+
return counts;
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
// Run the enrichment test for each motif, given a function returning the
|
|
376
|
+
// neighborhood (excluding the cell itself) of each cell.
|
|
377
|
+
function motifEnrichment(context, ct, motifs, neighborsOf, returnCellIds) {
|
|
378
|
+
const { obsIndex } = context;
|
|
379
|
+
const counts = countMotifs(context, ct, motifs, neighborsOf, returnCellIds);
|
|
380
|
+
const out = motifs.map((motif, m) => {
|
|
381
|
+
const { numCells, numCenter, numMotif, numCenterMotif, centerIndices, neighborIndices } = counts[m];
|
|
382
|
+
const result = computeMotifEnrichment({ center: ct, motif, numCells, numCenter, numMotif, numCenterMotif });
|
|
383
|
+
if (returnCellIds) {
|
|
384
|
+
// Note: when no center cell has the motif, Python skips the motif entirely
|
|
385
|
+
// (it is dropped from the results). Here we keep it, with empty cell IDs.
|
|
386
|
+
result.neighborIds = neighborIndices.map(j => obsIndex[j]);
|
|
387
|
+
result.centerIds = centerIndices.map(i => obsIndex[i]);
|
|
388
|
+
}
|
|
389
|
+
return result;
|
|
390
|
+
});
|
|
391
|
+
return applyFdrCorrection(out);
|
|
392
|
+
}
|
|
393
|
+
export function assertEnrichmentMode(mode) {
|
|
394
|
+
if (mode !== 'maximal' && mode !== 'nested') {
|
|
395
|
+
throw new Error(`mode must be 'nested' or 'maximal', got '${mode}'`);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// Perform motif enrichment analysis using k-nearest neighbors.
|
|
399
|
+
// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.motif_enrichment_knn.html
|
|
400
|
+
export async function motifEnrichmentKnn(context, params) {
|
|
401
|
+
const { ct, k = 30, minSupport = 0.5, maxDist = 20, returnCellIds = false, mode = 'maximal' } = params;
|
|
402
|
+
getCellIndicesOfType(context, ct);
|
|
403
|
+
assertEnrichmentMode(mode);
|
|
404
|
+
if (mode === 'nested' && params.motifs === undefined) {
|
|
405
|
+
return nestedMotifDescent({
|
|
406
|
+
testMotifs: motifs => motifEnrichmentKnn(context, { ...params, motifs, mode: 'maximal' }),
|
|
407
|
+
frequentPatterns: await findFpKnn(context, { ct, k, minSupport, maxDist, ifMax: false }),
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
const motifs = params.motifs === undefined
|
|
411
|
+
? (await findFpKnn(context, { ct, k, minSupport, maxDist })).map(p => p.itemsets)
|
|
412
|
+
: normalizeMotifs(params.motifs, new Set(context.labels));
|
|
413
|
+
if (motifs.length === 0) {
|
|
414
|
+
return [];
|
|
415
|
+
}
|
|
416
|
+
return motifEnrichment(context, ct, motifs, knnNeighborhood(context, k, maxDist), returnCellIds);
|
|
417
|
+
}
|
|
418
|
+
// Perform motif enrichment analysis within a radius-based neighborhood.
|
|
419
|
+
// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.motif_enrichment_dist.html
|
|
420
|
+
export async function motifEnrichmentDist(context, params) {
|
|
421
|
+
const { ct, maxDist = 20, minSize = 0, minSupport = 0.5, returnCellIds = false, mode = 'maximal' } = params;
|
|
422
|
+
getCellIndicesOfType(context, ct);
|
|
423
|
+
assertEnrichmentMode(mode);
|
|
424
|
+
if (mode === 'nested' && params.motifs === undefined) {
|
|
425
|
+
return nestedMotifDescent({
|
|
426
|
+
testMotifs: motifs => motifEnrichmentDist(context, { ...params, motifs, mode: 'maximal' }),
|
|
427
|
+
frequentPatterns: await findFpDist(context, { ct, maxDist, minSize, minSupport, ifMax: false }),
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
const motifs = params.motifs === undefined
|
|
431
|
+
? (await findFpDist(context, { ct, maxDist, minSize, minSupport })).map(p => p.itemsets)
|
|
432
|
+
: normalizeMotifs(params.motifs, new Set(context.labels));
|
|
433
|
+
if (motifs.length === 0) {
|
|
434
|
+
return [];
|
|
435
|
+
}
|
|
436
|
+
return motifEnrichment(context, ct, motifs, radiusNeighborhood(context, maxDist), returnCellIds);
|
|
437
|
+
}
|
|
438
|
+
// Long-format composition of the motif-type cells in the neighborhoods of the center cells
|
|
439
|
+
// (cinds) whose neighborhood contains every motif cell type: one row per (center cell, motif cell type).
|
|
440
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L362
|
|
441
|
+
export function motifCompositionRows(context, ct, motifs, cinds, neighborsOf) {
|
|
442
|
+
const { labels } = context;
|
|
443
|
+
// Per-cell-type neighbor counts of each center cell.
|
|
444
|
+
const centerCounts = cinds.map((i) => {
|
|
445
|
+
const counts = new Map();
|
|
446
|
+
for (const j of neighborsOf(i)) {
|
|
447
|
+
counts.set(labels[j], (counts.get(labels[j]) ?? 0) + 1);
|
|
448
|
+
}
|
|
449
|
+
return counts;
|
|
450
|
+
});
|
|
451
|
+
const rows = [];
|
|
452
|
+
for (const motif of motifs) {
|
|
453
|
+
for (const counts of centerCounts) {
|
|
454
|
+
const motifCounts = motif.map(t => counts.get(t) ?? 0);
|
|
455
|
+
if (!motifCounts.every(c => c > 0))
|
|
456
|
+
continue;
|
|
457
|
+
const total = motifCounts.reduce((a, b) => a + b, 0);
|
|
458
|
+
motif.forEach((cellType, n) => {
|
|
459
|
+
rows.push({
|
|
460
|
+
center: ct,
|
|
461
|
+
motifs: motif,
|
|
462
|
+
cellType,
|
|
463
|
+
nCells: motifCounts[n],
|
|
464
|
+
nMotifCells: total,
|
|
465
|
+
proportion: motifCounts[n] / total,
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return rows;
|
|
471
|
+
}
|
|
472
|
+
// Compute the composition of motif cell types in the k-NN neighborhoods of center cells.
|
|
473
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L681
|
|
474
|
+
export function motifCompositionKnn(context, params) {
|
|
475
|
+
const { ct, k = 30, maxDist = 20 } = params;
|
|
476
|
+
const cinds = getCellIndicesOfType(context, ct);
|
|
477
|
+
const motifs = normalizeMotifList(params.motifs, new Set(context.labels));
|
|
478
|
+
return motifCompositionRows(context, ct, motifs, cinds, knnNeighborhood(context, k, maxDist));
|
|
479
|
+
}
|
|
480
|
+
// Compute the composition of motif cell types in the radius-based neighborhoods of center cells.
|
|
481
|
+
// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L631
|
|
482
|
+
export function motifCompositionDist(context, params) {
|
|
483
|
+
const { ct, maxDist = 20 } = params;
|
|
484
|
+
const cinds = getCellIndicesOfType(context, ct);
|
|
485
|
+
const motifs = normalizeMotifList(params.motifs, new Set(context.labels));
|
|
486
|
+
return motifCompositionRows(context, ct, motifs, cinds, radiusNeighborhood(context, maxDist));
|
|
487
|
+
}
|
|
488
|
+
//# sourceM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,CAAC,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAC5C,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E,OAAO,oBAAoB,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAChG,CAAC;AAWD,iGAAiG;AACjG,wGAAwG;AACxG,MAAM,UAAU,oBAAoB,CAAC,OAAkB,EAAE,MAAkC;IACzF,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACpC,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E,OAAO,oBAAoB,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAChG,CAAC"}
|
package/dist/stats.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare function roundHalfEven(x: number): number;
|
|
2
|
+
export declare function hypergeom(M: number, n: number, N: number): {
|
|
3
|
+
mean(): number;
|
|
4
|
+
sf(k: number): number;
|
|
5
|
+
};
|
|
6
|
+
export declare function normSf(z: number): number;
|
|
7
|
+
export declare function mean(values: number[]): number;
|
|
8
|
+
export declare function median(values: number[]): number;
|
|
9
|
+
export declare function rankAverage(values: number[]): number[];
|
|
10
|
+
export declare function mannWhitneyU(x: number[], y: number[]): {
|
|
11
|
+
statistic: number;
|
|
12
|
+
pValue: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function fdrCorrection(pvals: number[], alpha?: number): {
|
|
15
|
+
rejected: boolean[];
|
|
16
|
+
adjusted: number[];
|
|
17
|
+
};
|
|
18
|
+
type FdrCorrectable = {
|
|
19
|
+
pValue: number;
|
|
20
|
+
adjPValue?: number;
|
|
21
|
+
ifSignificant?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function applyFdrCorrection<T extends FdrCorrectable>(results: T[], alpha?: number): T[];
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":"AAYA,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG/C;AAQD,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;YAE7C,MAAM;UAMR,MAAM,GAAG,MAAM;EAIxB;AAGD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7C;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAG/C;AAID,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEtD;AAuBD,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAwC5F;AAKD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,SAAO;;;EAI1D;AAED,KAAK,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAKtF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,cAAc,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,SAAO,GAAG,CAAC,EAAE,CAa5F"}
|