Skip to content

Commit dc18b92

Browse files
committed
Added script to run real-world data
1 parent bc0947d commit dc18b92

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

test_sandbox_data.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
# # Load real-world data and verify that functions run on it
5+
# ### How to use this script
6+
# - If you need it interactive, convert it to a jupyter notebook with `p2j` -> `p2j test_sandbox_data.py`
7+
# - You can use `jupyter nbconvert --to python test_sandbox_data.ipynb` to convert it back
8+
# - Otherwise run it from the CLI and verify that the plots are okay
9+
10+
# In[12]:
11+
12+
13+
get_ipython().run_line_magic("load_ext", "autoreload")
14+
get_ipython().run_line_magic("autoreload", "2")
15+
DATA_DIR = "/Users/tim.treis/Documents/GitHub/spatialdata-sandbox/"
16+
17+
18+
# In[13]:
19+
20+
21+
import matplotlib.pyplot as plt
22+
import numpy as np
23+
import pandas as pd
24+
import spatialdata as sd
25+
26+
import spatialdata_plot
27+
28+
29+
# In[15]:
30+
31+
32+
# Mibi
33+
34+
sdata = sd.read_zarr(DATA_DIR + "mibitof/data.zarr")
35+
sdata.pl.render_images().pl.render_labels().pl.show()
36+
37+
plt.savefig("mibi.png")
38+
39+
40+
# In[16]:
41+
42+
43+
# Visium
44+
45+
sdata = sd.read_zarr(DATA_DIR + "visium/data.zarr")
46+
sdata.pl.render_images().pl.render_shapes().pl.show(width=12, height=12)
47+
48+
plt.savefig("visium.png")

0 commit comments

Comments
 (0)