Skip to content

Commit 549a6eb

Browse files
Added script to run real-world data (#30)
* Added script to run real-world data * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed script --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 417565c commit 549a6eb

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

test_sandbox_data.py

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

0 commit comments

Comments
 (0)