|
25 | 25 | }, |
26 | 26 | { |
27 | 27 | "cell_type": "code", |
28 | | - "execution_count": 1, |
29 | | - "metadata": {}, |
30 | | - "outputs": [ |
31 | | - { |
32 | | - "name": "stderr", |
33 | | - "output_type": "stream", |
34 | | - "text": [ |
35 | | - "/Users/mkeller/research/dbmi/vitessce/vitessce-python/.venv/lib/python3.10/site-packages/dask/dataframe/__init__.py:31: FutureWarning: The legacy Dask DataFrame implementation is deprecated and will be removed in a future version. Set the configuration option `dataframe.query-planning` to `True` or None to enable the new Dask Dataframe implementation and silence this warning.\n", |
36 | | - " warnings.warn(\n" |
37 | | - ] |
38 | | - } |
39 | | - ], |
40 | | - "source": [ |
41 | | - "from spatialdata import read_zarr\n", |
42 | | - "from os.path import join" |
43 | | - ] |
44 | | - }, |
45 | | - { |
46 | | - "cell_type": "code", |
47 | | - "execution_count": 2, |
| 28 | + "execution_count": null, |
48 | 29 | "metadata": {}, |
49 | 30 | "outputs": [], |
50 | 31 | "source": [ |
51 | | - "spatialdata_filepath = join(\"..\", \"..\", \"..\", \"tissue-map-tools\", \"examples\", \"moffitt_multiscale.sdata.zarr\")" |
| 32 | + "sdata_url = \"https://data-2.vitessce.io/data/moffitt/merfish_mouse_ileum.sdata.zarr\"" |
52 | 33 | ] |
53 | 34 | }, |
54 | 35 | { |
55 | 36 | "cell_type": "code", |
56 | | - "execution_count": 3, |
57 | | - "metadata": {}, |
58 | | - "outputs": [ |
59 | | - { |
60 | | - "name": "stderr", |
61 | | - "output_type": "stream", |
62 | | - "text": [ |
63 | | - "version mismatch: detected: RasterFormatV02, requested: FormatV04\n", |
64 | | - "/Users/mkeller/research/dbmi/vitessce/vitessce-python/.venv/lib/python3.10/site-packages/zarr/creation.py:614: UserWarning: ignoring keyword argument 'read_only'\n", |
65 | | - " compressor, fill_value = _kwargs_compat(compressor, fill_value, kwargs)\n", |
66 | | - "/Users/mkeller/research/dbmi/vitessce/vitessce-python/.venv/lib/python3.10/site-packages/anndata/_core/aligned_df.py:68: ImplicitModificationWarning: Transforming to str index.\n", |
67 | | - " warnings.warn(\"Transforming to str index.\", ImplicitModificationWarning)\n" |
68 | | - ] |
69 | | - } |
70 | | - ], |
71 | | - "source": [ |
72 | | - "sdata = read_zarr(spatialdata_filepath)" |
73 | | - ] |
74 | | - }, |
75 | | - { |
76 | | - "cell_type": "code", |
77 | | - "execution_count": 4, |
78 | | - "metadata": {}, |
79 | | - "outputs": [ |
80 | | - { |
81 | | - "data": { |
82 | | - "text/plain": [ |
83 | | - "SpatialData object, with associated Zarr store: /Users/mkeller/research/dbmi/vitessce/tissue-map-tools/examples/moffitt_multiscale.sdata.zarr\n", |
84 | | - "├── Images\n", |
85 | | - "│ └── 'stains': DataTree[czyx] (2, 9, 9392, 5721), (2, 4, 4696, 2860), (2, 2, 2348, 1430)\n", |
86 | | - "├── Labels\n", |
87 | | - "│ ├── 'dapi_labels': DataTree[zyx] (9, 9392, 5721), (4, 4696, 2860), (2, 2348, 1430)\n", |
88 | | - "│ └── 'membrane_labels': DataTree[zyx] (9, 9392, 5721), (4, 4696, 2860), (2, 2348, 1430)\n", |
89 | | - "├── Points\n", |
90 | | - "│ ├── 'cells_centroids_cellpose': DataFrame with shape: (<Delayed>, 3) (3D points)\n", |
91 | | - "│ ├── 'molecule_baysor': DataFrame with shape: (<Delayed>, 21) (3D points)\n", |
92 | | - "│ └── 'molecules': DataFrame with shape: (<Delayed>, 12) (3D points)\n", |
93 | | - "├── Shapes\n", |
94 | | - "│ ├── 'cells_baysor': GeoDataFrame shape: (33222, 6) (2D shapes)\n", |
95 | | - "│ ├── 'cells_circles_baysor': GeoDataFrame shape: (5749, 2) (2D shapes)\n", |
96 | | - "│ ├── 'cells_layer_1_baysor': GeoDataFrame shape: (3797, 3) (2D shapes)\n", |
97 | | - "│ ├── 'cells_layer_2_baysor': GeoDataFrame shape: (4037, 3) (2D shapes)\n", |
98 | | - "│ ├── 'cells_layer_3_baysor': GeoDataFrame shape: (4298, 3) (2D shapes)\n", |
99 | | - "│ ├── 'cells_layer_4_baysor': GeoDataFrame shape: (4446, 3) (2D shapes)\n", |
100 | | - "│ ├── 'cells_layer_5_baysor': GeoDataFrame shape: (4362, 3) (2D shapes)\n", |
101 | | - "│ ├── 'cells_layer_6_baysor': GeoDataFrame shape: (4008, 3) (2D shapes)\n", |
102 | | - "│ ├── 'cells_layer_7_baysor': GeoDataFrame shape: (3394, 3) (2D shapes)\n", |
103 | | - "│ ├── 'cells_layer_8_baysor': GeoDataFrame shape: (2717, 3) (2D shapes)\n", |
104 | | - "│ └── 'cells_layer_9_baysor': GeoDataFrame shape: (2163, 3) (2D shapes)\n", |
105 | | - "└── Tables\n", |
106 | | - " ├── 'gene_expression_baysor': AnnData (5800, 240)\n", |
107 | | - " └── 'gene_expression_cellpose': AnnData (8439, 241)\n", |
108 | | - "with coordinate systems:\n", |
109 | | - " ▸ 'global', with elements:\n", |
110 | | - " stains (Images), dapi_labels (Labels), membrane_labels (Labels), cells_centroids_cellpose (Points), molecule_baysor (Points), molecules (Points), cells_baysor (Shapes), cells_circles_baysor (Shapes), cells_layer_1_baysor (Shapes), cells_layer_2_baysor (Shapes), cells_layer_3_baysor (Shapes), cells_layer_4_baysor (Shapes), cells_layer_5_baysor (Shapes), cells_layer_6_baysor (Shapes), cells_layer_7_baysor (Shapes), cells_layer_8_baysor (Shapes), cells_layer_9_baysor (Shapes)" |
111 | | - ] |
112 | | - }, |
113 | | - "execution_count": 4, |
114 | | - "metadata": {}, |
115 | | - "output_type": "execute_result" |
116 | | - } |
117 | | - ], |
118 | | - "source": [ |
119 | | - "sdata" |
120 | | - ] |
121 | | - }, |
122 | | - { |
123 | | - "cell_type": "code", |
124 | | - "execution_count": 5, |
125 | | - "metadata": {}, |
126 | | - "outputs": [ |
127 | | - { |
128 | | - "data": { |
129 | | - "text/html": [ |
130 | | - "<div>\n", |
131 | | - "<style scoped>\n", |
132 | | - " .dataframe tbody tr th:only-of-type {\n", |
133 | | - " vertical-align: middle;\n", |
134 | | - " }\n", |
135 | | - "\n", |
136 | | - " .dataframe tbody tr th {\n", |
137 | | - " vertical-align: top;\n", |
138 | | - " }\n", |
139 | | - "\n", |
140 | | - " .dataframe thead th {\n", |
141 | | - " text-align: right;\n", |
142 | | - " }\n", |
143 | | - "</style>\n", |
144 | | - "<table border=\"1\" class=\"dataframe\">\n", |
145 | | - " <thead>\n", |
146 | | - " <tr style=\"text-align: right;\">\n", |
147 | | - " <th></th>\n", |
148 | | - " <th>x</th>\n", |
149 | | - " <th>y</th>\n", |
150 | | - " <th>z</th>\n", |
151 | | - " <th>molecule_id</th>\n", |
152 | | - " <th>z_um</th>\n", |
153 | | - " <th>area</th>\n", |
154 | | - " <th>gene</th>\n", |
155 | | - " <th>brightness</th>\n", |
156 | | - " <th>x_um</th>\n", |
157 | | - " <th>qc_score</th>\n", |
158 | | - " <th>y_um</th>\n", |
159 | | - " <th>total_magnitude</th>\n", |
160 | | - " </tr>\n", |
161 | | - " </thead>\n", |
162 | | - " <tbody>\n", |
163 | | - " <tr>\n", |
164 | | - " <th>0</th>\n", |
165 | | - " <td>1705.0</td>\n", |
166 | | - " <td>1271.0</td>\n", |
167 | | - " <td>0.0</td>\n", |
168 | | - " <td>1</td>\n", |
169 | | - " <td>2.5</td>\n", |
170 | | - " <td>4</td>\n", |
171 | | - " <td>Maoa</td>\n", |
172 | | - " <td>2.021306</td>\n", |
173 | | - " <td>-2935.386</td>\n", |
174 | | - " <td>0.954363</td>\n", |
175 | | - " <td>-1218.580</td>\n", |
176 | | - " <td>420.1126</td>\n", |
177 | | - " </tr>\n", |
178 | | - " <tr>\n", |
179 | | - " <th>1</th>\n", |
180 | | - " <td>1725.0</td>\n", |
181 | | - " <td>1922.0</td>\n", |
182 | | - " <td>0.0</td>\n", |
183 | | - " <td>2</td>\n", |
184 | | - " <td>2.5</td>\n", |
185 | | - " <td>4</td>\n", |
186 | | - " <td>Maoa</td>\n", |
187 | | - " <td>1.828640</td>\n", |
188 | | - " <td>-2933.229</td>\n", |
189 | | - " <td>0.908246</td>\n", |
190 | | - " <td>-1147.614</td>\n", |
191 | | - " <td>269.5874</td>\n", |
192 | | - " </tr>\n", |
193 | | - " <tr>\n", |
194 | | - " <th>2</th>\n", |
195 | | - " <td>1753.0</td>\n", |
196 | | - " <td>1863.0</td>\n", |
197 | | - " <td>0.0</td>\n", |
198 | | - " <td>3</td>\n", |
199 | | - " <td>2.5</td>\n", |
200 | | - " <td>5</td>\n", |
201 | | - " <td>Maoa</td>\n", |
202 | | - " <td>2.001268</td>\n", |
203 | | - " <td>-2930.104</td>\n", |
204 | | - " <td>0.977219</td>\n", |
205 | | - " <td>-1154.062</td>\n", |
206 | | - " <td>501.4615</td>\n", |
207 | | - " </tr>\n", |
208 | | - " <tr>\n", |
209 | | - " <th>3</th>\n", |
210 | | - " <td>1760.0</td>\n", |
211 | | - " <td>1865.0</td>\n", |
212 | | - " <td>0.0</td>\n", |
213 | | - " <td>4</td>\n", |
214 | | - " <td>2.5</td>\n", |
215 | | - " <td>7</td>\n", |
216 | | - " <td>Maoa</td>\n", |
217 | | - " <td>1.960428</td>\n", |
218 | | - " <td>-2929.339</td>\n", |
219 | | - " <td>0.991316</td>\n", |
220 | | - " <td>-1153.784</td>\n", |
221 | | - " <td>639.0364</td>\n", |
222 | | - " </tr>\n", |
223 | | - " <tr>\n", |
224 | | - " <th>4</th>\n", |
225 | | - " <td>1904.0</td>\n", |
226 | | - " <td>794.0</td>\n", |
227 | | - " <td>0.0</td>\n", |
228 | | - " <td>5</td>\n", |
229 | | - " <td>2.5</td>\n", |
230 | | - " <td>6</td>\n", |
231 | | - " <td>Maoa</td>\n", |
232 | | - " <td>1.937280</td>\n", |
233 | | - " <td>-2913.718</td>\n", |
234 | | - " <td>0.983210</td>\n", |
235 | | - " <td>-1270.474</td>\n", |
236 | | - " <td>519.3154</td>\n", |
237 | | - " </tr>\n", |
238 | | - " </tbody>\n", |
239 | | - "</table>\n", |
240 | | - "</div>" |
241 | | - ], |
242 | | - "text/plain": [ |
243 | | - " x y z molecule_id z_um area gene brightness x_um \\\n", |
244 | | - "0 1705.0 1271.0 0.0 1 2.5 4 Maoa 2.021306 -2935.386 \n", |
245 | | - "1 1725.0 1922.0 0.0 2 2.5 4 Maoa 1.828640 -2933.229 \n", |
246 | | - "2 1753.0 1863.0 0.0 3 2.5 5 Maoa 2.001268 -2930.104 \n", |
247 | | - "3 1760.0 1865.0 0.0 4 2.5 7 Maoa 1.960428 -2929.339 \n", |
248 | | - "4 1904.0 794.0 0.0 5 2.5 6 Maoa 1.937280 -2913.718 \n", |
249 | | - "\n", |
250 | | - " qc_score y_um total_magnitude \n", |
251 | | - "0 0.954363 -1218.580 420.1126 \n", |
252 | | - "1 0.908246 -1147.614 269.5874 \n", |
253 | | - "2 0.977219 -1154.062 501.4615 \n", |
254 | | - "3 0.991316 -1153.784 639.0364 \n", |
255 | | - "4 0.983210 -1270.474 519.3154 " |
256 | | - ] |
257 | | - }, |
258 | | - "execution_count": 5, |
259 | | - "metadata": {}, |
260 | | - "output_type": "execute_result" |
261 | | - } |
262 | | - ], |
263 | | - "source": [ |
264 | | - "sdata.points['molecules'].head()" |
265 | | - ] |
266 | | - }, |
267 | | - { |
268 | | - "cell_type": "code", |
269 | | - "execution_count": 9, |
| 37 | + "execution_count": null, |
270 | 38 | "metadata": {}, |
271 | 39 | "outputs": [], |
272 | 40 | "source": [ |
|
291 | 59 | }, |
292 | 60 | { |
293 | 61 | "cell_type": "code", |
294 | | - "execution_count": 27, |
| 62 | + "execution_count": null, |
295 | 63 | "metadata": {}, |
296 | 64 | "outputs": [], |
297 | 65 | "source": [ |
|
302 | 70 | "# Add data to the configuration:\n", |
303 | 71 | "\n", |
304 | 72 | "dataset = vc.add_dataset(name='MERFISH').add_object(SpatialDataWrapper(\n", |
305 | | - " sdata_store=spatialdata_filepath,\n", |
| 73 | + " sdata_url=sdata_url,\n", |
306 | 74 | " # The following paths are relative to the root of the SpatialData zarr store on-disk.\n", |
307 | 75 | " image_path=\"images/stains\",\n", |
308 | 76 | " coordinate_system=\"global\",\n", |
309 | 77 | " coordination_values={\n", |
310 | 78 | " \"fileUid\": \"stains\"\n", |
311 | 79 | " }\n", |
312 | 80 | ")).add_object(SpatialDataWrapper(\n", |
313 | | - " sdata_store=spatialdata_filepath,\n", |
| 81 | + " sdata_url=sdata_url,\n", |
314 | 82 | " # The following paths are relative to the root of the SpatialData zarr store on-disk.\n", |
315 | 83 | " labels_path=\"labels/dapi_labels\",\n", |
316 | 84 | " coordinate_system=\"global\",\n", |
|
319 | 87 | " \"fileUid\": \"dapi\"\n", |
320 | 88 | " }\n", |
321 | 89 | ")).add_object(SpatialDataWrapper(\n", |
322 | | - " sdata_store=spatialdata_filepath,\n", |
| 90 | + " sdata_url=sdata_url,\n", |
323 | 91 | " # The following paths are relative to the root of the SpatialData zarr store on-disk.\n", |
324 | 92 | " labels_path=\"labels/membrane_labels\",\n", |
325 | 93 | " coordinate_system=\"global\",\n", |
|
393 | 161 | }, |
394 | 162 | { |
395 | 163 | "cell_type": "code", |
396 | | - "execution_count": 28, |
| 164 | + "execution_count": null, |
397 | 165 | "metadata": {}, |
398 | | - "outputs": [ |
399 | | - { |
400 | | - "data": { |
401 | | - "application/vnd.jupyter.widget-view+json": { |
402 | | - "model_id": "65667908b55d48d583d8b0d44aaba152", |
403 | | - "version_major": 2, |
404 | | - "version_minor": 1 |
405 | | - }, |
406 | | - "text/plain": [ |
407 | | - "VitessceWidget(config={'version': '1.0.17', 'name': 'SpatialData with MERFISH data', 'description': '', 'datas…" |
408 | | - ] |
409 | | - }, |
410 | | - "execution_count": 28, |
411 | | - "metadata": {}, |
412 | | - "output_type": "execute_result" |
413 | | - } |
414 | | - ], |
| 166 | + "outputs": [], |
415 | 167 | "source": [ |
416 | 168 | "vw = vc.widget()\n", |
417 | 169 | "vw" |
|
0 commit comments