@vitessce/statistical-plots 3.3.6 → 3.3.8
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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import React__default, { useContext, useState, useRef, useCallback, useEffect, useMemo, Suspense } from "react";
|
3
|
-
import { usePlotOptionsStyles, OptionsContainer, OptionSelect, useLoaders, useCoordination, useGridItemSize, useFeatureSelection, useFeatureLabelsData, useObsFeatureMatrixIndices, useObsSetsData, useReady, useUrls, TitleInfo, useObsFeatureMatrixData } from "@vitessce/vit-s";
|
3
|
+
import { usePlotOptionsStyles, OptionsContainer, OptionSelect, useLoaders, useCoordination, useGridItemSize, useFeatureSelection, useFeatureLabelsData, useObsFeatureMatrixIndices, useObsSetsData, useSampleSetsData, useSampleEdgesData, useReady, useUrls, TitleInfo, useObsFeatureMatrixData } from "@vitessce/vit-s";
|
4
4
|
import * as ReactDOM from "react-dom";
|
5
5
|
import ReactDOM__default from "react-dom";
|
6
6
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
@@ -950,11 +950,14 @@ const DataType$1 = {
|
|
950
950
|
GENOMIC_PROFILES: "genomic-profiles",
|
951
951
|
OBS_SPOTS: "obsSpots",
|
952
952
|
OBS_POINTS: "obsPoints",
|
953
|
-
OBS_LOCATIONS: "obsLocations"
|
953
|
+
OBS_LOCATIONS: "obsLocations",
|
954
|
+
SAMPLE_SETS: "sampleSets",
|
955
|
+
SAMPLE_EDGES: "sampleEdges"
|
954
956
|
};
|
955
957
|
const FileType$1 = {
|
956
958
|
// Joint file types
|
957
959
|
ANNDATA_ZARR: "anndata.zarr",
|
960
|
+
ANNDATA_ZARR_ZIP: "anndata.zarr.zip",
|
958
961
|
SPATIALDATA_ZARR: "spatialdata.zarr",
|
959
962
|
// Atomic file types
|
960
963
|
OBS_EMBEDDING_CSV: "obsEmbedding.csv",
|
@@ -967,6 +970,7 @@ const FileType$1 = {
|
|
967
970
|
OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
|
968
971
|
OBS_SETS_CSV: "obsSets.csv",
|
969
972
|
OBS_SETS_JSON: "obsSets.json",
|
973
|
+
SAMPLE_SETS_CSV: "sampleSets.csv",
|
970
974
|
// OME-Zarr
|
971
975
|
IMAGE_OME_ZARR: "image.ome-zarr",
|
972
976
|
OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
|
@@ -981,6 +985,19 @@ const FileType$1 = {
|
|
981
985
|
OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
|
982
986
|
OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
|
983
987
|
FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
|
988
|
+
SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
|
989
|
+
// AnnData - zipped
|
990
|
+
OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
|
991
|
+
OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
|
992
|
+
OBS_SETS_ANNDATA_ZARR_ZIP: "obsSets.anndata.zarr.zip",
|
993
|
+
OBS_EMBEDDING_ANNDATA_ZARR_ZIP: "obsEmbedding.anndata.zarr.zip",
|
994
|
+
OBS_SPOTS_ANNDATA_ZARR_ZIP: "obsSpots.anndata.zarr.zip",
|
995
|
+
OBS_POINTS_ANNDATA_ZARR_ZIP: "obsPoints.anndata.zarr.zip",
|
996
|
+
OBS_LOCATIONS_ANNDATA_ZARR_ZIP: "obsLocations.anndata.zarr.zip",
|
997
|
+
OBS_SEGMENTATIONS_ANNDATA_ZARR_ZIP: "obsSegmentations.anndata.zarr.zip",
|
998
|
+
OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
|
999
|
+
FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
|
1000
|
+
SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
|
984
1001
|
// SpatialData
|
985
1002
|
IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
|
986
1003
|
LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
|
@@ -988,6 +1005,7 @@ const FileType$1 = {
|
|
988
1005
|
OBS_FEATURE_MATRIX_SPATIALDATA_ZARR: "obsFeatureMatrix.spatialdata.zarr",
|
989
1006
|
OBS_SETS_SPATIALDATA_ZARR: "obsSets.spatialdata.zarr",
|
990
1007
|
OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
|
1008
|
+
FEATURE_LABELS_SPATIALDATA_ZARR: "featureLabels.spatialdata.zarr",
|
991
1009
|
// TODO:
|
992
1010
|
// OBS_POINTS_SPATIALDATA_ZARR: 'obsPoints.spatialdata.zarr',
|
993
1011
|
// OBS_LOCATIONS_SPATIALDATA_ZARR: 'obsLocations.spatialdata.zarr',
|
@@ -1144,7 +1162,10 @@ const CoordinationType$1 = {
|
|
1144
1162
|
LEGEND_VISIBLE: "legendVisible",
|
1145
1163
|
SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
|
1146
1164
|
SPATIAL_CHANNEL_LABELS_ORIENTATION: "spatialChannelLabelsOrientation",
|
1147
|
-
SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize"
|
1165
|
+
SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
|
1166
|
+
// Multi-sample / comparative
|
1167
|
+
SAMPLE_TYPE: "sampleType",
|
1168
|
+
SAMPLE_SET_SELECTION: "sampleSetSelection"
|
1148
1169
|
};
|
1149
1170
|
const COMPONENT_COORDINATION_TYPES = {
|
1150
1171
|
[ViewType$1.SCATTERPLOT]: [
|
@@ -1392,7 +1413,9 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1392
1413
|
CoordinationType$1.OBS_SET_SELECTION,
|
1393
1414
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1394
1415
|
CoordinationType$1.OBS_SET_COLOR,
|
1395
|
-
CoordinationType$1.ADDITIONAL_OBS_SETS
|
1416
|
+
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
1417
|
+
CoordinationType$1.SAMPLE_TYPE,
|
1418
|
+
CoordinationType$1.SAMPLE_SET_SELECTION
|
1396
1419
|
],
|
1397
1420
|
[ViewType$1.FEATURE_VALUE_HISTOGRAM]: [
|
1398
1421
|
CoordinationType$1.DATASET,
|
@@ -10747,6 +10770,17 @@ z.object({
|
|
10747
10770
|
scoreColumn: z.string().optional()
|
10748
10771
|
}))
|
10749
10772
|
});
|
10773
|
+
z.object({
|
10774
|
+
sampleIndex: z.string(),
|
10775
|
+
sampleSets: z.array(z.object({
|
10776
|
+
name: z.string(),
|
10777
|
+
column: z.union([
|
10778
|
+
z.string(),
|
10779
|
+
z.array(z.string())
|
10780
|
+
]),
|
10781
|
+
scoreColumn: z.string().optional()
|
10782
|
+
}))
|
10783
|
+
});
|
10750
10784
|
z.object({
|
10751
10785
|
obsLabels: z.union([
|
10752
10786
|
annDataObsLabels,
|
@@ -38046,7 +38080,8 @@ function CellSetExpressionPlotSubscriber(props) {
|
|
38046
38080
|
featureValueTransformCoefficient,
|
38047
38081
|
obsSetSelection: cellSetSelection,
|
38048
38082
|
obsSetColor: cellSetColor,
|
38049
|
-
additionalObsSets: additionalCellSets
|
38083
|
+
additionalObsSets: additionalCellSets,
|
38084
|
+
sampleType
|
38050
38085
|
}, {
|
38051
38086
|
setFeatureValueTransform,
|
38052
38087
|
setFeatureValueTransformCoefficient
|
@@ -38085,16 +38120,36 @@ function CellSetExpressionPlotSubscriber(props) {
|
|
38085
38120
|
{},
|
38086
38121
|
{ obsType }
|
38087
38122
|
);
|
38123
|
+
const [{ sampleSets }, sampleSetsStatus, sampleSetsUrls] = useSampleSetsData(
|
38124
|
+
loaders,
|
38125
|
+
dataset,
|
38126
|
+
false,
|
38127
|
+
{},
|
38128
|
+
{},
|
38129
|
+
{ sampleType }
|
38130
|
+
);
|
38131
|
+
const [{ sampleEdges }, sampleEdgesStatus, sampleEdgesUrls] = useSampleEdgesData(
|
38132
|
+
loaders,
|
38133
|
+
dataset,
|
38134
|
+
false,
|
38135
|
+
{},
|
38136
|
+
{},
|
38137
|
+
{ obsType, sampleType }
|
38138
|
+
);
|
38088
38139
|
const isReady = useReady([
|
38089
38140
|
featureSelectionStatus,
|
38090
38141
|
matrixIndicesStatus,
|
38091
38142
|
obsSetsStatus,
|
38092
|
-
featureLabelsStatus
|
38143
|
+
featureLabelsStatus,
|
38144
|
+
sampleSetsStatus,
|
38145
|
+
sampleEdgesStatus
|
38093
38146
|
]);
|
38094
38147
|
const urls = useUrls([
|
38095
38148
|
featureLabelsUrls,
|
38096
38149
|
matrixIndicesUrls,
|
38097
|
-
obsSetsUrls
|
38150
|
+
obsSetsUrls,
|
38151
|
+
sampleSetsUrls,
|
38152
|
+
sampleEdgesUrls
|
38098
38153
|
]);
|
38099
38154
|
const [expressionArr, setArr] = useExpressionByCellSet(
|
38100
38155
|
expressionData,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CellSetExpressionPlotSubscriber.d.ts","sourceRoot":"","sources":["../src/CellSetExpressionPlotSubscriber.js"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"CellSetExpressionPlotSubscriber.d.ts","sourceRoot":"","sources":["../src/CellSetExpressionPlotSubscriber.js"],"names":[],"mappings":"AAmGA;;;;;;;;;GASG;AACH;IAL2B,mBAAmB;IACrB,kBAAkB,EAAhC,MAAM;IAEQ,KAAK,EAAnB,MAAM;gBAkJhB"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React, { useMemo } from 'react';
|
3
|
-
import { TitleInfo, useCoordination, useLoaders, useUrls, useReady, useGridItemSize, useFeatureSelection, useObsSetsData, useObsFeatureMatrixIndices, useFeatureLabelsData, } from '@vitessce/vit-s';
|
3
|
+
import { TitleInfo, useCoordination, useLoaders, useUrls, useReady, useGridItemSize, useFeatureSelection, useObsSetsData, useObsFeatureMatrixIndices, useFeatureLabelsData, useSampleSetsData, useSampleEdgesData, } from '@vitessce/vit-s';
|
4
4
|
import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
|
5
5
|
import { VALUE_TRANSFORM_OPTIONS, capitalize, getValueTransformFunction } from '@vitessce/utils';
|
6
6
|
import { treeToObjectsBySetNames, treeToSetSizesBySetNames, mergeObsSets } from '@vitessce/sets-utils';
|
@@ -81,7 +81,7 @@ export function CellSetExpressionPlotSubscriber(props) {
|
|
81
81
|
const classes = useStyles();
|
82
82
|
const loaders = useLoaders();
|
83
83
|
// Get "props" from the coordination space.
|
84
|
-
const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, featureValueTransform, featureValueTransformCoefficient, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, }, { setFeatureValueTransform, setFeatureValueTransformCoefficient, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.OBS_SET_FEATURE_VALUE_DISTRIBUTION], coordinationScopes);
|
84
|
+
const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, featureValueTransform, featureValueTransformCoefficient, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, sampleType, }, { setFeatureValueTransform, setFeatureValueTransformCoefficient, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.OBS_SET_FEATURE_VALUE_DISTRIBUTION], coordinationScopes);
|
85
85
|
const [width, height, containerRef] = useGridItemSize();
|
86
86
|
const transformOptions = VALUE_TRANSFORM_OPTIONS;
|
87
87
|
// Get data from loaders using the data hooks.
|
@@ -91,16 +91,24 @@ export function CellSetExpressionPlotSubscriber(props) {
|
|
91
91
|
const [{ featureLabelsMap }, featureLabelsStatus, featureLabelsUrls] = useFeatureLabelsData(loaders, dataset, false, {}, {}, { featureType });
|
92
92
|
const [{ obsIndex }, matrixIndicesStatus, matrixIndicesUrls] = useObsFeatureMatrixIndices(loaders, dataset, false, { obsType, featureType, featureValueType });
|
93
93
|
const [{ obsSets: cellSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(loaders, dataset, true, {}, {}, { obsType });
|
94
|
+
// eslint-disable-next-line no-unused-vars
|
95
|
+
const [{ sampleSets }, sampleSetsStatus, sampleSetsUrls] = useSampleSetsData(loaders, dataset, false, {}, {}, { sampleType });
|
96
|
+
// eslint-disable-next-line no-unused-vars
|
97
|
+
const [{ sampleEdges }, sampleEdgesStatus, sampleEdgesUrls] = useSampleEdgesData(loaders, dataset, false, {}, {}, { obsType, sampleType });
|
94
98
|
const isReady = useReady([
|
95
99
|
featureSelectionStatus,
|
96
100
|
matrixIndicesStatus,
|
97
101
|
obsSetsStatus,
|
98
102
|
featureLabelsStatus,
|
103
|
+
sampleSetsStatus,
|
104
|
+
sampleEdgesStatus,
|
99
105
|
]);
|
100
106
|
const urls = useUrls([
|
101
107
|
featureLabelsUrls,
|
102
108
|
matrixIndicesUrls,
|
103
109
|
obsSetsUrls,
|
110
|
+
sampleSetsUrls,
|
111
|
+
sampleEdgesUrls,
|
104
112
|
]);
|
105
113
|
const [expressionArr, setArr] = useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme);
|
106
114
|
const firstGeneSelected = geneSelection && geneSelection.length >= 1
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitessce/statistical-plots",
|
3
|
-
"version": "3.3.
|
3
|
+
"version": "3.3.8",
|
4
4
|
"author": "Gehlenborg Lab",
|
5
5
|
"homepage": "http://vitessce.io",
|
6
6
|
"repository": {
|
@@ -25,11 +25,11 @@
|
|
25
25
|
"vega-scale": "^6.0.0",
|
26
26
|
"lodash-es": "^4.17.21",
|
27
27
|
"react-aria": "^3.28.0",
|
28
|
-
"@vitessce/
|
29
|
-
"@vitessce/utils": "3.3.
|
30
|
-
"@vitessce/
|
31
|
-
"@vitessce/
|
32
|
-
"@vitessce/
|
28
|
+
"@vitessce/constants-internal": "3.3.8",
|
29
|
+
"@vitessce/sets-utils": "3.3.8",
|
30
|
+
"@vitessce/utils": "3.3.8",
|
31
|
+
"@vitessce/vit-s": "3.3.8",
|
32
|
+
"@vitessce/vega": "3.3.8"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
35
|
"react": "^18.0.0",
|
@@ -6,6 +6,8 @@ import {
|
|
6
6
|
useFeatureSelection, useObsSetsData,
|
7
7
|
useObsFeatureMatrixIndices,
|
8
8
|
useFeatureLabelsData,
|
9
|
+
useSampleSetsData,
|
10
|
+
useSampleEdgesData,
|
9
11
|
} from '@vitessce/vit-s';
|
10
12
|
import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
|
11
13
|
import { VALUE_TRANSFORM_OPTIONS, capitalize, getValueTransformFunction } from '@vitessce/utils';
|
@@ -132,6 +134,7 @@ export function CellSetExpressionPlotSubscriber(props) {
|
|
132
134
|
obsSetSelection: cellSetSelection,
|
133
135
|
obsSetColor: cellSetColor,
|
134
136
|
additionalObsSets: additionalCellSets,
|
137
|
+
sampleType,
|
135
138
|
}, {
|
136
139
|
setFeatureValueTransform,
|
137
140
|
setFeatureValueTransformCoefficient,
|
@@ -163,16 +166,33 @@ export function CellSetExpressionPlotSubscriber(props) {
|
|
163
166
|
loaders, dataset, true, {}, {},
|
164
167
|
{ obsType },
|
165
168
|
);
|
169
|
+
|
170
|
+
// eslint-disable-next-line no-unused-vars
|
171
|
+
const [{ sampleSets }, sampleSetsStatus, sampleSetsUrls] = useSampleSetsData(
|
172
|
+
loaders, dataset, false, {}, {},
|
173
|
+
{ sampleType },
|
174
|
+
);
|
175
|
+
|
176
|
+
// eslint-disable-next-line no-unused-vars
|
177
|
+
const [{ sampleEdges }, sampleEdgesStatus, sampleEdgesUrls] = useSampleEdgesData(
|
178
|
+
loaders, dataset, false, {}, {},
|
179
|
+
{ obsType, sampleType },
|
180
|
+
);
|
181
|
+
|
166
182
|
const isReady = useReady([
|
167
183
|
featureSelectionStatus,
|
168
184
|
matrixIndicesStatus,
|
169
185
|
obsSetsStatus,
|
170
186
|
featureLabelsStatus,
|
187
|
+
sampleSetsStatus,
|
188
|
+
sampleEdgesStatus,
|
171
189
|
]);
|
172
190
|
const urls = useUrls([
|
173
191
|
featureLabelsUrls,
|
174
192
|
matrixIndicesUrls,
|
175
193
|
obsSetsUrls,
|
194
|
+
sampleSetsUrls,
|
195
|
+
sampleEdgesUrls,
|
176
196
|
]);
|
177
197
|
|
178
198
|
const [expressionArr, setArr] = useExpressionByCellSet(
|