Skip to content

Added script to run real-world data #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions test_sandbox_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python

# # Load real-world data and verify that functions run on it
# ### How to use this script
# - If you need it interactive, convert it to a jupyter notebook with `p2j` -> `p2j test_sandbox_data.py`
# - You can use `jupyter nbconvert --to python test_sandbox_data.ipynb` to convert it back
# - Otherwise run it from the CLI and verify that the plots are okay

# In[4]:


import matplotlib.pyplot as plt
import spatialdata as sd

import spatialdata_plot

assert spatialdata_plot.__name__ == "spatialdata_plot" # so mypy doesn't complain

DATA_DIR = "/Users/tim.treis/Documents/GitHub/spatialdata-sandbox/"


# ## Load data
# Adjust paths as neccecary

# In[15]:


# Mibi

sdata = sd.read_zarr(DATA_DIR + "mibitof/data.zarr")
sdata.pl.render_images().pl.render_labels().pl.show()

plt.savefig("mibi.png")


# In[16]:


# Visium

sdata = sd.read_zarr(DATA_DIR + "visium/data.zarr")
sdata.pl.render_images().pl.render_shapes().pl.show(width=12, height=12)

plt.savefig("visium.png")