Metadata-Version: 2.4
Name: SpatialFeatureExperiment
Version: 0.0.5
Summary: Container class for storing data from spatial feature experiments
Home-page: https://github.com/biocpy/spatialfeatureexperiment
Author: Jayaram Kancherla
Author-email: jayaram.kancherla@gmail.com
License: MIT
Project-URL: Documentation, https://github.com/biocpy/spatialfeatureexperiment
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
License-File: LICENSE.txt
Requires-Dist: importlib-metadata; python_version < "3.8"
Requires-Dist: spatialexperiment>=0.0.12
Requires-Dist: pillow
Requires-Dist: geopandas
Requires-Dist: shapely
Requires-Dist: requests
Requires-Dist: rasterio
Requires-Dist: aicsimageio
Requires-Dist: numcodecs<=0.15.1
Requires-Dist: libpysal
Provides-Extra: optional
Requires-Dist: pandas; extra == "optional"
Requires-Dist: anndata; extra == "optional"
Requires-Dist: delayedarray; extra == "optional"
Provides-Extra: testing
Requires-Dist: setuptools; extra == "testing"
Requires-Dist: pytest; extra == "testing"
Requires-Dist: pytest-cov; extra == "testing"
Requires-Dist: pandas; extra == "testing"
Requires-Dist: anndata; extra == "testing"
Requires-Dist: delayedarray; extra == "testing"
Dynamic: license-file

[![PyPI-Server](https://img.shields.io/pypi/v/SpatialFeatureExperiment.svg)](https://pypi.org/project/SpatialFeatureExperiment/)
![Unit tests](https://github.com/BiocPy/SpatialFeatureExperiment/actions/workflows/run-tests.yml/badge.svg)

# SpatialFeatureExperiment

A Python package for storing and analyzing spatial-omics experimental data. This package provide the `SpatialFeatureExperiment` class, based on the [R package and class](https://github.com/pachterlab/SpatialFeatureExperiment).

## Install

To get started, install the package from [PyPI](https://pypi.org/project/SpatialFeatureExperiment/)

```bash
pip install spatialfeatureexperiment
```

## Quick Usage

This package uses shapely and geopandas to support the `*_geometries` slots.

```python
from spatialexperiment import SpatialFeatureExperiment
import numpy as np
import geopandas as gpd
from shapely.geometry import Polygon

nrows = 200
ncols = 500
counts = np.random.rand(nrows, ncols)
polys = gpd.GeoSeries(
    [
        Polygon([(1, -1), (1, 0), (0, 0)]),
        Polygon([(3, -1), (4, 0), (3, 1)]),
    ]
)

colgeoms = {"polygons" : gpd.GeoDataFrame({"geometry": polys})}
tspe = SpatialFeatureExperiment(assays={"spots": counts}, col_geometries=colgeoms)
```

<!-- biocsetup-notes -->

## Note

This project has been set up using [BiocSetup](https://github.com/biocpy/biocsetup)
and [PyScaffold](https://pyscaffold.org/).
