Skip to content

Commit f9e4750

Browse files
committed
a
1 parent 211dab3 commit f9e4750

File tree

4 files changed

+82
-4
lines changed

4 files changed

+82
-4
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: tests
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-python@v5
9+
with:
10+
python-version: "3.11"
11+
- run: pip install -U "pyXenium>=0.1.0" pytest
12+
- run: pytest

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,39 @@
33
A toy Python package for analyzing 10x Xenium data.
44

55
## Quickstart
6-
```bash
7-
pip install pyXenium
8-
pyXenium demo
9-
```
6+
## Installation
7+
8+
-```bash
9+
-pip install pyXenium
10+
-```
11+
+```bash
12+
+pip install -U "pyXenium>=0.2.0"
13+
+```
14+
15+
## Quickstart
16+
17+
+### Load a partial Xenium dataset from Hugging Face
18+
+The snippet below uses the public demo dataset and the v2 loader that supports `base_url`.
19+
+
20+
+```python
21+
+from pyXenium.io.partial_xenium_loader import load_anndata_from_partial
22+
+
23+
+BASE = "https://huggingface.co/datasets/hutaobo/pyxenium-gsm9116572/resolve/main"
24+
+
25+
+adata = load_anndata_from_partial(
26+
+ base_url=BASE,
27+
+ analysis_name="analysis.zarr.zip",
28+
+ cells_name="cells.zarr.zip",
29+
+ transcripts_name="transcripts.zarr.zip",
30+
+ # Optional: if you uploaded a 10x MEX triplet under BASE/mex/
31+
+ # mex_dir=BASE + "/mex",
32+
+ # mex_matrix_name="matrix.mtx.gz",
33+
+ # mex_features_name="features.tsv.gz",
34+
+ # mex_barcodes_name="barcodes.tsv.gz",
35+
+ build_counts_if_missing=True,
36+
+)
37+
+print(adata)
38+
+```
39+
+
40+
+> **Note:** Requires `pyXenium>=0.2.0`. The dataset used above is hosted at:
41+
+> - Hugging Face Datasets: `hutaobo/pyxenium-gsm9116572`
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Load a partial Xenium dataset (remote)
2+
3+
This example loads a public demo dataset directly from Hugging Face using the v2 loader that supports `base_url`.
4+
5+
> **Requirements**
6+
>
7+
> - `pyXenium >= 0.2.0`
8+
> - Internet access for the first run (files are streamed/downloaded)
9+
10+
```python
11+
# doctest: +ELLIPSIS
12+
from pyXenium.io.partial_xenium_loader import load_anndata_from_partial
13+
14+
BASE = "https://huggingface.co/datasets/hutaobo/pyxenium-gsm9116572/resolve/main"
15+
16+
adata = load_anndata_from_partial(
17+
base_url=BASE,
18+
analysis_name="analysis.zarr.zip",
19+
cells_name="cells.zarr.zip",
20+
transcripts_name="transcripts.zarr.zip",
21+
# Optional 10x MEX:
22+
# mex_dir=BASE + "/mex",
23+
# mex_matrix_name="matrix.mtx.gz",
24+
# mex_features_name="features.tsv.gz",
25+
# mex_barcodes_name="barcodes.tsv.gz",
26+
build_counts_if_missing=True,
27+
)
28+
29+
print(adata) # doctest: +ELLIPSIS

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ pyXenium = ["data/**", "*.csv", "*.zarr", "*.txt"]
3535

3636
[project.scripts]
3737
pyxenium-import-partial = "pyXenium.io.partial_xenium_loader:app"
38+
39+
# pytest.ini
40+
[pytest]
41+
addopts = -q
42+
doctest_glob = docs/**/*.md

0 commit comments

Comments
 (0)