[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge branch 'main' into BioinfoTongLI/main
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato committed May 2, 2024
2 parents c436785 + de79d25 commit 121cfd1
Show file tree
Hide file tree
Showing 29 changed files with 2,487 additions and 256 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
release:
types: [published]

jobs:
release:
# requires that you have put your twine API key in your
# github secrets (see readme for details)
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install hatch
run: pip install hatch

- name: Build project for distribution
run: hatch build

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

Expand All @@ -49,7 +49,7 @@ jobs:
pip install pytest-cov
- name: Install dependencies
run: |
pip install -e ".[dev,test]"
pip install --pre -e ".[dev,test]"
- name: Test
env:
MPLBACKEND: agg
Expand All @@ -62,29 +62,3 @@ jobs:
with:
name: coverage
verbose: true
deploy:
# this will run when you have tagged a commit, starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: [test]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install hatch
run: pip install hatch

- name: Build project for distribution
run: hatch build

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ __pycache__/
# IDEs
/.idea/
/.vscode/
/.spyproject/

# docs
/docs/generated/
/docs/_build/

# other
_version.py
.code-workspace
temp/
node_modules/
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
rev: 1.16.0
hooks:
- id: blacken-docs
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
rev: v1.9.0
hooks:
- id: mypy
additional_dependencies: [numpy]
additional_dependencies: [numpy, types-PyYAML]
exclude: docs/
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
Expand All @@ -40,7 +40,7 @@ repos:
- flake8-bugbear
- flake8-blind-except
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: detect-private-key
- id: check-ast
Expand All @@ -50,7 +50,7 @@ repos:
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.0
rev: v2.3.1
hooks:
- id: autoflake
args:
Expand All @@ -59,7 +59,7 @@ repos:
- --remove-unused-variable
- --ignore-init-module-imports
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -70,7 +70,7 @@ repos:
- flake8-bugbear
- flake8-blind-except
- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py3-plus, --py39-plus, --keep-runtime-typing]
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ python:
path: .
extra_requirements:
- doc
- pre
98 changes: 95 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,101 @@ and this project adheres to [Semantic Versioning][].
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## [Unreleased]
## [0.1.3] - xxxx-xx-xx

### Added

- Basic tool, preprocessing and plotting functions
- An experimental loader to load elemental ISS data objects, e.g. raw.tif, label.tif and anndata.h5ad
- (Xenium) support reading multi-polygon selection files from the Xenium Explorer
- (ISS) An experimental loader to load elemental ISS data objects, e.g. raw.tif, label.tif and anndata.h5ad

### Fixed

- (Visium) Fixed issue with joining a SpatialElement with a table due to index values not being unique.
obs_names_make_unique is now called internally to enforce unique index values allowing for join operations.

## [0.1.2] - 2024-03-30

### Added

- (Visium HD) added reader, coauthored by @LLehner

### Fixed

- (Xenium) reader for 1.0.1 (paper data) and unknown versions
- (Xenium) fix in reading "minimalistic" Xenium datasets #132

## [0.1.1] - 2024-03-24

### Added

- (Xenium) support for post-xenium aligned images (IF, HE)
- (Xenium) reader for the selection coordinates file from the Xenium Explorer
- (Xenium) support for the new Xenium 2.0.0 (multimodal segmentation)
- (Xenium) reading multiscale labels from cells.zarr.zip
- (MCMICRO) support for TMAs (such as the data of exemplar-002)
- (DBiT-seq) reader
- converter functions `experimental.to_legacy_anndata()` and `experimental.from_legacy_anndata()`
- (Visium) support for raw reads (capture locations not under tissue)

### Fixed

- (Xenium) fixed index (fail on write)
- (Xenium) renamed cells_as_shapes to cells_as_circles; set default to True
- (MERSCOPE) don't try to load unexisting elements #87
- (Visium) fixed axes ordering

## [0.0.9] - 2023-11-06

### Fixed

- (Xenium) bug when converting feature_name #81, from @fbnrst
- (Visium) visium() supports file counts without dataset_id #91

## [0.0.8] - 2023-10-02

### Fixed

- (Xenium) coerce cell id to str #64
- (MERSCOPE) fix coordinate transformation #68
- (MERSCOPE) Improvements/fixes: merscope reader #73

## [0.0.7] - 2023-07-23

### Fixed

- Bugs in Xenium and MERSCOPE

## [0.0.5] - 2023-06-21

### Added

- MERFISH reader (from @quentinblampey)
- CODEX reader (from @LLehner)

### Fixed

- Issues on Visium reader (thanks @ilia-kats) and Xenium reader

## [0.0.4] - 2023-05-23

### Added

- Curio reader

## [0.0.3] - 2023-05-22

### Merged

- Merge pull request #40 from scverse/fix/categories

## [0.0.2] - 2023-05-04

### Changed

- Revert version regex (#37)

## [0.0.1] - 2023-05-04

### Tested

- Test installation from pypi
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@

[![Tests][badge-tests]][link-tests]
[![Documentation][badge-docs]][link-docs]
[![DOI](https://zenodo.org/badge/544045123.svg)](https://zenodo.org/badge/latestdoi/544045123)

[badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test_and_deploy.yaml/badge.svg
[link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test_and_deploy.yaml
[badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml/badge.svg
[link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml
[badge-docs]: https://img.shields.io/readthedocs/spatialdata-io

This package contains reader functions to load common spatial omics formats into SpatialData. Currently, we provide support for:

- NanoString CosMx
- MCMICRO (output data)
- Steinbock (output data)
- 10x Genomics Visium
- 10x Genomics Visium HD
- 10x Genomics Xenium
- Curio Seeker
- Akoya PhenoCycler (formerly CODEX)
- Curio Seeker
- DBiT-seq
- MCMICRO (output data)
- NanoString CosMx
- Steinbock (output data)
- Vizgen MERSCOPE (MERFISH)

## Getting started
Expand Down Expand Up @@ -50,9 +53,18 @@ pip install git+https://github.com/scverse/spatialdata-io.git@main
For questions and help requests, you can reach out in the [scverse discourse][scverse-discourse].
If you found a bug, please use the [issue tracker][issue-tracker].

## Readers from third-party libraries

Technologies that can be read into `SpatialData` objects using third-party libraries:

- METASPACE (MALDI, ...): [metaspace-converter](https://github.com/metaspace2020/metaspace-converter)
- PhenoCycler: [SOPA](https://github.com/gustaveroussy/sopa)
- MACSima: [SOPA](https://github.com/gustaveroussy/sopa)
- Hyperion (Imaging Mass Cytometry): [SOPA](https://github.com/gustaveroussy/sopa)

## Citation

[L Marconato*, G Palla*, KA Yamauchi*, I Virshup*, E Heidari, T Treis, M Toth, R Shrestha, H Vöhringer, W Huber, M Gerstung, J Moore, FJ Theis, O Stegle, bioRxiv, 2023](https://www.biorxiv.org/content/10.1101/2023.05.05.539647v1). \* = equal contribution
Marconato, L., Palla, G., Yamauchi, K.A. et al. SpatialData: an open and universal data framework for spatial omics. Nat Methods (2024). https://doi.org/10.1038/s41592-024-02212-x

[scverse-discourse]: https://discourse.scverse.org/
[issue-tracker]: https://github.com/scverse/spatialdata-io/issues
Expand Down
45 changes: 40 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,53 @@

I/O for the `spatialdata` project.

### Readers

```{eval-rst}
.. autosummary::
:toctree: generated
codex
curio
cosmx
curio
dbit
mcmicro
merscope
steinbock
visium
visium_hd
xenium
steinbock
merscope
mcmicro
```

### Experimental readers

```{eval-rst}
.. autosummary::
:toctree: generated
iss
```

### Conversion functions

### Experimental conversion functions

```{eval-rst}
.. currentmodule:: spatialdata_io.experimental
.. autosummary::
:toctree: generated
from_legacy_anndata
to_legacy_anndata
```

### Utility functions

```{eval-rst}
.. autosummary::
:toctree: generated
experimental - iss
xenium_aligned_image
xenium_explorer_selection
```
Loading

0 comments on commit 121cfd1

Please sign in to comment.